My Unix Notes

Those tips and tricks which make my life easier:

1) Search for the text files' content:
grep --include=\*.{ATP,atp} -rnwi ./ -e "PFI13A"


2) Search for a file and then apply some command in it:
find ./ -iname *TrT*DJEQ3*.atp -print | xargs -i cp {} ~/Dropbox/AL/Mestrado\ UNICAMP/Disciplinas/Sobretensões/TRT/

3) Search for a file name and then remove the first 2 lines:
find ./ -iname '*.adf' -print | xargs -i sed -i 1,2d {}

PS: sed is slow as hell doing it, so be careful when manipulating big text files with the -i flag.

4) Purge older kernels in openSUSE:
touch /boot/do_purge_kernels && systemctl start purge-kernels

source: stolen from #opensuse @ freenode: ProhtMeyhet

5) Hide processes from one user to another:

6) Restart KDE alt+f2 dialog (krunner)

7) Remove an installed package and also its unneeded dependencies (openSUSE):
zypper remove --clean-deps package

8) Disable Intel i7 turbo boost (very important for benchmarking!!):
# echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo


9) Temporaly disable KWIN - Useful to play 3d games.


10) Power management in openSUSE

11) List all installed version from a specific package with zypper:
zypper info -s package

zypper search -s package

source: manpages

12) Install Google Chrome on openSUSE:
# zypper ar Google-Chrome
# zypper ref
# zypper install google-chrome-stable


13) Enabling magic sysrq keys in openSUSE:
Edit /etc/sysctl.conf 
kernel.sysrq = 0 
kernel.sysrq = 1

more info:

14) Doing interactively plot and don't let the window close automatically:
gnuplot -persist file.plot


15) Debugging wine and recovering from when it doesn't want to start some application:

16) Discovering the storage device names for udev:
# blkid

17) Gluing together two column based text files:
$ paste file1 file2


18) Building openvpn server over Ubuntu 12.04 or 14.04.

19) Cloning disks with dd:

20) Automatically repairing linux file system at reboot and other tunning options:

21) Setting disk i/o priority with ionice:

22) Setting linux priorities ionice, cpulimit and cgroups:

23) For some weird reason virtualbox stopped spanning to 1920 x 1080. Doubling the video ram memory seemed to work.
VBoxManage modifyvm "virtualmachine" --vram 256


24) Using clamav to scan files and verify if they're infected with virus:
clamscan -r –bell -i /dir/


25) Many useful cheat sheets:

26) Letting users open ports below 1024 into FreeBSD:
sysctl net.inet.ip.portrange.reservedhigh=0

better indeed, insert this parameter in /etc/sysctl.conf

27) Linux performance tools:

29) Sorting text files:
sort -kColuna -n


30) A lof of sysadmins interesting tools:

31) Priorizing network usage by PID, iptables and tc. Good links:

32) Fixing file names with unsupported enconding
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki