Friday, April 25, 2014

Useful tips when working with Linux

How to determine external IP from console:
wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
or

curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Remove the old lock of serial port in Linux.

Often, after using minicom program the lock-file was not deleted. You can delete it manually in /var/tmp or /var/lock.

How to copy compressed files safely.
If the SSH server does not support data compression:
ssh username@host "gzip -c9 /backup/source.file" | gzip -dc > ~/target.file
If the SSH server supports data compression and encryption algorithm supports blowfish:

scp -C -c blowfish username@host:/backup/source.file

How to find process, that  prevents to unmounting partition:

fuser -muv /dev/sda5 (write this right name of partition).

How to make fast system backup:
tar -cvpf /backups/fullbackup.tar --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=backups

Also there are many other tips for Linux operating system.

No comments:

Post a Comment