Category: How to

In PHP, sessions can keep track of authenticated in users. They are an essential building block in today's websites with big communities and a lot of user activity. Without sessions, everyone would be an anonymous visitor. In system terms, PHP sessions are little files, stored on the server's disk. But on high traffic sites, the disk I/O involved, and not being able to share sessions between multiple webservers make this default system far from ideal. This is how to enhance PHP session management in terms of performance and shareability.

I used to use Dean Edwards Javascript Packer a lot to compress my Javascript sources. Libraries of 100kB could easily shrink to 30kB and that saves load times & bandwidth. A good writeup by Julien Lecompte made me realize that there were better ways.

Sometimes when digging real deep into Windows like I recently had to, you need to have the Windows SID (Security Identifier) of a local user. I wasn't able to find any standard way of obtaining this info, so I wrote this little VBScript. Might help some people, might not. Putting this online anyway ;)

Let's say you want your local restricted users to be able to restart specific services. On linux you'd probably type visudo. In Windows I found, you have to dig a little deeper into the system and really do your research. I needed several sites, programs and articles. So I thought it might be useful to others if I'd bundle all the required information in one place. Here it is.

Recently I had to migrate all MySQL databases from one server to another. This was a one time only operation, so setting up replication wasn't an option. And restoring a backup on the new server involved more downtime than strictly necessary. I figured the most ideal way would be to dump the active MySQL directly into the new MySQL instance. And that's what I did.

Running compiz-fusion for some time, one thing started to annoy me. Snapping windows. The first thing I obviously looked for was the Snapping Windows Plugin. But that was already disabled. I'm blogging the setting that controls this behavior because it took me some time to find it, I think other people may find it contra productive as well.

In Ubuntu Feisty I've been using compiz-fusion from Treviño’s Ubuntu Repository in combination with a nVidia driver provided by Envy like in this how-to. Running those cutting edge Feisty versions allowed me to have all the nice features that were being developed and lose some bugs that persisted in stable versions, like black windows & strange borders.

But two months ago I upgraded to Gutsy and you will be happy to know that Ubuntu Gutsy has got every awesome feature & bugfix in it's ...


I often hear about people who want to upgrade their version of Ubuntu with tools like apt-get, but if you run a desktop version of Ubuntu, there is a much better tool called update-manager. There are a lot of ways to upgrade Ubuntu. But this one is the best.

It's no secret I like Ubuntu the best. But what strikes me as odd, is that it does not come standard with a good tool to change the display settings. Sure, you can change the Screen Resolution, but what about cloning to another device, extending the desktop to a second screen, changing the driver, or adjusting the refresh rates to enable more resolutions? There currently is no graphical way to do this in GNOME, so for this you had to manually change the X config file, or run a third party tool like nvidia-settings. But now I found a great GTK tool that can do it for you.

Recently I've seen a lot of screencasts in the Planet Ubuntu RSS feed. A screencast is an embeded flash video of your desktop, often used in tutorials instead of screenshots. I wondered if I could make these online flash videos myself; turns out, it's pretty easy! So in this article I will cover how to install the video capturing tool, how to use it, how to convert the video to a flash video (flv) file, and finally how to embed a flash player in your site just like YouTube. Create your own screencasts in 5 easy steps!

A couple of years ago when everyone still had giant CRT monitors, resolutions of 1600x1200 were pretty common. Nowadays however 19" TFT monitors often cannot scale higher than 1280x1024. So how can we still fit more on one screen? DPI can help!

With SSH you can securely login to any Linux server and execute commands remotely. You can even use SSH to transfer and synchronize files from one server to another. Automating these tasks can make your life easier, but normally SSH prevents that because it requires you to login every time. Well, not anymore, in this article I will show you how to connect to SSH without a password.

Synchronizing files from one server to another is quite awesome. You can use it for backups, for keeping web servers in sync, and much more. It's fast and it doesn't take up as much bandwidth as normal copying would. And the best thing is, it can be done with only 1 command. Welcome to the wonderful world of rsync.

Deleting a file or reformatting a disk does not destroy your sensitive data. The data can easily be undeleted. That's a good thing if you accidentally throw something away, but what if your trying to destroy financial data, bank account passwords, or classified company information. What if you want to clean your computer before selling it for instance?

It's always a good idea to backup important data. Your files and settings can easily be archived. But how can you backup & restore all applications that you've installed over the last couple of years? Here's an easy trick that works for both desktops & servers, and that can also be used to synchronize installed packages in a web cluster, making all the servers run the same software.

Recently two of my articles reached the Digg frontpage at the same day. My web server isn't state of the art and it had to handle gigantic amounts of traffic. But still it served pages to visitors swiftly thanks to a lot of optimizations. This is how you can prevent heavy traffic from killing your server.

CDs and DVDs don't have the eternal life, so you might want to back them up as ISO images. All the files and properties of the original disc, stored in a single file. You can also create ISO images and store them on your network for easy distribution of software installations. Here's how to create and mount ISO images on Linux.

Making sure your system is up to date is a key attribute to it's security. Furthermore Ubuntu releases updates pretty often and you probably don't want to miss out on added stability and features. You could run updated manually, but why not schedule the updates in the background to make sure you are always running the latest stable versions, without ever having to worry about it.

If you've got a website that's heavy on your web server, you might want to run some processes like generating thumbnails or enriching data in the background. This way it can not interfere with the user interface. Linux has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals. You could also use it to automatically create backups, synchronize files, schedule updates, and much more. Welcome to the wonderful world of crontab.

Warning. This article is meant for Ubuntu Feisty only and is therefore deprecated! Compiz-fusion comes standard in more recent Ubuntu versions, so don't use this article anymore! I would have taken this article offline if it wasn't for the fact that there are still some Feisty users out there who find this useful. If you're in the midst of upgrading from Feisty to Gutsy, read howto upgrade to Ubuntu Gutsy without breaking compiz-fusion!

Since 2005 there has been an immense increase in brute force SSH attacks and though Linux is pretty secure by default, it does not stop evil programs from indefinitely trying to login with different passwords. Without proper protection your server is a sitting duck waiting for a bot to guess the right combination and hit the jackpot. But with just 2 commands we can stop that.

Everyone knows that RAM is so much faster than a hard disk. To illustrate, while a modern SATA disk has peak transfer rates of 375 MB/s, modern RAM can do a mind blowing 12.500 MB/s! Normally only the system itself makes use of this ultra fast storage, but we can also access this space directly. And that opens a great window of opportunity.

If you're running Squid to cache your website, you can use an htaccess file to control what kind of files should be cached, and for how long.

Let's say your site is becoming a big success and as a result it's becoming slower and slower. There are several things you do without buying additional hardware.

You want your website to be as safe as possible. So you'll typically want Open Basedir and Safe Mode to be on. When you're in a shared hosting environment, you'll find that any server administrator with a good sense of security will also have these restrictions in place. However security pretty much always limits functionality and this case is no different. Because what if you are caged in a restricted environment, and you would still like to use shared libraries like the ones provided by PEAR?

I recently had to install a couple of squid servers to act as reverse proxies for a webcluster. You can teach the squid server to stand in between in the end users and the webservers, and to store all the static content ( .jpg .flv .css .htm for example ) in the RAM. This saves a lot of I/O and bandwidth on the webservers, and it can really speeds up a site. And the end of the road the webservers' load dropped with 92%. But before all this worked, I had to run through a massive config file and since the squid config file is their manual at the same time, it's about 5000 lines long. So I had to find out a way to filter only the important settings from the config file.

Ever wanted to change the crontab of a server, but got an editor on screen that you're totally unfamiliar with? There are a lot of causes for this annoyance, but one is that somebody recently installed or used midnight commander (mc) which for whatever reason seams to overrule your session's default editor.

Readable URLs are nice. A well made website will have a logical layout, with intelligent folder and file names, and as few technical details as possible. In the most well designed sites, readers can guess at filenames with a high level of success. Clean URLs are great because they.