Tuesday 23 February 2010

Mysql reset root password

# /etc/init.d/mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql -u root

mysql> use mysql;
mysql> update user set password=PASSWORD("yournewpasswordhere") where User='root';
mysql> flush privileges;
mysql> quit

# /etc/init.d/mysqld stop
# /etc/init.d/mysqld start

Now you can login with your new password
# mysql -u root -p

Monday 22 February 2010

Ubuntu set week start to monday

locale | grep LC_TIME
LC_TIME=en_US.UTF-8
cd /usr/share/i18n/locales
sudo cp en_US en_US_custom
sudo gedit en_US_custom
first_weekday 1 --> 2
sudo gedit /etc/environment
LC_TIME="en_US_custom.UTF-8"

Thursday 18 February 2010

Linux Remove file start with special character

Delte file name --help or -help

rm ./--help
rm -- --help

Linux Remove file start with special character

Delte file name --help or -help

rm ./--help
rm -- --help

Friday 12 February 2010

Ubuntu installing same packages to another ubuntu

I want to prepare test OS for my ubuntu. Before appyling patches or new software I do testing on that machine (running on virtualbox)
MachineA $ dpkg --get-selections > mypackages.txt

MachineB $ sudo dpkg --set-selections < mypackages.txt
MachineB $ sudo apt-get dselect-upgrade