Saturday, March 26, 2011

General Linux notes

Below are some useful Linux commands.

To mount a ramdisk:
mount -t tmpfs none /mnt/point

This is a cool way to share  command line session with someone on a Linux box:
1) make the remote user run screen
2) run screen -x
using the procedure, 2 people can collaborate, and type together in the same terminal on a linux machine where 1 or both of the people are remotely sshed in and not sitting in front of the computer.

Netcat is a cool program. It is a hacker's "Swiss Army Knife" essentially, all it does it open a network connection to the specified host at the specified port, and write data. Here's a way to transfer files without setting up SMB/sftp/ftp/whatever else:
push from sending side: cat backup.iso | nc 3333
receive on receiving side: nc -l 3333 > backup.iso

Set a static IP on your linux machine from the command line?:
ifconfig eth0 dstaddr netmask up

Backup local files to an rsync server:
rsync -avzPi --stats -e ssh <local files or folders> USER@IPADDRESS:<remote folder>

set system time from the command line:
date <date/time code>     //sets the OS time
/sbin/hwclock --systohc   //write the OS time to hardware

No comments:

Post a Comment