X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml_tips;h=52bb33d35cd81da4c889b81e95baac29505d6c85;hb=15dedda9f65597d7cdf338aff45889600bec2f81;hp=1fe0515c882110997d7d75aa84e8c5187b00b062;hpb=260058bf14a528851d5ef3b5fd731767d0f37adc;p=grml-tips.git diff --git a/grml_tips b/grml_tips index 1fe0515..52bb33d 100644 --- a/grml_tips +++ b/grml_tips @@ -43,12 +43,6 @@ Configure network: # grml-network -- -Boot grml via network: - -# grml-terminalserver - -See: man grml-terminalserver + http://grml.org/terminalserver/ --- Deactivate error correction of zsh: % NOCOR=1 zsh @@ -584,6 +578,10 @@ Save live audio stream to file: or % mencoder mms://file.wmv -o $FILE -ovc copy -oac copy + +or + +% mimms mms://file.wmv -- Merge video files: @@ -659,7 +657,9 @@ to get a list of all supported trees -- Transfer your SSH public key to another host: -% ssh-copy-id -i ~/.ssh/id_dsa.pub user@remote-system +% ssh-keygen # if you don't have a key yet +[...] +% ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-system or % cat $HOME/.ssh/id_rsa.pub | ssh user@remote-system 'cat >> .ssh/authorized_keys' -- @@ -1090,7 +1090,7 @@ Avoid all of the above steps - use grml-debootstrap(8) instead! -- Convert files from Unicode / UTF-8 to ISO: -% iconv -f utf8 -t iso-8859-15 < utffile > isofile +% iconv -c -f utf8 -t iso-8859-15 < utffile > isofile and vice versa: @@ -1274,8 +1274,7 @@ Write a Windows 2000/XP/2003 MBR to device: Use a Vodafone 3G Datacard (UMTS) with Linux: Plug in your vodafone card and check in syslog whether the appropriate -(probably /dev/ttyUSB0 or /dev/noz0 when using newer vodafone cards) has -been created. If so run: +(probably /dev/ttyUSB0 or /dev/noz0) has been created. If so run: # gcom -d $DEVICE # wvdial --config /etc/wvdial.conf.umts $PROFILE @@ -1290,8 +1289,28 @@ Usage examples: # gcom -d /dev/noz0 # wvdial --config /etc/wvdial.conf.umts dreiusb -Notice: newer vodafone cards require the nozomi driver. Run 'modprobe nozomi' on -your grml system. +If you receive invalid DNS nameservers when connecting, like: + +[...] +--> primary DNS address 10.11.12.13 +--> secondary DNS address 10.11.12.14 + +just provide a working nameserver to resolvconf via: + +# echo "nameserver 80.120.17.70" | resolvconf -a ppp0 + +Notice: some vodafone cards require the nozomi driver (run 'modprobe nozomi' on +your grml system), some other ones require the sierra driver (run +'modprobe sierra'). + +If your device isn't supported by usbserial yet, manually provide vendor and +product ID when loading the usbserial module. Usage example: + +% lsusb +[...] +Bus 004 Device 008: ID 1199:6813 Sierra Wireless, Inc. + +# modprobe usbserial vendor=0x1199 product=0x6813 -- hdparm - get/set hard disk parameters @@ -1715,7 +1734,7 @@ GET http://www.google.com HTTP/1.0 [press enter twice] Adjust system for use of qemu with kqemu: Make sure you have all you need: -# apt-get update ; apt-get install qemu grml-kerneladdons-$KERNELVERSION +# aptitude update ; aptitude install qemu kqemu-modules-$(uname -r) Then set up kqemu: @@ -2627,6 +2646,8 @@ and where grml is running: Then booting your client(s) via PXE should work without any further work. + +See: man grml-terminalserver + http://grml.org/terminalserver/ -- Debugging SSL communications: @@ -2653,6 +2674,7 @@ Rewrite lilo to MBR: # lilo -r /mnt/hda1 -- Create screenshot of plain/real console - tty1: + # fbgrab -c 1 screeni.png -- Create screenshot when running X: @@ -2672,4 +2694,176 @@ iptables -A FORWARD -i eth0 -o eth0 -d hostB -p tcp --dport portB -j ACCEPT iptables -A FORWARD -i eth0 -o eth0 -s hostB -p tcp --sport portB -j ACCEPT iptables -t nat -A POSTROUTING -p tcp -d hostB --dport portB -j SNAT --to-source hostA -- +Flash BIOS without DOS/Windows: + +Dump flash info and set the flash chip to writable: +# flashrom + +Backup the original BIOS: +# flashrom -r backup.bin + +Notice: the following step will overwrite your current BIOS! +So make sure you really know what you are doing. + +Flash the BIOS image: +# flashrom -wv newbios.bin + +Also check out LinuxBIOS: http://linuxbios.org/ +-- +Enable shadow passwords: + +# shadowconfig on +-- +Set up an IPv6 tunneln on grml: + +# ipv6-tunnel start +-- +Set up console newsreader slrn for use with Usenet: + +% grml-slrn +-- +Calculate with IPv6 addresses: + +% ipv6calc + +For usage examples refer to manpage ipv6calc(8). +-- +Common network debugging tools for use with IPv6: + +% ping6 +% tracepath6 +% traceroute6 +% tracert6 +% nc6 +% tcpspray6 +-- +Set up NFS (Network File System): + +Server-side +~~~~~~~~~~~ +Make sure the relevant services are running on the server side: + +# /etc/init.d/portmap start +# /etc/init.d/nfs-common start +# /etc/init.d/nfs-kernel-server start + +Export shares via /etc/exports: + +/backups 192.168.1.100/24(rw,wdelay,no_root_squash,async,subtree_check) + +... or manually export a directory running: + +# exportfs -o rw,wdelay,no_root_squash,async,subtree_check 192.168.1.100:/backups + +and unexport a share running: + +# exportfs -u 192.168.1.100:/backups + +and every time when you modify /etc/exports file run + +# exportfs -ra + +Display what NFS components are running: + +# rpcinfo -p + +Display list of exported shares: + +# exportfs -v +or +# showmount -e + +Client-side +~~~~~~~~~~~ +Make sure the relevant services are running on the client side: + +# /etc/init.d/portmap start +# /etc/init.d/nfs-common start + +Verify that the server allows you to access its RPC/NFS services: + +# rpcinfo -p server_name + +Check what directories the server exports: + +# showmount -e server_name + +On the client side you can use something like the following in /etc/fstab: + +192.168.1.101:/backups /mnt/nfs nfs defaults,users,wsize=8192,rsize=8192 0 0 +-- +Mount a cloop file: + +# aptitude install cloop-src +# m-a a-i cloop-src + +# modprobe cloop file=/path/to/cloop/file +# mount -r -t iso9660 /dev/cloop /mnt/test +-- +Create a PS/PDF of a plaintext file: + +% a2ps --medium A4dj -E -o output.ps input_file +% ps2pdf output.ps +-- +Print two pages on one in a PDF file: + +% pdfnup --nup 2x1 input.pdf + +Concatenate, extract pages/parts, encrypt/decrypt, +compress PDFs using 'pdftk'. +-- +Read a PS/PDF file on console: + +% pstotext file.pdf + +or on plain framebuffer console in graphical mode: + +% pdf2ps file.pdf ; ps2png file.ps file.png ; fbi file.png + +or + +% fbgs file.pdf +-- +Bypass the password of a PDF file: + +% gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf -c quit +-- +Record sound: + +% rec test.aiff + +This will record a AIFF audio file. +-- +Change passphrase / password of an existing SSH key: + +% ssh-keygen -p +-- +Enable syntax highlighting in nano: + +Just uncomment the include directives for your respective +language at the bottom of the file /etc/nanorc +-- +Create netboot package for grml-terminalserver: + +# sh /usr/share/doc/grml-terminalserver/examples/create-netboot +-- +Rotate pictures: + +Using the 'Orientation' tag of the Exif header, rotate +the image so that it is upright: +% jhead -autorot *.jpg + +Manually rotate a picture: +% convert -rotate 270 input.jpg output.jpg +-- +Rename files based on the information inside their exif header: + +% jhead -n%Y-%m-%d_%Hh%M_%f *.jpg +This will rename a file named img_2071.jpg to something like: + +2007-08-17_10h38_img_2071.jpg + +if it was shot at 10:38 o'clock on 2007-08-17 (according to +the information inside the exif header). +--