X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml_tips;h=95f20b01c6061878919e2e73c60082d0beac80d1;hb=10659870862d3ef77c79cb33e9f7ecc1b8601433;hp=f8db64cc0953ca47a1f0539af354a46c79208634;hpb=b218520358b095185ad55d20bf2aa451cc67efa6;p=grml-tips.git diff --git a/grml_tips b/grml_tips index f8db64c..95f20b0 100644 --- a/grml_tips +++ b/grml_tips @@ -573,11 +573,15 @@ echo -e "s/\r//g" > dos2unix.sed; sed -f dos2unix.sed < dosfile > unixfile -- Save live audio stream to file: -% mplayer -ao pcm:file=$FILE +% mplayer -ao pcm:file=$FILE $URL +-- +Save live stream to file: + +% mplayer -dumpfile $FILE -dumpstream $STREAM or -% mencoder mms://file.wmv -o $FILE -ovc copy -oac copy +% mencoder mms://$URL -o $FILE -ovc copy -oac copy or @@ -704,9 +708,9 @@ Write back the guessed table: Develop, test and use exploit code with the Metasploit Framework: cd /tmp -wget http://framework-mirrors.metasploit.com/msf/downloader/framework-3.0.tar.gz -unp framework-3.0.tar.gz -cd framework-3.0 +wget http://spool.metasploit.com/releases/framework-3.2.tar.gz +unp framework-3.2.tar.gz +cd framework-3.2 ./msfcli -- Useful documentation: @@ -1267,9 +1271,17 @@ via using grml nodma at the bootprompt. -- Write a Microsoft compatible boot record (MBR) using ms-sys -Write a Windows 2000/XP/2003 MBR to device: +Write a Windows 2000/XP/2003 MBR to a device: # ms-sys -m /dev/ice + +Notice: grab ms-sys from http://ms-sys.sourceforge.net/ - demo: + + wget http://surfnet.dl.sourceforge.net/sourceforge/ms-sys/ms-sys-2.1.3.tgz + unp ms-sys-2.1.3.tgz + cd ms-sys-2.1.3 + make + ./bin/ms-sys ... -- Use a Vodafone 3G Datacard (UMTS) with Linux: @@ -2316,8 +2328,6 @@ host2% hg merge # merge changes into your working directory Set up a CGI server on your webserver: % cp hgwebdir.cgi ~/public_html/hg/index.cgi % $EDITOR ~/public_html/hg/index.cgi # adjust the defaults - -Mercurial repositories of grml can be found at http://hg.grml.org/ -- Download binary codecs for mplayer: @@ -2719,7 +2729,7 @@ Enable shadow passwords: # shadowconfig on -- -Set up an IPv6 tunneln on grml: +Set up an IPv6 tunnel on grml: # ipv6-tunnel start -- @@ -3010,38 +3020,125 @@ Find dangling symlinks using zsh: % ls **/*(-@) -- -approx with runit supervision +Use approx with runit supervision +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Install the packages: # apt-get install approx runit -Add user approxlog for the logging daemon +Add user approxlog for the logging daemon: # adduser --system --home /nonexistent --no-create-home approxlog -Create config directory +Create config directory: # mkdir /etc/sv/approx -Use /var/run/sv.approx as supervise directories +Use /var/run/sv.approx as supervise directory: # ln -s /var/run/sv.approx /etc/sv/approx/supervise -# cat /etc/sv/approx/run -# #!/bin/sh +# 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 loggs -to syslog too. So just for completion. +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 +# 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) +Now activate the new approx service (will be started within 5s): # ln -s /etc/sv/approx/ /var/service/ -Make the runit managed approx available with init-script interface. +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) +-- +dmraid - support for SW-RAID / FakeRAID controllers +like Highpoint HPT and Promise FastTrack + +Activate all software RAID sets discovered: +# dmraid -ay + +Deactivates all active software RAID sets: +# dmraid -an + +Discover all software RAID devices supported on the system: +# dmraid -r +-- +Extract winmail.dat: + +List content: +% ytnef winmail.dat + +Extract files to current directory: +% ytnef -f . winmail.dat +-- +Approx - Debian package proxy/cacher howto + +% apt-get install approx +% echo 'debian http://ftp.de.debian.org/debian' >>/etc/approx/approx.conf +% Restart approx + +Add your new approx to sources.list + +eg. +deb http://localhost:9999/debian unstable main contrib non-free + +use approx in grml-debootstrap like: +% grml-debootstrap -r lenny -t /dev/sda1 -m http://127.0.0.1:9999/debian +-- +Simple webserver with python: + +% python -m SimpleHTTPServer +-- +Upgrade only packages from the grml-stable Debian repository: + +echo 'deb http://deb.grml.org/ grml-stable main' > /etc/apt/grml-stable.list +apt-get -o Dir::Etc::sourcelist=/etc/apt/grml-stable.list -o Dir::Etc::sourceparts=/doesnotexist update +apt-get upgrade +--