Home » Linux » Archive by category "Fedora"

Duplicati – an alternative for Rackspace Cloud Files Sync

I’ve been using Rackspace Cloud Files Sync, a little piece of software I’ve written myself, for some years now. I use it to backup my photo’s and movies I’ve shot over the last decade or so. The thing I like about it is that it syncs your local folder with a Cloud Files container. When skipping content checksums it’s fairly fast to only process the changes. Aside from backing up files it can also restore them.

Whilst it still serves my need I get in trouble if or when Rackspace changes their Cloud Files API. Way back when I wrote the software I wrote it in BlitzMax with the MaxGUI module (using the excellent LogicGUI designer) and my own htbaapub.rackspacecloudfiles module. Sure, I can update my module that wraps the REST API but I no longer have an up to date BlitzMax with all the required modules set up on a PC. When I took Maximus offline the most convenient way to install BlitzMax modules and their dependencies disappeared. In short, it’ll be a big hassle to get a working setup again capable of compiling a new version of Rackspace Cloud Files Sync.

But today I found out about a software called Duplicati! Duplicati is backup software that can create and store backups to several kind of storage solutions such as Rackspace Cloud Files, Amazon S3, Windows Live SkyDrive, FTP, SSH and more. It can also encrypt your backups.

After a short test using Duplicati with Cloud Files I’ve at least found a nice alternative for when my Rackspace Cloud Files Sync stops working. The only thing I’m missing though is doing a full backup and then sync the changes like my software does, but it appears that this is already supported in the 2.0 preview release of Duplicati. So it’s likely that if or when my software stops working I can use the 2.0 release of Duplicati.

Using rsnapshot for daily PostgreSQL backups

Having done backups for MySQL using rsnapshot before I recently had to do the same thing for PostgreSQL. Turns out PostgreSQL has similar tools to do this and it’s actually quite easy to set it up.

First, assuming rsnapshot will run under the root user you’ll need to create a .pgpass file at /root/.pgpass that will hold the credentials that are required for setting up a connection with your database. The expected format is host:port:database:user:password, so for example:

localhost:*:mydbname:myusername:mypassword

With that in place create a shell script that will use this file and run the pg_dump program. Put it some place you can remember, e.g. /usr/local/bin/postgresql-backup.sh:

#!/bin/bash
export PGPASS=/root/.pgpass
pg_dump -w -h localhost -U myusername mydbname > postgresql-dump.sql
gzip postgresql-dump.sql

Again, just as with the using rsnapshot for daily MySQL backups article you need to configure rsnapshot.

Next is setting up /etc/rsnapshot.conf which is easy as well. At the end of this file you’ll find all the instructions of which directories to backup. Enter the next line. Do note that rsnapshot.conf uses a tab to separate values.

backup_script   /usr/local/bin/postgresql-backup.sh  postgresql/

To enable daily backups uncomment the next line:

#interval       hourly  6
interval        daily   7
#interval       weekly  4
#interval       monthly 3

To make rsnapshot run every day update /etc/cron.d/rsnapshot:

# 0 */4         * * *           root    /usr/bin/rsnapshot hourly
  30 3          * * *           root    /usr/bin/rsnapshot daily
# 0  3          * * 1           root    /usr/bin/rsnapshot weekly
# 30 2          1 * *           root    /usr/bin/rsnapshot monthly

Finally, try running rsnapshot. After it has run check your backup directory, which on Ubuntu 12.04 defaults to /.snapshots/. Be sure to mount /.snapshots/ on a separate drive. Because what use is it if your data drive contains your backup and decides to commit suicide?

$ sudo rsnapshot daily

Your PostgreSQL backup file should now be located at /.snapshots/daily.0/postgresql/postgresql-dump.sql. You can restore this file with the psql commandline utility.

Private Wiki – DokuWiki on Lighttpd

I had planned on setting up a private Wiki to use as a personal clipboard collection of useful snippets for some time now but never got around to it. This week I decided it was time to get it done and so I started searching for Wiki software. I ended up trying MediaWiki but ran into installation issues due to PHP’s session.save_handler not being set. After changing it I ran into more issues and with MediaWiki unable to store session data I couldn’t proceed. I’m not sure why MediaWiki requires this setting though as I run several WordPress websites and some other PHP code as well and they’re not having this issue.

Moving on I found out about DokuWiki which is really easy to install! Simply download the package, extract it and you’re done! It doesn’t require special database software such as MySQL – it stores pages on disk. Zero hassle and easy to use as well!

Since I’m not using Apache I can’t use .htaccess files. DokuWiki has a couple of folders which should not be exposed to the outside world. For Lighttpd my configuration looks like this:

$HTTP["host"] =~ "^wiki.example.com$" {
    server.document-root = "/home/example/wiki.example.com/httpdocs"
    # deny access completely to these
    $HTTP["url"] =~ "/(\.|_)ht" { url.access-deny = ( "" ) }
    $HTTP["url"] =~ "^" + "/(bin|data|inc|conf)/"  { url.access-deny = ( "" ) }
}

And you’re all set!

Monkey re-branded to Monkey X and comes with Desktop target

Monkey by Blitz Research Ltd has been re-branded to Monkey X. Monkey X focuses on multi-platform and multi-device game development. Monkey code translates to the language used by the platform. Javascript for HTML5 games for example and C#/XNA when targeting Xbox 360. Supported platforms are Windows, Mac OSX, Linux, Flash, HTML5, iOS, Android, WP7/8, Xbox 360 and more. Ouya as well!

With the re-branding also comes a new free version. Before, the free version only supported the HTML5 target but now also includes the desktop target. Other targets can be acquired by purchasing a Monkey X Pro license.

Now that the desktop target is freely available as well I think I’ll go give Monkey a try soon. I haven’t used BlitzMax in ages (and I consider it a dead end as well) and since Monkey is very similar to BlitzMax I don’t expect too much trouble to get adapted to it.

Firefox zoom reset at 125%

My new laptop has a 17″ full HD screen and I noticed that in Firefox websites would appear larger than they’re actually are. At first I thought I had accidentally zoomed in a bit but Firefox reported it was at 100%. The cause of this behavior is because Firefox looks at the pixel density of your screen and bases its optimal default zoom level on that.

If you want 100% zoom to be really 100% zoom just browse to about:config and search for layout.css.devPixelsPerPx and change its value to 1.0.