Misc

Add VIP

ifconfig eth0:1 192.168.50.53 netmask 255.255.255.0

CD burning

growisofs -dvd-compat -Z /dev/dvd=DVD_Image.iso -speed 2

Change files permission

find . ! -type d -exec chmod 600 {} \;

Certificate fix

sudo zypper install ca-certificates-cacert

Change lock screen background

sudo rm /usr/share/backgrounds/linuxmint/default_background.jpg
sudo ln -s /path/to/new/background.jpg /usr/share/backgrounds/linuxmint/default_background.jpg

Delete files older than X days

find filename.* -mtime +15 -exec rm {} \;

Find in files

find / -iname //file_wildcard// | xargs grep //text_to_find// -n
find . -type f -exec grep -H 'text-to-find-here' {} \;

List folders size descending

du -ahx / | sort -hr | head -n 30

Ping socket error fix

sudo chmod 4711 /bin/ping /usr/bin/ping

Probe network card

sudo rmmod e1000
sudo modprobe e1000
sudo dmesg | tail

Rename files to lower case

for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; done

Replace in file

find ./ -type f -exec sed -i 's/string_to_find/string_to_replace/g' {} \;

Send email

echo "Subject: sendmail test" | sendmail -v chung.tran@bottomline.com

Update fonts cache

sudo fc-cache -fv

Virtualenvwrapper fix

sudo find /usr/local/lib/ -type d -exec chmod 0755 {} \;
sudo find /usr/local/lib/ -type f -exec chmod 0644 {} \;

VNC tab fix

xfconf-query -c xfce4-keyboard-shortcuts -p /xfwm4/custom/'<'Super'>'Tab -r

Wake on LAN

#!/bin/bash
ethtool -s eth0 wol g
exit