Archives for February 2011

Replace autogenerated method bodies with certain default implementation

This is the sample on how to replace certain implementation of the method with the other one using regular expressions. // search pattern: \{[\w/;\s\|\.]+\} // replace to: \{\nthrow new UnsupportedOperationException\(\);\n\}

Ubuntu: add user from the shell

The following script does the trick: sudo su – // elevate priveleges to the superuser useradd -d /home/USERNAME USERNAME // create user with home dir passwd USERNAME // set password for the user chown USERNAME /home/USERNAME // grant priveleges for using the home dir chsh -s /bin/bash // specify to use bash when the user [...]