Enable Java applets in Firefox on Linux

You can very easy enable Java applets in FireFox on Linux. In my case, I use Fedora Core 10 and FireFox version 3. Here are steps how to enable Java applets in FireFox …

The rpm command

rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. This is the first sentence in the long rpm manual that lacks examples. On the other hand, I will try to write nothing more but the rpm examples.

Log PHP errors to the separate file

In this post you will find how to configure PHP to log errors and warnings to the separate log file – error_php. You can place error_php wherever you want, but I will suggest to choose the /tmp directory …

Categories PHP

Styling Apache directory listings

In this post you will find how to make stylish listing generated by the Apache server. This is not just another CSS solution. The trick is in configuring Apache to generate XML directory list and to use browser (IE, FF, Opera, Safari …) to transform XML to the HTML. You will have full freedom to modify and style auto generated directory listings.

Create XML from directory list with Apache

In Apache world, the index of a directory can come from one of two sources – a file written by the user, typically called index.html or a listing generated by the server. If you enable automatic index generation (with Options +Indexes), Apache will create a HTML directory list for the URL without index page. With a few lines in httpd.conf, directory list can become a XML document.

Hide parent directory in Apache

Apache can generate directory indexes, automatically, similar to the Unix ls command or the Win32 dir shell command. With default settings, parent directory will be displayed too. If you want to hide parent directory from the directory list, use IndexIgnore directive.

How to add a new MySQL slave

This post explains how to add a new slave to the existing MySQL replication. New slave server can be added to the MySQL replication without stopping master or shutting down existing slave server. You will have to temporarily stop replication on the slave server in order to take the current data snapshot.

The find command

The “find” command is very useful. It can search the entire file system for one or more files that you specify to look for. With the “find” command, not only are you able to locate files, but you can also perform actions on the files it finds like move, delete, rename …

MySQL replication recovery

MySQL replication can stop if slave fails to execute SQL statement from the binary log. From that moment, slave prints last error and waits for replication recovery. If master has consistent snapshot, then is only necessary to re-point slave to the new master position. It can be done with “change master to” or “sql_slave_skip_counter”.

How to find files in Linux

Files in Linux can be searched with “find” and “locate” command. “Find” exists very long, while “locate” is a new Linux feature. The main difference between them is the way they work – “locate” uses database to search files, while “find” searches for files in a directory hierarchy.

Date shift in JavaScript

Date shift in JavaScript can be done by counting days of the month and thinking of 28 or 29 days in February. Don’t forget the year. This is a long and complicated algorithm. I suggest a simpler solution. Transform date to the number of milliseconds, and make easy arithmetic with integers. After addition and subtraction, create date from the milliseconds.

JavaScript fade menu

You can find a lot examples of JavaScript fade menu, but my goal was to make it short and simple – only 15 lines (if you don’t count comment lines). First JavaScript function will initialize event listeners, while second will recursively change opacity level. It should work on FireFox and Internet Explorer.