Openvpn in the TP-LINK WR841N[D]

Hi folks,
Here comes a post to improve that great router from TP-LINK.
Of course, I suppose you’re running openwrt on it to use the whole power of it.
The 1st I saw was that you have available a plenty set of packages… but you don’t have enough ROM to install them :-P
Inspecting a bit, I saw that under /tmp you have a “lot” of free space! (about 14MB), that will be enough to allow run openvpn without problems.
The main problem? Its a ramdisk, so each boot, everything there disappears.
What I’ve done? Install the basics with opkg and wget on boot the rest ;-)


Continue reading “Openvpn in the TP-LINK WR841N[D]”

Oracle Metadata Generator (and svn uploader)

(See comments)

My first (public) script for Oracle :-) [beers]
This script will (hopefully) do:

  • List all the objects on the database for each SID/SCHEMA given
  • Dump the metadata of each object in a different file
  • Upload everything to the svn

If you’re asking why? you must deal more with programmers :-P
This will add a second line of defense to the expdp CONTENT=METADATA_ONLY classic script.
Continue reading “Oracle Metadata Generator (and svn uploader)”

The inexpensive Video-Phone project

Happy new year!!!
After my adventures trying to build Android from source, I want to explain the reason for that.
As I live very far from my fathers and they’re elder, I’ve been thinking for a long time how to have a easy way to make videoconf with them and share photos… The usual things you know?
The main problem was that they’ve never used a PC and the newest gadget they have is a Nokia X2

Continue reading “The inexpensive Video-Phone project”

Explicando un tunel ssh

Que mejor manera de explicar un tunel ssh que con un dibujito?
(Me he dejado las puppets en casa)

A veces parece increíble que a un ingeniero diplomado le cueste entender el concepto de “cerca”, “lejos” y “saltar a través” que supone un tunel.

Personalmente siempre me ha gustado la explicación con ascii art:

+----------+<--port 22-->+----------+<--port 80-->o-----------+
|SSH Client|-------------|ssh_server|-------------| host |
+----------+ +----------+ o-----------+
localhost:8888 computer

En el que basta con explicar que “” no es accesible desde “SSH Client” y mediante el tunel ssh a través de “ssh_server” QUE SÍ TIENE ACCESO, te traes el puerto :80 a tu ordenador en el puerto 8888.
Todo esto con una linea tan simple como:

SSH Client$ ssh -L ssh_server

Os dejo el maravilloso dibujo con el que puede ser que me haya entendido “mi” usuario ;-)

Parallel rsync’ing a huge directory tree

Some days ago I was on the chance to transfer a huge directory.

Huge means ~50TB with +10million files and a deep of only 6 folders under the parent one.
As I must do that kind of transfer more than 10 times with the same amount of folders… I decided to implement some kind of parallel function which launch parallel rsync’s at a given deep of my choose.

The ressult was that “pure bash” little script (the only dependency is “screen”)… You’ll notice that the main function “sync_this()” will run alone in your script only changing 2 or 3 variables ;-)
Continue reading “Parallel rsync’ing a huge directory tree”

La linea del día

Hoy toca party hard por que el servidor que hace repositorio local se está quedando sin espacio asi que a riesgo de que romper algo y volver a tener que replicar Dag me he puesto a borrar todos los paquetes que tienen varias versiones dentro del repositorio…
El resultado como one-liner es interesante:
[cc lang=”bash”]
ls -1 | awk ‘BEGIN{FS=”-[0-9]”}{print $1}’ | uniq -c | egrep -v “^[[:space:]]{1,}1 ” | awk ‘{print $2}’ | while read LINE ; do let x=0 ; for i in $(find . -name “${LINE}-[0-9]*”) ; do ARRAY[$x]=$i ; let x++ ; done ; for ((j=0; j<$((${#ARRAY[@]}-1)); j++)) ; do rm -f "${ARRAY[$j]}" ; done ; unset ARRAY ; done [/cc] Aunque es un poco heavy para ser una one-line pura xD al verla después hay que soltar poco menos que un WTF.