As you may or may not know, I have killed a couple of webpages and blogs lately and started thehook.eu. The reason for this is that I barely have the time, energy or pleasure of maintaining one site / blog. I also think it will lift the quality of the site. And to not make old mistakes new, this time I have the focus on the site as whole and not only the blog.
I have reposted most of the posts from earlier sites, and have updated the quite popular nWeb Script (formerly known as Ubinscript). I am also planning to write some articles here in the future, and adding more fun stuff.
I have removed both the Forum and Wiki, since it was mostly used by spam bots and not real people, and was causing more trouble than pleasure.
Right now the site has a few cosmetic quirks, and other stuff, but I am working on it. If you have any tips, feedback, wishes or problems, please do not hesistate to contact me!
Did you know that it’s not just your browser that stores cookies on your computer? Adobe Flash Player is doing it also, and these are much harder to manage. To manage these you have to use the “Adobe way” or the nice and cool “Linux way” described below. For more information on what it actually is, check out the links at the end of this article.
Back to the fun part, where do you find these cookies you may ask? They’re stored in two folders on linux
~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/
~/.macromedia/Flash_Player/#SharedObjects/
Using find to show the cookies
cd ~
find -iname '*.sol'
How many cookies do you have?
find -iname '*.sol' | wc -l
Using find to Search & Destroy all flash cookies
find -iname '*.sol' -ok rm "{}" \;
To prevent the flash cookies from being written to your disk
chmod -Rv 0500 .macromedia/Flash_Player/#SharedObjects/ .macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/
This will set the two folders they are residing in to read and execute only, so nothing can be written there.
More resources:
Open the OpenOffice.org Spreadsheet (calc) and write the following into one of the cells and press enter:
=GAME("StarWars")
Watch the pictures below
(more…)
To see what and how many packages you have installed on your Debian system (including derivatives like Ubuntu) system there are some simple commands to use:
To list all installed packages including version and description use
dpkg -l
This should be piped to less using | less for better reading.
You may also use the following to print only the packages without version and description using
dpkg --get-selections | awk '{print $1}'
This command can easily be piped to a file for saving using > file_name
It’s also easy to count the number of installed packages using
dpkg --get-selections | wc -l
Have you ever wanted to hide a user from the login screen in Windows for various reasons? The answer may be split but the solution is simple:
- First we need to open Registry editor by running (Win+R) regedit
- Locate the key
HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon\SpecialAccounts\UserList
- Under this key create a new DWORD that matches the username exactly, and set the value to 0 (zero) to hide it
If you later want to show it just change the value from 0 to 1.
BruisedFruit (previously known as QWiki) is an ultra-lightweight PHP wiki implementation designed for people who (from time to time) need to quickly and easily setup a small, bloat-free wiki that ‘just works’.
And here are a rewrite rule to make it work on nginx:
# SEO friendly URLs for BruisedFruit
#
location /wiki/ {
if (!-e $request_filename) {
rewrite ^/wiki/search(.*)$ /wiki/search.php?search=$1 last;
rewrite ^/wiki/([^/]+)/([^/]+)/?$ /wiki/index.php?page=$1×tamp=$2 last;
rewrite ^/wiki/(.*)$ /wiki/index.php?page=$1 last;
}
}
Backup is a VERY nice thing. I’m unfortunately not the best to remember it myself and it’s been costly.. But it is also very nice to dump all tables to a file and move it to another server and restore it with a simple command (after you have created the database of course).
To back up your database use the following command:
mysqldump -u [Username] -p[password] [databasename] > [backupfile.sql]
And to restore it again use this:
mysql -u [Username] -p[password] [databasename] < [backupfile.sql]
And then it’s done! Just remember to store your backups a safe place.
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!