Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

June 29 2015

Capturing Radiotap


iw dev # identify correct phy
iw phy phy1 interface add mon0 type monitor
ip link set mon0 up
iw dev mon0 set freq 2437
iw dev wlan1 del
tcpdump -i mon0 -n -U
# 14:54:34.103612 12.0 Mb/s 2437 MHz 11g -73dB signal antenna 1 Beacon (mesh.ffmuc) [1.0* 2.0 5.5 11.0 6.0 9.0 12.0 18.0 Mbit] IBSS CH: 6
Tags: linux

June 06 2015

Postgresql Upgrade on Gentoo/Linux

Short walkthru Migrating_PostgreSQL
old=9.3
new=9.4

/etc/init.d/postgresql-$old stop
rc-update del postgresql-$old
eselect postgresql set $new
su - postgres
ln -s /etc/postgresql-$old/*.conf /var/lib/postgresql/$old/data
ln -s /etc/postgresql-$new/*.conf /var/lib/postgresql/$new/data
initdb  /var/lib/postgresql/9.4/data \
  -E utf8 --locale=en_US.UTF-8  --lc-collate=C
pg_upgrade94 \
  -b /usr/lib64/postgresql-$old/bin \
  -B /usr/lib64/postgresql-$new/bin \
  -d /var/lib/postgresql/$old/data \
  -D /var/lib/postgresql/$new/data
exit
mv /var/lib/postgresql/$new/data/*.conf /etc/postgresql-$new
/etc/init.d/postgresql-$new start
rc-update add postgresql-$newdefault
Tags: linux own

April 30 2015

Howto build IrssiConnectbot w/ mosh for Android 5

Since http://dan.drown.org/android/ is no longer maintained, and newer Androids report a missing -fPIE in the native compiled part of the APK, as it wasn't activated prior to API 16, I had to compile it myself, I chose API level 22, but any above or including 16 should work

# error: only position independent executables (PIE) are supported

#Install the native compiler suite
emerge -av dev-util/android-ndk

# Install GUI to download SDKs etc.
emerge -av dev-util/android-sdk-update-manager

# Download API 22 -> SDK Platform
/opt/android-sdk-update-manager/tools/android

#Create a keystore and signing key
keytool -genkey -v -keystore ~/xmw.de.keystore -alias xmw.de -keyalg RSA -keysize 4096 -validity 10000

# Checkout dan drowns fork of ConnectBot
git clone https://github.com/ddrown/irssiconnectbot.git
cd irssiconnectbot

#Configure your local situation in local.properties
sdk.dir=/opt/android-sdk-update-manager
ndk.dir=/opt/android-ndk
target=android-22
key.store=${user.home}/xmw.de.keystore
key.alias=xmw.de

#Build and sign
ant clean
ant release

# If you switch the apk signature, make sure uninstall the app w/o -k
adb uninstall org.woltage.irssiconnectbot
# If you keep the data, you must install an apk with the same signature!!!
# Subsequent updates can be applied using
adb shell pm uninstall -k org.woltage.irssiconnectbot
adb install bin/irssiconnectbot-debug.apk
Tags: linux own

November 10 2014

September 04 2014

3553 706c
A minimalistic online clipboard with edit, links, qr and binary support.
Tags: own linux

July 18 2014

Iodine IPv4 over DNS

Route your traffic thru an tunnel based on DNS query and response UDP packets [1] to bypass stupid application level gateways, accountings, etc.
Supported by most *nix (just updated Gentoo/Linux ebuild), Windows and (!) Android [2].
[1] http://code.kryo.se/iodine/
[2] http://blog.bokhorst.biz/5123/computers-and-internet/iodine-dns-tunnel-for-android/
Tags: linux own

July 13 2014

March 26 2014

How to revoke a GnuPG/PGP signature on a key

Alternative interactive instructions to revoke own signatures on foreign keys
Tags: linux

revoking (obsolete) gpg keys

# since uploading the standalone cert leads to failure
# here is my approach
gpg --list-secret-keys webermi@cip...
keyid=DAxxxxxx #the part after 1024D/
tempfile=$(mktemp)
gpg --output $tempfile --gen-revoke $keyid
gpg --import $tempfile
gpg --send-key $keyid #use --keyserver <> if not defined at .gnupg/gpg.conf
rm $tempfile
unset tempfile keyid

#wait for your buddies to retrieve the updated key
Tags: own linux

August 22 2013

Unblank linux console and manipulating console DPMS


~ # echo -ne "\033[13]" >/dev/console

Linux Console Private CSI Sequences
	The following sequences are neither ECMA-48 nor native VT102.  They are
	native to the Linux console driver.  Colors are in SGR parameters: 0  =
	black,  1 = red, 2 = green, 3 = brown, 4 = blue, 5 = magenta, 6 = cyan,
	7 = white.

	ESC [ 1 ; n ]       Set color n as the underline color
	ESC [ 2 ; n ]       Set color n as the dim color
	ESC [ 8 ]           Make the current color pair the default attributes.
	ESC [ 9 ; n ]       Set screen blank timeout to n minutes.
	ESC [ 10 ; n ]      Set bell frequency in Hz.
	ESC [ 11 ; n ]      Set bell duration in msec.
	ESC [ 12 ; n ]      Bring specified console to the front.
	ESC [ 13 ]          Unblank the screen.
	ESC [ 14 ; n ]      Set the VESA powerdown interval in minutes.
-- man 4 console_codes
Tags: linux

August 07 2013

update SSH_AUTH_SOCK in screen after ssh-reconnect.

usas () {
    export SSH_AUTH_SOCK=$(ls -t $(find /tmp/ssh-*/agent.* -user $USER) | head -n 1)
}

[1] https://xmw.de/dotfiles/.zshrc

Tags: own linux

August 06 2013

Free __ALL__ memory

sync; for i in $(seq 3) ; do echo $i > /proc/sys/vm/drop_caches ; done

[1] http://linux-mm.org/Drop_Caches
Tags: linux
Reposted byjv6 jv6

check SOA records with zsh and dig +short

 x ~ % which soacheck
soacheck () {
        which dig > /dev/null || {
                echo "install dig"
                return 1
        }
        [ "$#" -eq 1 ] || {
                echo "Usage: $0 <dns-zone>"
                return 1
        }
        for i in $(dig $1 NS +short)
        do
                echo -ne "$i\n\t"
                dig $1 SOA @$i +short
        done
}

x ~ % soacheck xmw.de
vuxu.org.
lore.xmw.de. root.xmw.de. 2013080105 86400 10800 604800 3600
spot.xmw.de.
lore.xmw.de. root.xmw.de. 2013080105 86400 10800 604800 3600
lore.xmw.de.
lore.xmw.de. root.xmw.de. 2013080105 86400 10800 604800 3600

x ~ % soacheck spf.fs.lmu.de
huygens.fs.lmu.de.
pauli.fs.lmu.de. root.fs.lmu.de. 2013080631 86400 10800 604800 3600
spot.xmw.de.
pauli.fs.lmu.de. root.fs.lmu.de. 2013080630 86400 10800 604800 3600
lee.fs.lmu.de.
pauli.fs.lmu.de. root.fs.lmu.de. 2013080631 86400 10800 604800 3600
lore.xmw.de.
pauli.fs.lmu.de. root.fs.lmu.de. 2013080630 86400 10800 604800 3600

[1] https://xmw.de/dotfiles/.zshrc
Tags: linux own
Reposted bygaf gaf

change to ebuild dirs easily

x ~ # which cde
cde () {
        [ $# -ne 1 ] && {
                echo "Usage: cde <package atom>"
                return 1
        }
        local cand
        local sel
        cand=($(for tree in $(portageq portdir) $(portageq portdir_overlay) ; do
                        find $tree -mindepth 2 -maxdepth 2 -type d | grep "${1}" | sort
                done))
        case $#cand in
                (0) echo "no match found"
                        return 1 ;;
                (1) sel=$cand[1]  ;;
                (*) until [ -n "$sel" ]
                        do
                                sel=$(zselect2 $cand)
                        done ;;
        esac
        [ -n "$sel" ] && {
                zexecverbose cd $sel
                return $?
        }
}

x squashfs-tools # cde binutils
1) /usr/portage/dev-embedded/msp430-binutils                                  
2) /usr/portage/sys-devel/binutils                                            
3) /usr/portage/sys-devel/binutils-apple                                      
4) /usr/portage/sys-devel/binutils-config                                     
5) /usr/portage/sys-devel/binutils-hppa64                                     
>2
cd /usr/portage/sys-devel/binutils
x binutils #

x binutils # cde trivdm 
cd /var/lib/xmw-overlay/x11-misc/trivdm
x trivdm #

[1] https://xmw.de/dotfiles/.zshrc
Tags: own linux

July 30 2013

Screen start two programs and display on tty2

io ~ # cat /etc/local.d/radio.start
#!/bin/bash
/bin/chgrp radio /dev/tty2
/bin/chmod g+r /dev/tty2
su -c '
screen -dmS "radio"
screen -S radio -p 0 -X stuff "sleep 5 ; ~/tag.py$(printf \\r)"
screen -S radio -X screen
screen -S radio -p 1 -X stuff "dump1090 --interactive --interactive-rows 62 --interactive-ttl 300 --net$(printf \\r)"
' radio
io ~ # cat /etc/local.d/radio.stop
#!/bin/bash
su -c "screen -S radio -X quit" radio
io ~ # grep ^c2 /etc/inittab
c2:2345:respawn:/bin/su -c "screen -r radio ; sleep 10" radio > /dev/tty2 < /dev/tty2
Tags: own linux
Reposted byjv6 jv6

July 25 2013

0986 5bb5 500
xmw.de
Thinkpad R61 with 2x3TB drives with ultrabay sata adapter and external psu.
Tags: own linux
Reposted byEvilDeath EvilDeath

July 09 2013

5700 925d 500
xmw.de
Spending my evening with pizza, soda, pistacchios and a RPi -- thanks Tres.
Tags: own linux

December 31 2012

secure grub2 with password

As preparation for new years party, i wanted to secure my desktop against init=/bin/bash attacs. Grub2 added usernames to the privilege concept, enabling fine grained access to certain boot entry to different subsets of users.
I just want everybody to be able to boot the default entry and restrict all tweaking (edit mode, command line) and alternatives (old kernels, memtest) to password authentication.
Adding an superuser called root (easy to remember) and setting an password locks all entries.
For increased security, use a hashed password (run `grub2-mkpasswd-pbkdf2`) and revoke read right from the file.
N.B. grub2-mkconfig sources all files in grub.d and run it tru shell to generate the /boot/grub2/grub.cfg. The file has to be executable.

--- /dev/null
+++ /etc/grub.d/01_password
@@ -0,0 +1,6 @@
+cat << EOF
+
+set superusers="root"
+password_pbkdf2 root grub.pbkdf2.sha512.......
+
+EOF

Run `chmod go=,u+x /etc/grub.d/01_password`
Now identify the part of 10_linux that generates the first/default menu entry.
It's the else block of "if [ x$type != xsimple ]" inside linux_entry().

--- /etc/grub.d/10_linux
+++ /etc/grub.d/10_linux
@@ -98,7 +98,7 @@
       fi
       echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} $menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   else
-      echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} $menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+      echo "menuentry --unrestricted '$(echo "$os" | grub_quote)' ${CLASS} $menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   fi     
   if [ x$type != xrecovery ] ; then
       save_default_entry | sed -e "s/^/ /"

Now, re-create the grub2 running `grub2-mkconfig -o /boot/grub2/grub.cfg` and you're all set.

Prosit 2013!
Tags: linux own

August 01 2012

fix app-shells/zsh on Gentoo

# https://bugs.gentoo.org/19924
mkdir -p /etc/portage/env/app-shells
echo "pkg_preinst() {
        mv -v "${D}"/etc/zsh/{zprofile,zshenv} || die
}" >/etc/portage/env/app-shells/zsh
Tags: own linux

June 05 2012

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl