Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
AMD

Journal va3atc's Journal: Useful Linux commands to not loose :-)

This post is for linux commands and information I don't want to loose; what other place to backup then on slashdot, eh? :-)

Test speed of hard disk
--------------------------------------
hdparm -tT /dev/hdX

Enable DMA on hard disk
--------------------------------------
hdparm -d1 /dev/hda

Recover RPM freeze (after system restart of course)
--------------------------------------
kill the rpm, rm -f /var/lib/rpm/__*, rpm --rebuilddb, try
+again (don't remove the __ )

Log ps aux every 1 second to file
--------------------------------------
#!/bin/sh
while [ 0 ]; do ps aux >>/mnt/dos/linux/ps_ax_log; sleep 1; done

Some port check thingy
--------------------------------------
netstat -tn | grep (portnum)
or lsof -i (prot):(port)

My NAT settings that work for Redhat 8.0
--------------------------------------
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward

backup MBR

dd if=/dev/hda of=hda.mbr bs=512 count=1

For knoppix its
sudo sh -c 'echo 1 > /proc/whatever'

To mount something that is accessible by everyone (aka FTP & HTTP)
--------------------------------------
mount it with gid=<your users group> and a umask that lets everyone have read access
when youre within your account
whoami --> actually its ID (lower case)
should give you the gid
<FoPref> try -o umask=000 (IIRC this is what I used)
This discussion has been archived. No new comments can be posted.

Useful Linux commands to not loose :-)

Comments Filter:

I've noticed several design suggestions in your code.

Working...