Server setup: Setting up a firewall

A firewall is a basic filter that can provide an efficient protection to your server by only allowing the traffic in and out as the rules of the firewall allows it. Setting up a firewall on a Ubuntu Linux server does not need to be complicated - in fact the one used in this example is called “uncomplicated firewall”. To get the firewall up and running make sure it’s installed through the package manager.

Fetching the most recent entry from a log-table

Sometimes there’s a need to keep a simple log in a database. A common format could be a table with a layout like this: log area (char) lognotice (char or text) logtime (timestamp when the event was logged). Fetching Fetching all log entries from a certain area is a simple matter of fetching by the area field, but when building a dashboard with the most recent entry from each area is slightly more complicated - the Query to fetch the data could typically look like this:

Moving the site

This site (and my other site in Danish) have been hosted on a cheap shared hosting site a few years. As shared hosting platforms go, the service and features at GigaHost was quite reasonable, but their servers seemed continuously overloaded and the site had a few issues from time to time. I’ve been moving everything from the shared hosting platform to the smallest available VPS server at DigitalOcean. Why the move?

Resizing vmdk harddisks for VirtualBox

VirtualBox is a free tool, which allows you to run virtual machines on a host computer. Using VirtualBox you can install Linux, Windows and other operating systems to play and experiment with. Start the process by closing virtualbox (I usually also dettach the virtual harddisk due to be resized). Go on to a shell and find the directory where the virual machines are located. If your initial harddisk was cloened from another virtualbox, you may get an error like this:

ftp on OSX Lion

While it really isn’t secure at any measure, ftp is a very useful way of moving files around. Apple’s OSX have a build-in basic ftp server, but in Lion (version 10.7) the user interface seems to have disappeared from the User interface. The servers is still available under the hood if you need it. To enable the ftp-server (the availability) enter this command in a terminal window: sudo launchctl load -w /System/Library/LaunchDaemons/ftp.