Internet is serious business!

Sanajahti on rikkinäinen peli

Sanajahti on hieman rikkinäinen peli. Netissä on paljon mainintaa “huijareista” joka ei välttämättä ole kovin kaukana todellisuudesta.

Remote X session

So yeah, there are times when you just need/want a complete X session remotely for some reason.. For example, in my case i have no room to set up a work station at home for my work lappy, so i’d rather use my home PC for the work stuff, however i do not want any work data transfered to my PC.

So, i came to the conclusion that remote controlling the work lappy was a good choice, however i still needed to figure out what to use for that, first option was obviously VNC but thats something i try to stay away from.. So i came to the conclusion that complete X session over SSH was a quite valid idea.. And the tinkering begins!

First of all, we need new local display for the new session.. I figured out that theres 2 good choices here.

#1 Xephyr.

Xephyr :2 -screen 1024x768x32 >/dev/null

#2 new X session in new TTY

sudo X -quiet -nolisten tcp -noreset +xinerama :4 vt1

After figuring out that i want it in new TTY, it was just matter of redirecting the window manager session to the display (:4 in this case)

DISPLAY=:4 ssh -Y -C -c arcfour128 zutto@ dwm

And were done! we have new DWM session in TTY1 for the fun tiems!
Also, you might question why -c arcfour128, and the reason for that is cause its the fastest cipher ssh protocol 2 supports. Not secure, but were in local network so were probably good to go w/o worrying.

Streaming webcam from your phone

So.. i was bored, and boredom leads to expirimenting with random things.. So i decided to start expirimenting with using my phone as webcam.. After while of googling i ended up using IP webcam.

First we need loopback device for the camera, i found out that v4l2loopback is the loopback device i decided to go with

$ modprobe v4l2loopback # init the v4l2 device

After that is done, gstreamer is the way to go to redirect the stream to your loopback device.. What i found is that the following is very functional way to do it..

gst-launch -vet souphttpsrc location="" timeout=5 ! jpegdec ! ffmpegcolorspace ! "video/x-raw-yuv, format=(fourcc)YV12" ! v4l2sink device="/dev/video0"

And there we have our webcam!


Yeah, i might as well rename the blog “internet is bash business”
locates files containing name “ineko” (as in Umineko), and only outputs the filenames.. to clipboard!

awk -F / '{print $NF;}' <(locate ineko) |grep -E "(.zip|.ogg|.mp3)" >> - | xclip -

awk is fun tiems

bash bash bash bash

yeah.. bash, fun tiems..

I had a site that i knew had hidden folder that had indexing disabled (i knew the file i needed from there..), so whats the fastest way to figure out the name of that folder?
My solution was a wordlist containing ~6k words, and curl!
If you try to access folder that has indexing disabled, you get 403 error (no permissions), if the folder doesnt exist, you simply get 404.. and if the server automaticly redirects http://url/dir/attempted to http://url/dir/attempted/ you’ll get 301 and thats also means the directory exists..

You could call this a security threat, but who leaves directories they dont want people to access to their web servers anyway?

cat wlist | while read LL; do
        if curl -s http://URL/DIR/$LL |grep -E "(301|403)"; then  # <-- you might want to take the 301 out, depending on the target server..
              echo "hidden folder found!:  $LL";

More bash awesomeness..

List all videos to list

awk '/.avi|.mkv|.ogm|.wmv|.mp4/ {for(i=1;i<9;i++){ $i="";} print $0}' <(ls -lhR) >> lista

Record desktop audio… Without recording silence..

So basicly what this tiny script does is record 30 minute clips of audio from your desktop (without recording silence), and converts them to mp3 to save space
Why? We needed a bot to record our ts3 conversations and this was quite handy way to do it

while true; do
aika="/tmp/mount/nauha/$(date +%d.%m.%Y-%H:%M:%S) - nauhotus"
echo "$aika"
pacat --record -d 0 | sox -t raw -r 44100 -s -L -b 16 -c 2 - "$aika.wav" silence 1 0.1 0.01% -1 5 0.1% &
sleep 1800
killall -9 pacat
lame "$aika.wav" "$aika.mp3"; rm -rf "$aika.wav" &
sleep 10
echo "scripta restartattu $(date +%d.%m.%Y-%H:%M:%S)"

And below you can find why we did it.. If you understand finnish ;p

bash.. Y U SO USFUL

The 2 bash scripts shall speak for themselves.. They are quite handy from time to time..

du -hc |sort -n|grep -E "([0-9.]{2,5}(M|G))([[:space:]]{0,8})(\./[a-zA-Z0-9\. _-]{0,100}$)"

du -hc |sort -n|grep -E "([0-9.]{2,5}G)([[:space:]]{0,8})(\./[a-zA-Z0-9\. _-]{0,100}$)"

Zwat (name to be changed..) – Zutto’s web application testing framework

Yeah so, no one probably remembers the old blog..

i had posted a project there (note the picture) called Z-fw (zutto’s framework.. names, not my speciality).


So yeah, obviously.. no more winblobs, so i had to re-code the whole thing in C#/mono, and now its called zwat..

I have no idea why i am posting this, but does it matter? its my blog! but heres a teaser video of one test plugin

The end, and the beginning!

Yeah so, i was running blog on for a year.. and then i let the domain die..

So i decided to start the blog over in here, under the domain.

This blog wont have anything fancy, just something for me to look back at.


For starters, i’ll be posting shitloads of old stuff.