2/09/2012
Restore file permissions
I didn't test it but it must work for owners and owner groups too. Something like:
2/07/2012
Find a directory by name in linux
-type d == directory
-name '.svn' == all directories named .svn
-ls == converts unusual characters to C style escape sequences
To delete the list of directories returned by the above command execute xargs builds and executes command lines from standard input
/bin/rm -dr == remove command with the directory and recursive flags
-name '.svn' == all directories named .svn
-ls == converts unusual characters to C style escape sequences
To delete the list of directories returned by the above command execute xargs builds and executes command lines from standard input
/bin/rm -dr == remove command with the directory and recursive flags
Labels:
linux
2/01/2012
Group Sticky bit
To ensure that the group owner of existing and new files stays the same set the group sticky bit like so:
Labels:
linux
1/16/2012
5/10/2011
11/01/2010
Ubuntu - find current graphics card model
lspci | grep VGAMore detailed information can be found by running:
sudo lshw -C video
Labels:
Ubuntu
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
because the output would be
Obviously the desired output would be:
To do that in java use:
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+");
Labels:
Java
Subscribe to:
Posts (Atom)