Clear a log file
echo -n > development.log
2179 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
echo -n > development.log
xmodmap -e "keysym a = a A ae AE less less" xmodmap -e "keysym z = z Z guillemotleft less greater greater" xmodmap -e "keysym semicolon = period semicolon horizconnector multiply horizconnector multiply" xmodmap -e "keysym ugrave = percent percent percent percent percent percent"
xmodmap -pke | less
netstat -an | grep :80 | awk '{ print $5 }' | awk -F: '{ print $1 }' | sort | uniq -c | sort -n
chown -R youruser:youruser /thedirectory find /thedirectory -type f -exec chmod 0644 {} \; find /thedirectory -type d -exec chmod 0755 {} \;
mount imagen.mdf /path/mount_directory -o loop=/dev/loop0
dd if=/dev/cdrom of=/directory/filename.iso mount -o loop /directory/filename.iso /mountpoint/
perl -lne '$c++ while /SEARCH_STRING/g; END { print $c; }'
mysqldump my_db | perl -lne '$c++ while /ABCD/g; END { print $c; }'
tar cvf - my_dir | gzip -c > my_dir.tar.gz
gunzip -c my_dir.tar.gz | tar xvf -
cvs export
cvs checkout
find . -name CVS -prune -exec rm -rf {} \;
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # This is a list of hotpluggable network interfaces. # They will be activated automatically by the hotplug subsystem. mapping hotplug script grep map eth0 # The primary network interface auto eth0 iface eth0 inet static address 192.168.178.50 netmask 255.255.255.0 network 192.168.178.0 broadcast 192.168.178.255 gateway 192.168.178.1 #optional #dns-nameserver 102.168.178.1
nameserver 192.168.178.1
for i in *.tar; do echo working on $i; tar xvzf $i ; done
find /PATH/TO/STARTING/DIRECTORY -type f -name "*.jpg" -delete
du -sh /PATH/TO/DIRECTORY
ln -s /home/dir_to /home/dir_from //dir_to is the existing directory you want dir_from to point to symbolically
rpm2cpio filename | cpio -i --make-directories
sudo chmod u+s /usr/bin/shfsmount /usr/bin/shfsumount
#!/bin/bash ## USAGE: add_to_server.sh remote_server ## This script will add your ssh dsa public key to remote_server's authorized_keys list, ## assuming that everything is in it's default location set -v # verbose output username="USERNAME" # CHANGE ME!!!! remote_server=$1 # assigns the first commandline argument to $remote_server ## Pipe the public key to ssh, then remotely touch the file to make sure it will be there, and concat to the end of it. ## Might work without the touch? cat ~/.ssh/id_dsa.pub | ssh ${username}@${remote_server} "touch ~/.ssh/authorized_keys && cat - >> ~/.ssh/authorized_keys" exit 0
setterm -blength 0
/etc/network/interfacesand adjust it to your needs (in this example setup I will use the IP address 192.168.0.100):
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # This is a list of hotpluggable network interfaces. # They will be activated automatically by the hotplug subsystem. mapping hotplug script grep map eth0 # The primary network interface auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1
#!/bin/sh for i in `find . -regex '.*\._.*'`; do rm $i; echo "removing $i"; done