Script to check Oracle remotely (nagios or whatever)

For all of you that are not the lucky owner of an Enterprise Manager license or you simply want to use nagios or another monitoring engine to get status and graphs of oracle, probably you’ll be using the “check_remote_oracle” plugin.

If you’re a scripter/developer maybe you’ll understand me when you open an script and see an COMPLETELY UNREADABLE code, with no functions, no indentation… etc
And then you’ll have to change anything stupid inside the script and then f**k it does not work!

This is the story of that script, I installed it, then I have to do some changes… and then I decided to rewrite it completely…
I’m not the best scripter of the world, but I know how to use functions, indentation and that useless shit :-P

You can read the whole documentation on its wiki page.

Enjoy!

PS: updated the instructions, I forgot the information about the unprivileged user for connecting to Oracle instance.
PS2: Updated again, new control!

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 ;-)

UPDATED SCRIPT!

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

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”

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.