uname -a
To view hostname : cat /proc/sys/kernel/hostname
a blog on linux tips and tricks
Stop the mysqld daemon process:
/etc/init.d/mysql stop
Start the mysqld daemon process with the --skip-grant-tables option:
/usr/bin/mysqld_safe --skip-grant-tables
Start the mysql client with the -u root option:
mysql --user=root mysql
Execute the query:
update user set Password=PASSWORD('new-password-here') WHERE User='root';
Execute the FLUSH PRIVILEGES; command:
flush privileges;
Exit the mysqld daemon process:
exit
Start the mysqld daemon process:
/etc/init.d/mysql start
How to creating Symbolic Links in linux
ln -s source destination
example: ln -s httpdocs httpsdocs
This creates a symlink for httpsdocs -> httpdocs
To change permission of symlinks
chown -h owner:group directory
To redirect the whole website
Redirect 301 / http://www.domainname.com/
To redirect a particular directory
RedirectMatch 301 ^/directoryname/$ http://www.domainname/
To redirect non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domainname\.com$
RewriteRule (.*) http://www.domainname.com/$1 [R=301,L]
To redirect www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^domainname\.com$
RewriteRule (.*) http://domainname.com/$1 [R=301,L]