Skip to content

Instantly share code, notes, and snippets.

@zoechi
zoechi / CountFiles
Created June 10, 2013 12:39
Count files in a directory and all subdirectories
find . -type f | wc -l
@zoechi
zoechi / DHCP renew
Created June 2, 2013 17:05
DHCP renew
dhclient -r # release
dhclient # get ip
@zoechi
zoechi / Send signal
Created June 1, 2013 13:05
Send signal to a process
kill -s SIGUSR1 $(pidof /usr/sbin/dnsmasq)
@zoechi
zoechi / Create new group
Created May 30, 2013 13:42
Create new group
addgroup zburbach
addgroup --gid 1002 zburbach # with specific gid
@zoechi
zoechi / Add user to group
Created May 30, 2013 13:41
Add existing user to existing group
usermod -a -G groupname username
@zoechi
zoechi / Mount NFS share
Created May 30, 2013 13:21
Mount NFS share
mount -t nfs4 -o proto=tcp,port=2049 server.domain.local:/share /mnt/mountdir
@zoechi
zoechi / Mount partition of directory
Created May 24, 2013 05:50
Is there a Linux command to easily find out which partition/mount a directory or file is on? (This is probably a RTFM question, and I feel guilty for asking it, but somehow, I can't find a good answer on google just yet..) http://stackoverflow.com/questions/3274354/how-to-find-out-mount-partition-a-directory-or-file-is-on-linux-server
df -P file/goes/here | tail -1 | cut -d' ' -f 1
@zoechi
zoechi / RDP Client
Created May 23, 2013 16:18
RDP Client
rdesktop
@zoechi
zoechi / List drives
Created May 20, 2013 17:26
List drives
lsblk
@zoechi
zoechi / Change TimeZone
Created May 20, 2013 16:16
Change TimeZone
dpkg-reconfigure tzdata