Have you ever lost you MySQL root password? I have, and I promise you it’s no fun. Especially if you’re good with strict permissions and only allow the absolute necessary actions for the users. Then you’re sitting there with a sad feeling of being locked out from your own house.
Luckily the problem is pretty quick to solve, in 5 steps I’ll show you how to reset it.
- Log in to your server and get root with “su -” (don’t forget the trailing -) or if you’re on Ubuntu use “sudo -s“.
- Stop the MySQL daemon:
/etc/init.d/mysql stop
- Start MySQL daemon without authentication:
/usr/bin/safe_mysqld --skip-grant-tables &
- Connect to MySQL and change the password:
mysql -u root mysql
- Restart MySQL:
/etc/init.d/mysql restart
The last step (5) is VERY IMPORTANT, cause if you don’t restart the server everyone can connect to it and do whatever they want to!
Below are the rewrite rules / code for WordPress running on Nginx webserver.
This code goes in /etc/nginx/sites-available/default and in between the server { … }
# SEO friendly URLs for WordPress
#
location / {
root /path/to/YOURDIRECTORY/public_html/forums;
index index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
}
}
And if you, like me also has bbpress installed / integrated you must also use the code below below. If you’re only running bbPress though replace all entities of /forums/ with / or the correct path.
# SEO friendly URLs for bbPress
#
location /forums/ {
root /path/to/YOURDIRECTORY/public_html/forums;
index index.php;
if (!-e $request_filename) {
rewrite ^/forums/topic/(.*)$ /forums/topic.php?q=$1 last;
rewrite ^/forums/forum/(.*)$ /forums/forum.php?q=$1 last;
rewrite ^/forums/profile/(.*)$ /forums/profile.php?q=$1 last;
rewrite ^/forums/view/(.*)$ /forums/view.php?q=$1 last;
rewrite ^/forums/tags/(.*)$ /forums/tags.php?q=$1 last;
rewrite ^/forums/rss/(.*)$ /forums/rss.php?q=$1 last;
rewrite ^/forums/bb-admin/ /forums/bb-admin/index.php last;
rewrite ^/forums/ /forums/index.php last;
break;
}
}
It’s pretty easy to spoof your MAC address if you sometime needs to
ifconfig eth0 hw ether 00:11:22:33:44:55
But I recommend installing a tool called macchanger. It is able to set a completely random mac, a specified one, from another vendor, and much more!
I’m not quite sure why, but on Linux the Firefox browser (Iceweasel in Debian) uses the backspace-button as PageUp instead of going back to the last visited page like on Windows. This may just be a bad habbit I have from using Windows, but it’s my right to change it if I want, that’s why I use Linux!
- Type about:config in the addressbar and press enter (you might get a warning, but we’ll be careful!)
- Apply the filter “backspace” (Use the field on top)
- Double click on browser.backspace_action and change the value to 0 (zero).
From now on, pressing the backspace button will bring you back one history. Enjoy!
To mount a NFS share in Linux is actually pretty easy. Let’s say you want to mount the remote folder /path/to/share on server hostname, to the local /mnt folder. This is simply done by a single line in the terminal.
mount -F nfs hostname:/path/to/share /mnt
In january 2009 I published a script making it almost to easy to install and configure the Nginx web server with PHP support and MySQL. This script was first dubbed Ubinscripts (WEB) and after several updates now in July when I launched the new web site I renamed it to nWeb Script, and released a brand new version.
The script have also gotten it’s own page, which you can find in the menu under Tools or at the following address http://thehook.eu/tools/nweb/.
This page was created and back dated to catch many of those who have old bookmarks to this post.