5/10/2011

Debian adduser

Debian / Ubuntu: Add to sudo group (Debian / Ubuntu specific step):

11/01/2010

Ubuntu - find current graphics card model

lspci | grep VGA

More detailed information can be found by running:
sudo lshw -C video

10/31/2010

Split a string in Java

If you have a string as follows:

Lorem Ipsum   Foo Bar

and you want to split it by whitespaces, you can't do

myString.split(" ");

because the output would be ("Lorem", "Ipsum", " ", "Foo", "Bar")

Obviously the desired output would be: ("Lorem", "Ipsum", "Foo", "Bar")

To do that in java use: myString.split("\\s+");

9/16/2010

top - you should use u

I was looking at tops output to observe apache, and was thinking to myself how useful it would be to just go ahead and filter by user, and well...turns out that I should have thought of this years ago (RTFM?): while viewing top, just press u, now enter desired user, hit enter and be amazed ;-)

9/12/2010

Using tabs in vim

Starting with vim 7 you can use tabs, which is especially handy if you're a developer. The tabs are displayed in the first line (requires to have more than one tab open), highlighting the active tab. A + marks the tab as having unsaved changes.

Some useful commands:

I wish I would have known these a few years back, I guess I should have RTFM ;-)

9/11/2010

Drupal 6 and jQuery Update

After a long time of debugging the annoying error that popped up in my firefox error console:

Error: Unrecognized Syntax (...

I finally managed to trace it down! Turns out that jQuery 1.2.6 still allowed the selector syntax [@, which starting from jQuery 1.3 was removed. After figuring that out I grepped through all modules and was able to blame lightbox2! Yes, lightbox2! For some reason the current official version has not fixed those, but after downloading the dev version the dreaded error was gone.

3/07/2010