Posts under terminal heroes

Terminal Heroes 8: Memory usage scripts

Posted by Ktoso under coding, terminal heroes (No Respond)

I have a low-memory VPS running online and thus always have to worry about what uses how much memory… Of course top and my favorite htop are very good tools to check this, but sometimes I just want to get a super simple report if I’m overusing memory or not yet. The bellow scripts (most [...]

Tags: , , , , , , ,

(Almost) Automatically convert files into PDF

Posted by Ktoso under coding, freedom, fun, terminal heroes (No Respond)

I’m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( http://www.icsr.agh.edu.pl/~mownit/mownit.html ). I was really happy to see some *.ps but some people from my fellow students started complaining that they’d rather have pdf’s and not ghostscript files (who knows why they’d do..?). [...]

Tags: , , , , , , , , , , , , , ,

Vim Hacking – 1 – vis

Posted by Ktoso under coding, terminal heroes (No Respond)

Vim is a really amazing text editor (though I’d like to learn Emacs too soon… :-)) and it can be easily expanded to be even more useful. One super cool extension I found is: vis — it allows powerful sed-like line modification (you could use sed from inside vim, but that’s not really “handy”). Vis [...]

Tags: , , , , , , ,

Terminal Heroes – 6 – Track X events

Posted by Ktoso under coding, fun, terminal heroes (No Respond)

Another Command Line Fu oneliner I’ve sumbited today: #show X window events in chosen window $ xev -id `xwininfo | grep 'Window id' | awk '{print $4}'` EnterNotify event, serial 13, synthetic NO, window 0×6400053,     root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63),     mode NotifyNormal, detail NotifyVirtual, same_screen YES,     [...]

Tags: , , , , , , , , ,

Terminal Heroes – 5 – List internet active apps

Posted by Ktoso under coding, fun, terminal heroes (No Respond)

A simple yet usefull command-line-fu I made up: #list all internet active apps $ netstat -lantp | grep -i establ | awk -F/ '{print $2}' | sort | uniq   firefox java pidgin thunderbird-b Lookup this command at CommandLineFu Thanks to HarimaKenji for fixing a little issue with this command. —update— CommandLineFu user submited a [...]

Tags: , , , , , , ,

Terminal Heroes – 4 – regexpias lair

Posted by Ktoso under coding, freedom, fun, terminal heroes (2 Responds)

Let’s drop a little humor in this time… You, brave Terminal Hero, shall kill -9 the daemon that has hidden itself in one of those files! We don’t know in which file you can find it though! We’re running out of time! The kingdom of GNU will be rm -rf‘d if you won’t make it [...]

Tags: , , , , , , ,

Terminal Heroes – 3 – ^^ typo fixing

Posted by Ktoso under coding, freedom, terminal heroes (No Respond)

A great bash feature I just discovered is the “^blabla^bla” command (is it a “command” by the way..?) If typing stuff quickly by hand, typing mistakes (typos) happen… And it’s not really fast to fix them by using UP ARROW and then fixing the command by “hand”… A better, quicker way to do this is [...]

Tags: , , , , ,

Terminal Heroes – part 2 – sed all files

Posted by Ktoso under null, terminal heroes (No Respond)

Did you ever have to substitute a single word with another one in lets say… 200 files? I just had to, since I used some old files from a client and wanted them to work in the new project – where some classes where named different because of Propel stuff. Here’s my solution: find . [...]

Terminal Heroes – 1 – mysql backup insert

Posted by Ktoso under coding, terminal heroes (No Respond)

Just a quick note while dumping a 70MB database… ;-) Let’s say i got my database backup from phpmyadmin, compressed with gz (zip’s also fine), while getting the backup,even if it’s BIG ain’t really a problem, putting it into the database can be troublesome becouse timeout’s etc, especially if it’s a BIG file ;-) My [...]

Tags: , , , ,

Gnome – Własny skrót klawiszowy

Posted by Ktoso under coding, freedom, terminal heroes (No Respond)

Po raz kolejny chciałem sobie uprzyjemnić pracę z GNOME. Ale o dziwo miałem z tym pewien problem… Zamiast CTRL+ALT+D chciałem używać skrótu SUPER+D do ukrywania wszystkich okien. O dziwo, kiedy to w kreatorze chciałem wprowadzić, minimalizował okno zanim przyjął w ogóle że wcisnąłem klawisz SUPER, oczywiście się nie poddałem i wklepałem poniższe w terminalu: gconf-editor [...]

Tags: , ,