Added some further tips
[grml-tips.git] / grml_tips
index 66f46a5..4fa5263 100644 (file)
--- a/grml_tips
+++ b/grml_tips
@@ -1311,6 +1311,10 @@ product ID when loading the usbserial module. Usage example:
 Bus 004 Device 008: ID 1199:6813 Sierra Wireless, Inc.
 
 # modprobe usbserial vendor=0x1199 product=0x6813
+
+To get a list of available providers execute:
+
+# gcom -s -d /dev/ttyUSB0 /usr/share/doc/gcom/examples/operator
 -- 
 hdparm - get/set hard disk parameters
 
@@ -3002,3 +3006,85 @@ Hints:
   - Do not use interface names without ending 0 (otherwise startup fails).
   - Only chooss unique names for interfaces.
 -- 
+Find dangling symlinks using zsh:
+
+% ls **/*(-@)
+-- 
+Use approx with runit supervision
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Install the packages:
+# apt-get install approx runit
+
+Add user approxlog for the logging daemon:
+# adduser --system --home /nonexistent --no-create-home approxlog
+
+Create config directory:
+# mkdir /etc/sv/approx
+
+Use /var/run/sv.approx as supervise directory:
+# ln -s /var/run/sv.approx /etc/sv/approx/supervise
+
+# cat > /etc/sv/approx/run << EOF
+#!/bin/sh
+echo 'approx starting'
+exec approx -f 2>&1
+EOF
+
+You normally do not need a logging service for approx because it logs
+to syslog too. So just for completion:
+# mkdir -p /etc/sv/approx/log
+# ln -s /var/run/sv.approx.log /etc/sv/approx/log/supervise
+# cat > /etc/sv/approx/log/run << EOF
+#!/bin/sh
+set -e
+LOG="/var/log/approx"
+test -d "$LOG" || mkdir -p -m2750 "$LOG" && chown approxlog:adm "$LOG"
+exec chpst -uapproxlog svlogd -tt -v "$LOG"
+EOF
+
+Now activate the new approx service (will be started within 5s):
+# ln -s /etc/sv/approx/ /var/service/
+
+Make approx managed via runit available via init-script interface:
+# dpkg-divert --local --rename /etc/init.d/approx
+# ln -s /usr/bin/sv /etc/init.d/approx
+-- 
+Remote-reboot a grml system using SysRQ via /proc (execute as root):
+
+eject &>/dev/null
+umount -l /cdrom
+eject /dev/cdrom
+echo b > /proc/sysrq-trigger
+-- 
+Show what happens on /dev/sda0:
+
+# mount the debugfs to relay kernel info to userspace
+mount -t debugfs none /sys/kernel/debug
+
+# is a convenient wrapper arround blktrace and blkparse
+btrace /dev/sda0
+-- 
+Convert Flash to Avi:
+
+% ffmpeg -i input.flv output.avi
+-- 
+Usage example for cryptsetup / -luks encrypted partition on LVM:
+
+volume group name:   x61
+logical volume name: home
+
+echo "grml-crypt_home /dev/mapper/x61-home none luks" >> /etc/crypttab
+Start cryptdisks
+mount /dev/mapper/grml-crypt_home /mnt/test
+-- 
+fdisk/parted/... complains with something like
+'unable to open /dev/sda - unrecognised disk label'?!
+
+See http://grml.org/faq/#fdisk =>
+
+* use /sbin/fdisk.distrib from util-linux
+* switch to sfdisk, cfdisk,...
+* use parted's mklabel command (but please read the
+  parted manual before executing this command)
+--