x264vfw encoder builds for Windows – fix your encoding issues

Fix your x264 encoding issues with the build from komisar.gin.by.

This installs the encoder as a codec to be used by other applications. There is a command line version available from them, as well.

Download x264vfw *kMod.x86

Make an Entire HTML div Element into a Link with Simple CSS

Filling a div to make the entire element into a clickable link is fairly simple with the use of CSS.

HTML:

CSS:

Empty / Zero a File in Linux

If all you want to do is make an existing file empty, causing the filesize to be 0, you just need to enter an extremely simple command:

That’s it, your file will be empty.

MySQL Find and Replace

Here’s a simple line of code to perform a MySQL search and replace operation. Update the text between the brackets with your table and the field you want to work in, as well as the string you’re searching for and replacement text.

Recursive sed on Multiple Files and Directories

Using sed on multiple files in a single directory:

Using sex recursively on multiple files (of the same name) searching through many directories:

These commands can easily be edited to change files of a certain type or only up to a certain amount of directories.

Fix Windows XP Serial Key

Download the Volume License Key script for Windows XP and extract to c:\.

In a command prompt, replacing ab123-123ab-ab123-123ab-ab123 with your new key, type:

Show Hidden Devices in Windows Device Manager

In command (Start > Run > cmd or Windows key + r > cmd):

Open Device Manager and select:

Now you can see all devices, including ghost devices.

Dynamic Website Titles with a Simple PHP Array

In order to make the titles of your website dynamic all you need to do is use the following code.

This will randomly output one of the titles in the array.

Apache .htaccess or httpd.conf to Force non-WWW to WWW

The following is a very simple and straightforward method to force, in Apache, non-WWW domains to WWW. There is also an example of how it would work with HTTPS. These can be used in httpd.conf or in a .htaccess file.

To maintain HTTPS:

By the way, the reverse (WWW to non-WWW) is as simple as this:

Unfortunately, it’s not as simple, though I’m sure someone can provide a better example.

Fixing Double-Encoded UTF-8 Data in MySQL (Latin-1 to UTF8)

“Double-encoded UTF-8 text (not to mention triple-, quadruple- and so on) are a fairly common problem when dealing with MySQL. This may be due to the fact that the default character set of the connection to the server is Latin-1, but that is not relevant once the data is already corrupt.

Here is how to fix it, in two simple steps, using the mysqldump and mysql commands:

Of course, you should first replace DB_HOST, DB_USER, DB_PASSWORD and DB_NAME with values, corresponding to your database setup.”

This was from some StackExchange (or something like that) reply to a person’s problem, if I remember correctly.

Reduce the Microsoft Windows 7 WinSxS Folder’s Size

You can reduce the Microsoft Windows 7 WinSxS folder’s size by about 3GB, on average. On my x64 system I went from 10.3 GB to 6.6GB. The process is extremely simple.

Enter the command prompt: Winkey+R > cmd.exe – make sure you’re using it with Administrator privileges. You may need to find cmd in the Start menu and right click > Run as Administrator).

Type dism /online /cleanup-image /spsuperseded and hit enter.

And you’re done!

Note: this is only useful for Windows 7 users who installed the Service Pack updates themselves. If your system came with SP1 already installed, this won’t do anything.

Generate an OpenSSL CSR for Apache2 and ModSSL

Generating an encrypted RSA key

You can skip this step if you’ve already made your RSA key.

The simplest method is to just create the key: openssl genrsa -out www.domain.com.key 2048. This will create the standard 2048 bit RSA key. 2048 bits is currently the minimum any CA (Certificate authority) will accept. You can change 2048 to 4096 for more security, but it’s not really necessary.

If you’d like an even more secure key, you can create one that needs a passphrase to use. If you do choose this method, note that you will have to enter the passphrase every time you restart Apache2 or even reboot the system. Also note that if you lose your passphrase, you’re going to have to replace the certificate, meaning that you’re going to have to buy a new one.
openssl genrsa -des3 -out www.domain.com.key 2048

If you’ve already added a passphrase to your key, and you don’t want that any longer, you can decrypt it: openssl rsa -in www.domain.com.key -out www.domain.com.key.unsecure

Generating a CSR

Now that you have your key, all you need is to make your CSR using it: openssl req -new -key www.domain.com.key -out www.domain.com.csr

You can now open the .csr with whatever text editor and copy/paste the contents into whatever site from where you’re buying your SSL certificate.

Make Self-signed OpenSSL Certificate for Apache2 on Debian

Note: I made the above command two lines to fit the post. You can remove the backslash and make it one line if you’d like.

This will simply make a 2048 bit RSA key and it will attach your certificate to the bottom of it. You’ll end up with a .pem that will work with Apache2. Your visitors will get errors in their browser, but the connection will still be SSL secured.

The only free method for getting a certificate without any errors is going through StartCom’s StartSSL service. CACert is not included in Windows or in any browsers currently, while StartCom is included in all of them.

phpMyAdmin, MySQL: The configuration file now needs a secret passphrase (blowfish_secret).

The error “The configuration file now needs a secret passphrase (blowfish_secret).” occurs on Debian 6 Squeeze because computers are shit and everyone sucks balls at writing software properly.

To fix this, you need to manually add a key to the config. This is assuming you already have the config, and that you don’t need to copy/rename the sample config.

Go to this site to get a key: phpMyAdmin Blowfish Secret Generator.

You enter that key into config.inc.php, in your phpmyadmin directory. Debian is usually /etc/phpmyadmin.

Enter it into/add the following line: $cfg['blowfish_secret'] = 'BLOWFISH PASSWORD HERE';
Obviously, you replace the giant letters, that tell you where you put your key, with the key.

The first link I found, when I searched for this, was most useful: Question Defense.

It’s really sad that some packages are still this broken, after more than four years. I experienced this issue for the first time on an x64 build of Debian 6, though I’ve since been met with it on any version of Debian 6.

Debian 7 Wheezy also has this issue, though the configuration file format has been changed somewhat and now the passphrase goes into its own file in /var/lib/phpmyadmin. At least in Debian 7 it gives you information on what it means and how to use it (somewhat) if you look at the config files.

Fatal: cannot call XML::SAX->save_parsers_debian().

Another post about an issue I was having, this time while trying to get the W3C validator installed locally. It seems there was a failure installing one of the needed perl packages so I had to to it manually. After doing so, the following error was returned: Fatal: cannot call XML::SAX->save_parsers_debian().

After doing a quick bit of Googling, the second result actually returned some useful information. The poster to the forum, fine102, lead me to the local installation of XML::SAX and even gave quick instructions to move the directory and properly install libxml.

Here is the useful information:

References