Skip to content
Archive of posts tagged Tips

Bash and Template Files

Last week I had to migrate my dns server and to do stuff properly I also added a couple of slave DNS servers just to make sure. Problem: ~15 domain names that need to be added to a fresh bind installation. The zone files didn’t change too much so that was fine, sed helped me [...]

Hardware Keylogger Detection

Intro Keyloggers are nifty things used to grab keyboard input for later analysis and use. The most common type of keylogger is the software keylogger as it is just some program that records key presses. Running it usually requires administrator privileges and this limits the attack surface as one must first gain this type of [...]

Parsing XML data using bash and standard Unix tools

Parsing XML can be a tedious and unpleasant job if you insist on using just standard Unix tools like sed, awk, cut, grep and so on. One might say that it’s better to use python/perl/ruby/other language that ships with a full blown XML parser and use the standard Unix utilites for what they were meant [...]

Choosing random entries from a group

In the past two weeks we had a lottery-type thing on RGC.ro (Romanian Guitarist Community). Proguitar, the official importer of Fender products in Romania, wanted to give-away a custom made Fender Stratocaster electric guitar. To register, the community users had to fill out a form and choose from a series of custom options for the [...]

Get your personal email account

Most people use free email services like yahoo, gmail or live. Unfortunately all the nice sounding email addresses are taken by now so new users have to come up with strange combinations like johndoe19__smth_smth@yahoo.com. That’s very hard to remember and it sounds very unprofessional. Having an online presence is no longer such a big deal. [...]

Color that manpage!

Manpages are the last line of defence when it comes to unix troubleshooting. After you’ve tried everything you could have think of and it still doesn’t work you know it’s time to read the manual. By default linuxes use the less command to display the man page requested by the user. The manpage is displayed [...]

Quickie: Wrap to 80 columns

I got a complaint that my submitted text file is not wrapped to 80 columns. Rather than work my butt to mix and match the text lines until i get to the bastard’s requirement I used the neat little tool called fold cosu@cosu-desktop:~/Desktop$ cat file | fold -s my monitor resolution is soooooooooooooooooo small that [...]

Find script path

Azi am avut nevoie sa gasesc calea in care sa gaseste un script chiar din scriptul respectiv. Fiserul se plimba prin diverse locuri si eu am nevoie de cai absolute ( hint java classpaths) Solutie MYPATH=”$(readlink -f $(dirname “$0″))” hints: man readlink, man dirname

On screen

Screen este o scula foarte utila atunci cand ai multe de facut si putine terminale la dispozitie. Practic screen este un multiplexor de terminal, cam cum e gnome terminal sau yakuake in varianta lor cu taburi, doar ca totul e facut direct in consola. Pe langa multiplexarea mai sus amintita screen ofera si un feature [...]

umount: device is busy

Uneori cand vreau sa fac umount unui volum se mai intampla sa primesc mesaje de genul “device is busy”. Solutiile sunt multiple si foarte complexe. A doua solutie est este mai brutala: fortarea procesului de umount cu ajutorul parametrului –f : umount –f /path/to/mount In prima instanta aflam procesul care tine lucrurile pe loc cu [...]