Linux general

Change keyboard layout

loadkeys hu

Use screen command

screen

Run command: CTRL+A +
  • C: new
  • X: close
  • N: next
  • P: Previous
  • ": select from list
  • A: previous window viewed
  • S: split horizontal
  • |: split vertical 

Disable autostart

update-rc.d -f apache2 remove

Or Enable autostart

update-rc.d apache2 defaults

Sample init script (/etc/init/blah).

#! /bin/sh
# /etc/init.d/blah
#
 
# Some things that run always
touch /var/lock/blah
 
# Carry out specific functions when asked to by the system
case "$1" in
  start)
    echo "Starting script blah "
    echo "Could do more here"
    ;;
  stop)
    echo "Stopping script blah"
    echo "Could do more here"
    ;;
  *)
    echo "Usage: /etc/init.d/blah {start|stop}"
    exit 1
    ;;
esac
 
exit 0

Source: http://www.pixelbeat.org/lkdb/screen.html

Source: http://www.debian-administration.org/articles/28


Display file times

stat <file>

List disks by uuid

ls -al /dev/disk/by-uuid/*

Or for just one uuid
readlink /dev/disk/by-uuid/f16453f1-990e-4f51-923c-73e8df60fc9c

Display soundcard chipset

cat /proc/asound/card0/codec#* | grep Codec

 

Print STDOUT and STDERR to screen and file

./run.sh 2>&1 | tee out.txt

 

Disable IPv6 in Debian Lenny
Create the file /etc/modprobe.d/00local and insert the two lines like below, than restart networking.

echo "alias net-pf-10 off" >> /etc/modprobe.d/00local
echo "alias ipv6 off" >> /etc/modprobe.d/00local