Skip to content

Recent Articles

26
Feb

Betabeers zaragoza

Estoy organizando el primer evento betabeers en zaragoza, podeis apuntaros aquí

Ven a compartir tus conocimientos y experiencias con nosotros, terminaremos el evento, como siempre, entre cervezas.
Contamos entre nosotros con el taller de Iván Loire sobre Node.js Express.js y Knokout.js!

Programa:

  • - Taller de Node.js Express.js y Knockout.js por Ivan loire
  •  Presentacion de los siguientes proyectos:
  • NumBalls – Informacion social sobre deportistas de elite (Marc de Palol)
  • Focused.es – Focus your tweets (Santiago Montiú)
  • Bilorium – El juego que cambiara el mundo (Diego Marquina)
  • GrassCMS – El CMS que podría utilizar tu madre (Francisco Sanz)

Con la colaboración de:

10
Feb

Aircrack-ng unoficial debian package

I’ve been working lately on an unoficial aircrack-ng package containing all the cool stuff, including airoscript. I talked with Thomas D’Otreppe and he told me I could use some space on aircrack-ng’s servers, but I haven’t had it yet, so I put the repository under degeneratedlabs. If the repo is down try again in a few hours.

You can install lastest (weekly built) aircrack-ng by adding this repo to your /etc/apt/sources.list

deb http://repo.degeneratedlabs.net/debian/ aircrackng-unstable/

And executing

apt-get update && apt-get install aircrack-ng

Also, you can find the sources I use to generate the package at my github. And the script I made to ease the build here:

1 2 3 4 5 6 7 8 9 10 11 12 13 14
# First, we download lastest trunk and create an orig tar.gz package
svn co http://trac.aircrack-ng.org/svn/trunk aircrack-ng-1.1
cd aircrack-ng-1.1
rm -rf `find . -name .svn` && tar czvf ../aircrack-ng_1.1.orig.tar.gz *; &>/dev/null
 
# Clone the debian/ dir
git clone http://github.com/XayOn/Aircrack-ngDebian debian &>/dev/null
# vim debian/changelog # Do it before, trought git interface!! =)
 
# Build and upload
debuild $@ && { cd .. ; dput repo.degeneratedlabs.net *changes; }
 
#Oneliner:
# svn co http://trac.aircrack-ng.org/svn/trunk aircrack-ng-1.1; cd aircrack-ng-1.1; rm -rf `find . -name .svn` && tar czvf ../aircrack-ng_1.1.orig.tar.gz *; &>/dev/null ; git clone http://github.com/XayOn/Aircrack-ngDebian debian &>/dev/null; debuild $@ && { cd .. ; dput repo.degeneratedlabs.net *changes; }
view raw gistfile1.sh This Gist brought to you by GitHub.
2
Feb

Installing aircrack-ng from subversion

I recently made a commit into aircrack-ng subversion repository adding an environment variable ready to build “external” scripts like airoscript-ng, airgraph-ng, versuck-ng and airdrop-ng, as well as any other directory inside scripts/ dir wich contains a Makefile.

This has two implications:

  • It’s quite easy to do a package from that (I’m working on an unofficial weekly subversion package)
  • It’s quite easy to install aircrack-ng with sqlite support, all the unstable stuff and the plugins

I’ll explain how to do the last one, in a few single script:

1 2 3 4
apt-get install subversion build-essential libpcap0.8 libssl1.0.0 zlib1g wireless-tools xterm python graphviz macchanger dsniff hydra zenity pyrit sslstrip wkhtmltopdf john libpcap0.8-dev libssl-dev libsqlite3-dev libnl-dev
svn co http://trac.aircrack-ng.org/trunk/
make -C trunk unstable=true ext_scripts=true sqlite=true
make -C trunk install unstable=true ext_scripts=true sqlite=true

Et voilá, you execute that as root, it will get lastest aircrack-ng revision and dependences (and most of airoscript-ng ones, all the necesary and packaged).

30
Jan

Automagically organising your bittorrent downloads with deluge

I, as most people, like to have my video files ordered. After I’ve finished downloading a torrent I manually move it to my media dir, under a directory for the series it belongs to, or no directory at all, but it’s a hard and unnecesary process.

I’ll explain here (and provide an script for it) how to make deluge automagically handle our files.

I’ve chosen deluge bittorrent client for this guide (blame it on enver555), but you should be able to use my script (with maybe, a few modifications about the argument handling) anywhere.

Getting the script

First, you will need to download the shorting script, it’s a single 5-liner bash script, with lots of magic and power, for that reason, I’ve called it the torrent shorting hat.

1 2 3 4 5
#!/bin/bash
id=$1; name=$2; path=$3; source ~/.torrent-aliases
type=$(file -b --mime-type $path |cut -d/ -f1)
for dest_dir in ${!regexes[@]}; do mkdir -p ~/Media/$type/$dest_dir; [[ $path =~ ${regexes[$dest_dir]} ]] && { mv $path ~/Media/$type/$dest_dir/; exit; }; done
mv $path ~/Media/$type/$dest_dir # Fallback
view raw gistfile1.sh This Gist brought to you by GitHub.

Installing it system-wide or locally

You might want all your users to have access to this script, for that, as with any other linux program, you should copy it to path and give it executable permissions, that’s, as root:

wget https://raw.github.com/gist/1705151/540fd4445ca4e0f540ddf82decba3ffc421c46ab/gistfile1.sh -O /usr/local/bin/torrent_shorting_hat
chmod +x /usr/local/bin/torrent_shorting_hat

I personally recoment this method, but if you prefer, you can get it at your local home, you could, for example, do something like this:

wget https://raw.github.com/gist/1705151/540fd4445ca4e0f540ddf82decba3ffc421c46ab/gistfile1.sh -O .torrent_shorting_hat
chmod +x .torrent_shorting_hat

Configuring deluge

We enable the execute plugin

Enable execute plugin

Then, we add an execute action for a “finished torrent download” handler. If you’ve added your script locally, you had to reference it as its full path, otherwise you have just to use “torrent_shorting_hat” as scrpit:

 

Adding the complete script call.

 

Configuring the sorting hat

The sorting hat will read a file in your home called .torrent-aliases, more exactly its regexes variable, it’s basically a shell script with associative arrays, like this:

regexes[''hitchicker']="(.*)42(.*)"

This will get everything containing “42″ to a folder in ~/Media/(mimetype)/hitchicker, being mimetype the file’s mimetype. Wich, by the way, means that even if you don’t have anything configured, the script will organize files by its type.

 

25
Jan

Rstext.me restructuredtext slideshows on the cloud

I just made restructuredtext slideshow solution public, under the motto “Getting your slideshows done have never been so easy”.

” The best thing about it is that you can build nice, corporate-looking presentations in just seconds, concentrating in the information instead of the format or the style. We provide a lot of predefined themes, and will give corporate support for bussiness image templates”

David Francos

Rstext.me turns around our current concept of building a slideshow by providing a nice infraestructure to edit and store online your slideshows, in restructuredtext format (a widely used easy-to-read markup language).

You can visit it here

Source: http://blog.rstext.me

 

 

 

 

20
Jan

Bringing back old flash /tmp files!

I recently wrote a script for playing files on recent browsers with mplayer, a friend asked me if could bring the old system back… so here I did it, each time you execute this script you’ll have your current playing videos linked again in /tmp with their old names:

for i in $(pgrep -f flash); do file /proc/$i/fd/*|awk '/Flash/{ gsub(/`/, ""); gsub(/:/, ""); system("ln -s " $1 " " $6); }'; done
13
Jan

/foreach user_in [users] do [commands] in irssi

I just finished my implementation of foreach user_in for irssi.

There was out there a plugin to execute anything for each user in a channel window. I had the requirement to send information to a huge amount of that users (that is, a list of users from my bitlbee channel) but not to all the channel, so I said… Why not a foreach_user indo?

This way, I can, for example, do something like this:

/foreach user in friend_one friend_two friend_three /msg -bitlbee &bitlbee $0: Want a beer? 2100 at my place.
 /foreach user in contact_one contact_two friend_three /msg -bitlbee &bitlbee $0: Have you checked out my last proyect

For this, just download the script from my github and place it in .irssi/scripts/autorun so it will be auto-executed when starting irssi, and load it with:

/load autorun/foreach_user_in.pl

5
Jan

Adding socks5 support to python-irclib

I was playing with IRC and Proxyes a few weeks ago, and I found out that python’s irclib didn’t support them!
It took me like a minute or so to fix it, just overloading socket with socksocket, you can have a look at my fork in github

        try:
            import socks, os
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,
                os.getenv('proxy_addr'), os.getenv('proxy_port'))
            socket.socket = socks.socksocket
        except:
            pass

So, basically I try importing socks and setting up a default proxy, socks5 (sorry, I haven’t considered socks4 on there), with the environment variables proxy_addr and proxy_port as addr and port.

To use it, you’ll have to get a libirc-based application (there’s a bot included that might be a start) and, before starting it, define proxy_addr and proxy_port

proxy_addr=127.0.0.1; proxy_port=1080; python my_python-irclib_based_foo

Enjoy =)

28
Dec

Playing temporary files with mplayer on Flash 11

Back in the times of Flash Player 10 we could do an mplayer /tmp/Flash*. You could use mplayer on your flash videos, or even download them! Sadly, Adobe realized that, and fixed it.

But it’s still posible! Basically, each process has a list in /proc of all the File Descriptors it has opened, between them we’ll find our flv file.
More concisely, It will reside on /proc/_PID_/fd where PID is the process id, and will be a symbolic link, pointing to /tmp/FlashXXX
You’ve read right, points to /tmp/FlashXXX as the old ones, so we can just list it and filter by that name

Save or play your youtube, megavideo, daylimotion and many more flash videos on linux!

I first tried listing all files in /proc/*/fd but that was slow as hell, so I filtered out (thanks to pgrep) the ones matching all full processes containing “flash” (should work on firefox and chrome at least) in their full call.

for i in $(pgrep -f flash); do file /proc/$i/fd/*|awk '/tmp/Flash/ { gsub(/:/, ""); print $1 }'; done

You can now just use that files with mplayer!

I, personally, have buggy speakers and use it for manually increasing the volume output with softvol switch (forcing a software volume mixing)

mplayer -fs -zoom -idx -softvol -softvol-max 10000 -volume 5000 `for i in $(pgrep -f flash); do file /proc/$i/fd/*|awk '/tmp/Flash/ { gsub(/:/, ""); print $1 }'; done`

 

12
Dec

Vim workshop at downgrade hackerspace.

This evening in zaragoza we were assisting at the VIM Workshop organished by the downgrade hackerspace. I was (supposedly) one of the speackers, even tough I didn’t have in mind any kind of speech. I planned it as a de-centralized workshop, but people seemed to not understand that.

Thanks god that meskio was there, to use his social habilities to get things started. It ended up being a producitve workshop, were all of us gained some vim knowledge. I learned some curious tricks, and the vim local_vimrc plugin, wich allows you to have nested vimrc files.

After all this workshop installing and messing with plugins and pathogen, I came up with yet another vim configuration starter, wich you can find here. This script will (remember to clean your env first) install pathogen, configure it and install nerdtree, conqueshell and VimBlog in bundles dir.

It’s basically a five-liner, wich will end up with a pathogen-enabled .vim directory and a few useful plugins, wich can be configured:

plugins=( "The-NERD-tree" "Conque-Shell" "vimblog.vim" )
wget -nd -P .vim/autoload https://github.com/vim-scripts/pathogen.vim/raw/master/plugin/pathogen.vim
wget http://lh-vim.googlecode.com/svn/misc/trunk/plugin/local_vimrc.vim -nd -P .vim/bundle/local_vimrc/plugin/
grep 'call pathogen#infect()' ~/.vimrc || { echo -e "ncall pathogen#infect()nlet g:local_vimrc=".vimrc"n" >> ~/.vimrc; }
cd .vim/bundle && for i in ${plugins[@]}; do git clone https://github.com/vim-scripts/$i; done