[terminal heroes] Display git branch in shell prompt (PS1)

Posted by Ktoso under english, fun, guide, terminal heroes (2 Responds)

I don’t think I’ve blogged about this but I’ve seen this sometime ago and now decided to add it to my .bashrc for good. It’s a simple trick to make an awesome PS1 shell prompt, displaying the branch you are currently on (if you’re in a git versioned directory). Not that I’m forgetting what branch [...]

Tags: , , , , , , , ,

G73 keyboard backlight scripts

Posted by Ktoso under coding, freedom, fun, gaming, guide, terminal heroes (18 Responds)

I’ve upgraded my desktop and laptop last week. By “and” I mean that I’ve bought an desktop replacement class notebook – an Asus G73 series. Amongst many nice parts it has I’m very happy about the harddrives – Seagate Momentus XT, click the link to see an very interesting benchmark of it. Anyways, that’s not [...]

Tags: , , , , ,

Awesomely create an pdf #…

Posted by Ktoso under twitter (No Respond)

Awesomely create an pdf #slideshow from images: “convert *.png slides.pdf” #linux #bash #terminalheroes

Tags: , , , ,

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: , , , , , , ,

Kill only Tomcat

Posted by Ktoso under coding, java (No Respond)

There is sometimes the need to kill some JVM, I usually use “killall java” and that works fine as long as that’s in fact what I want – kill ALL. But let’s say i just want to kill Tomcat and not my IDE? The below method works quite well in such an situation: [ktoso@homunculus ~]$ [...]

Tags: , , , , , ,

AWK and multiple lines from shell command

Posted by Ktoso under coding (No Respond)

Let’s say you want to read the ps output inside an AWK script, it’s not so simple since system returns an exit code and not the string you want – it’s being sent to stdout, here is a simple trick to read multiple lines from a shell command inside awk: awk ‘BEGIN{while (“ps aux” | [...]

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 – 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: , , , , ,