Random Linux/Unix notes
I’m running a linux server for the first time at home, taking notes for myself (and maybe they’ll be helpful to someone else some day).
fdisk /dev/hdblah - Format/edit partition table
mke2fs -j /dev/hdblah - Turn partition into Ext3 file system
mdadm - Multi-disk administration tool (for RAID)
/etc/fstab - Specifies mount points for things on startup
/dev/hd[a-z] - IDE hard drives
/dev/sd[a-z] - SCSI (or SATA) hard drives
/dev/hd[0-9] - Partitions
/dev/md[0-9] - Linux software RAID drives
sudo apt-get install build-essential linux-headers-`uname -r` - apt-get most of the things needed to do development (or build packages *grumble*).
mount -t smbfs //wonderland/stuff - Mount over samba
ls --show-control-chars - ls but showing UTF-8 characters correctly
If, when you do apt-get you are getting these errors:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en",
LC_ALL = "en_US.UTF-8",
LANG = "en"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
It can be fixed by doing: sudo apt-get install locales
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 8080 -j DNAT --to 192.168.1.103:8080
sudo iptables -A INPUT -p tcp -m state --state NEW --dport 8080 -i eth0 -j ACCEPT