linux

rsnapshot vs rdiff-backup

Some time ago I was researching open source backup tools and the available solutions were narrowed down to rsnapshot and rdiff-backup. I did kind of a benchmarking between both solutions. I was (and still am) interested mainly in the performance aspect of the backup tool, which of the two was more efficient. I did some tests and the goal of this post is to share the result.

I wont be getting into the differences between them. There are lots of great articles online that already do that and also a great book by O’Reilly called “Backup and Reovery” that also convers both these solutions.

The idea
Start with a 5Gb MySQL database that would grow between backups. Each growth would add random data to tables and new tables (new files). Rsnapshot would do new hourlys and rdiff-backup would do incremental backups once the first one was made. All backups would be run manually so that no simultaneous actions would happen.

More

Linux: delete files for a given year

After a short conversation with my friend and colleague Carlos Limpinho about how to delete files from a given year within a directory when ls doesn’t output the year for the modification date, I suggested the following solution based on a bash statement (example for 2010):

for f in *; do if [ `stat --format %y $f|cut -d "-" -f1` -eq 2010 ]; then rm $f; fi; done

Another possible solution would be to use find but the time options require one to calculate the days and make a range.
Feel free to comment and share if you have other solutions.

Maildir – Resending emails via formail and procmail

I’m sharing this because someone might find it as being useful info…

Earlier today I had to resend some emails from a users Maildir folder to an external email account. The idea is to forward the existing email in a certain Maildir folder.

To do this I used formail and procmail.

I added some basic settings to the .procmailrc so that all filtered email will be forwarded to the email I want. I looks like this:

MAILDIR=$HOME/Maildir

:0
! user@example.com

From inside the folder (Maildir folder) that contains the email that I wanted to send, I executed the command:

grep -v ^Delivered-To FILE | formail -ds /usr/bin/procmail

The grep -v ^Delivered-To instead of a cat is done to remove the Delivered-To line in the begining of any line.

And what if there are thousands of emails in the folder?

for file in *; do grep -v ^Delivered-To $file | formail -ds /usr/bin/procmail; 
done

There are many tweaks that can be applied to this solution, I just didn’t need them.

I moved on to Fedora

It happened. After years of Debian and Ubuntu I changed my personal laptop’s Linux distribution to Fedora.

Why I changed to Fedora

  • GNOME 3! GNOME 3′s integration in Fedora 15 (beta) was the best around, in my humble opinion. The Ubuntu + GNOME 3 ppa wasn’t a satisfying solution;
  • I needed the challenge. For sure that I can still learn with a debian based system but I have much more to learn with a rpm based system at the moment;
  • Fedora package upstream;
  • It wasn’t because Ubuntu is a bad Linux distribution. I still think it’s great, I still use it on my work laptop and I will still advise people to use it.

Two days have passed since I changed to Fedora and I can say that yum doesn’t let me miss apt-get. It seams like a very complete and robust package manager.

In Ubuntu things were kind of automatic, I knew which files I had to tweak after each install, how to add repositories, etc.

Things I usually do after a fresh install:

  • Update the system;
  • Install the usual apps;
  • Tweak the system to my needs.

Here’s a detailed guide of what I did in Fedora, might come in handy for some other newb like me:

  • System update using Software Update (Apps, System Tools in GNOME Shell);
  • Install extra repositories (Free and Nonfree);
    • RPM Fusion
    • Install the downloaded rpm’s (rpm -ivh FILE.rpm)
  • I use Chromium (Google Chrome) so I installed it next. Followed the guide available in the Fedora Project wiki;
  • I also followed the guide available in the wiki to install Flash Player;
    • The page has lots of info, so for you lazy guys on a x86_64 system, follow this link
  • Installing the equivalent to ubuntu-restricted-extras package;
    • I followed the info available in this page (it’s in Portuguese)
    • Getting the fonts right. Specially in the browser.
      • yum localinstall http://fedora.missingbox.co.nz/core-fonts.rpm –nogpgcheck
      • yum install freetype-freeworld
      • I also had to add to .fonts.conf (~/.fonts.conf) some lines. Because it’s a XML file, it’s easier for you to download it: .fonts.conf
  • Installed all the software I normally use…

And that was all. Everything after was absolutely normal…

My GNOME 3 experience on Ubuntu 11.04

I’m addicted to gnome-shell!

A week has passed since I installed GNOME 3 on Ubuntu 11.04 “Natty Narwhal”, from the official GNOME 3 PPA.

I remember thinking something like “Looks nice, feels good but lots of things are missing… going back to classic GNOME…” but for some unexplained reason I didn’t make the purge and kept using GNOME 3 and the mighty gnome-shell.

Here’s my GNOME 3 sceeen shot:

 

 

 

 

 

 

 

This isn’t a GNOME 3 review, Ars Technica already made one that you can read here. It’s just my two cents about some things.

Problems, bugs, weird stuff and a whish list

  • Ubuntu 11.04 doesn’t have official GNOME 3 support. You have to use the PPA. I almost went Fedora because of this. Still thinking about that…
  • The window decorator couldn’t be more ugly, but I saw lots of screen shots around the web with a great looking interface. Why wasn’t mine good looking?! Seams that the problem was that the theme (Adwaita) wasn’t there. After a quick search, I found out that the theme was in a package called gnome-themes-standard that wasn’t in the GNOME 3 dependency list and that I couldn’t install because the package itself is broken. The solution was to extract the contents of the package and place the Awaita theme where it should be (/usr/share/themes) manually.
  • I also remember thinking “where the *FWORD* are my desktop icons?!” and after taking after a deep breath I read all about the philosophy of GNOME 3/gnome-shell and it kind of made some sense, although I am/was too used to having stuff all around my desktop. This was only the first weird thing I had to adapt to.
  • There are no applets in gnome-shell, the nice panel (top bar) isn’t customizable. I have a trillion passwords to memorize and I have been using revelation until now (GNOME 2) because of the nice applet that it has. I used it exhaustively because it allowed me to search within my passwords very quickly. I really miss that applet.
  • The notifications changed. In a general way I like the new notification system, it’s cool and really doesn’t bother you when your’re working and it’s a complete WIN to be able to check the notifications some time after they occurred. Yet, another habit, I use pidgin as my default IM client and I want to be able to stick the icon somewhere visible (top bar) and see when the icon changes it’s status. I liked the way that worked out in GNOME 2. It’s just weired not to have it there now.
  • Keyboard has lot’s of shortcuts. WIN! But hey some of us have razors, mx 5xx or some other mouse that has more buttons than we have fingers. There should be mouse shortcuts as well! With compiz I used two useful shortcuts within the desktop wall. I used the two buttons placed on the left side of my mouse to change to the previous and to the next workspace. This is another thing I really miss.
  • Nautilus changed the shortcuts. Now I have to press two keys to delete a file. I liked it better when I only had to press del for that.
  • Mutter breaks transparency in non-maximized windows, like gnome-terminal that I use allot. It’s a known bug but still no solution.
  • As well as some other users, I haven’t figured out how to remove the unnecessary accessibility menu from the top bar.
  • Another “philosophy” issue is that by default window controls only have the close button. No minimize or maximize. That’s because you can maximize windows with a double-click on the title bar and because you don’t have anything to see (besides your wallpaper) on your desktop, so you don’t need to minimize windows, only switch between them. That was weired at first and I added both missing controls, but sincerely after a week of using gnome-shell I don’t use them at all.
  • Lack of customization. This is a problem. I like to tweak my desktop and so do other users. I think future success depends on this issue.
  • Places should also have the option to be added as a Favorite. I have the sensation that  nautilus alone isn’t enough.

Things that keep me hooked in!

  • The coolness factor! I don’t know why neither can I explain it… but it just feels right to use gnome-shell! Almost as if it was cool to use it and if you don’t.. you’re not just cool anymore.
  • Gnome-shell. I’m still adapting but I like the changes.
  • The application switcher.
  • The workspace management is just awesome. The way they extend one after another or how they are removed when no longer necessary is just how they should always have worked.
  • I use a laptop + a LCD screen at home. The second screen, the LCD, doesn’t change when I switch workspaces. When I switch workspaces only the laptop screen workspace changes. The LCD workspace is always the same. I don’t really know if this is the default behavior, but I love this. I can put my “always showing apps” in the LCD “always showing” workspace and move throe the laptop workspaces.

  • I’m more focused on my work. Congratulations to  the GNOME 3 team because this is one of gnome-shell’s objectives and I really feel it.

I’ll keep posting my GNOME3 experience and who knows, some extensions of my own.

I am GNOME