X-Git-Url: https://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=grml_tips;h=f8db64cc0953ca47a1f0539af354a46c79208634;hb=b218520358b095185ad55d20bf2aa451cc67efa6;hp=225862ee5cfc97e5bc1335d5779d6dbbda76d51b;hpb=cb64196a333a23534591904a2be96469acd6dd2e;p=grml-tips.git diff --git a/grml_tips b/grml_tips index 225862e..f8db64c 100644 --- 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 @@ -2651,7 +2655,8 @@ See: man grml-terminalserver + http://grml.org/terminalserver/ -- Debugging SSL communications: -% openssl s_client -connect server.adress:993 +% openssl s_client -connect server.adress:993 > output_file +% openssl x509 -noout -text -in output_file or @@ -2930,3 +2935,113 @@ Memtest / memcheck: Just boot your grml Live-CD with "memtest" to execute a memcheck/memtest with Memtest86+. -- +Tunnel TCP-Traffic through DNS using dns2tcp: + +Server-side: +~~~~~~~~~~~~ +1. Create necessary DNS-Records: +dnstun.example.com. 3600 IN NS host.example.com. +dnstun.example.com. 3600 IN A 192.168.1.1 +host.example.com. 3600 IN A 192.168.1.1 + +2. Configure dns2tcpd on host.example.com.: +# cat /etc/dns2tcpd.conf +listen = 192.168.1.1 #the ip dns2tcpd should listen on +port = 53 #" port " " " " +user = nobody +chroot = /tmp +domain = dnstun.example.com. # the zone as specified inside dns +ressources = ssh:127.0.0.1:22 # available resources + +3. Start the daemon: +# cat > /etc/default/dns2tcp << EOF +# Set ENABLED to 1 if you want the init script to start dns2tcpd. +ENABLED=1 +USER=nobody +EOF +# /etc/init.d/dns2tcp start + +Client-side: +~~~~~~~~~~~~ +You have two possibilities: +- Use the DNS inside your network (DNS must allow resolving for external domains) +# grep nameserver /etc/resolv.conf +nameserver 172.16.42.1 +# dns2tcpc -z dnstun.example.com 172.16.42.1 +Available connection(s) : + ssh +# dns2tcpc -r ssh -l 2222 -z dnstun.example.com 172.16.42.1 & +Listening on port : 2222 +# ssh localhost -p 2222 +user@host.example.com:~# + +- Directly contact the endpoint (port 53 UDP must be allowed outgoing) +# dns2tcpc -z dnstun.example.com dnstun.example.com +Available connection(s) : + ssh +# dns2tcpc -r ssh -l 2222 -z dnstun.example.com dnstun.example.com & +Listenning on port : 2222 +# ssh localhost -p 2222 +user@host.example.com:~# + +Notice: using 'ssh -D 8080 ..' you will get a socks5-proxy listening on +localhost:8080 which you can use to tunnel everything through your "dns-uplink". +-- +Configure a MadWifi device for adhoc mode: + +Disable the autocreation of athX devices: +# echo "options ath_pci autocreate=none" > /etc/modprobe.d/madwifi + +Remove the autocreated device for now: +# wlanconfig ath0 destroy + +Configuration in /etc/network/interfaces: + +iface ath0 inet static + madwifi-base wifi0 + madwifi-mode adhoc + ... + +Hints: + - Do not use interface names without ending 0 (otherwise startup fails). + - Only chooss unique names for interfaces. +-- +Find dangling symlinks using zsh: + +% ls **/*(-@) +-- +approx with runit supervision + +# 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 directories +# ln -s /var/run/sv.approx /etc/sv/approx/supervise + +# cat /etc/sv/approx/run +# #!/bin/sh +echo 'approx starting' +exec approx -f 2>&1 + +You normally do not need a logging service for approx, because it loggs +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 +#!/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" + +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. +# dpkg-divert --local --rename /etc/init.d/approx +# ln -s /usr/bin/sv /etc/init.d/approx