Useful comands

Short URL
curl https://www.googleapis.com/urlshortener/v1/url  -H 'Content-Type: application/json'   -d '{"longUrl": "http://www.blick.ch/"}'

Scan network
Slow variant to scan network without the use of additional tools using icmp echo. for ip in {1..254}; do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done This only works with bash. If no bash is available try:, or   for OpenBSD, instead of.

Check interface capabilities
All informations can be found in the following folder: cat /sys/class/net/ethX/xxx F.e. cat /sys/class/net/eth0/speed 1000 Note:The interface has to be enabled.

Change Keymap
loadkeys /usr/share/keymaps/i386/qwertz/sg-latin1.kmap.gz

VI/VIM
This replaces the beginning of each line with "//":

This replaces the beginning of each selected line (use visual mode to select) with "//":



Split big files
If a file is to big to transfer or to big to save on a specific file system, we can split the file and later patch back to one peace: split -b 1024m bigfile.tar.gz bigfile.tar.gz.part- This will generate several 1GB files out of one. To put them together use: cat bigfile.tar.gz.part-* > bigfile.tar.gz Or under Windows: copy /b bigfile.tar.gz.part-* bigfile.tar.gz

Update problem
yum check-update yum upgrade --skip-broken yum check yum clean all yum distro-sync yum update
 * In case of unfixable multilib and other errrors:
 * If that does not work try to fix yum itself:
 * and finally the hardcore variant:

Optimize table
mysqlcheck -o --all-databases