Mar 12 2009

Testing Ubuntu Jaunty and Ext4 WITHOUT Trashing Your Data

Tag: linux, software, ubuntuScott Wegner @ 11:00 am

Trash Thank YouUbuntu 9.04 “Jaunty Jackelope” is set for release in less than two months, and is currently in the “Alpha 6″ testing stage.  Arguably the hottest new feature is stable support for Linux’s new filesystem, ext4.  The new filesystem has been shown to have significant performance gains over any other Linux filesystem to date.  But think twice before you upgrade to ext4–many users have been reporting considerable data loss.  From a user’s comment:

This has happened to me twice, the first time erasing Firefox settings, and the second time erasing gnome-terminal settings. Both cases were caused by a kernel panic locking up the system. Also, both times the program whose settings were affected was in use during the kernel panic.

This has been a wide-spread problem, particularly for Ubuntu users testing the new Jaunty alpha releases.  It manifests itself after a system crash, where open files will simply be emptied and erased.  It is particularly prevalent in users’ settings files, such as those used for GNOME or KDE.  Fortunately, there cause of the bug is relatively well-known, as kernel developer Theodore Ts’o explains in his detailed comment:

OK, so enter ext4 and delayed allocation. With delayed allocation, we don’t allocate a location on disk for the data block right away. Since there is no location on disk, there is no place to write the data on a commit; but it also means that there is no security problem. It also results in a massive performance improvements; for example, if you create a scratch file, and then delete it 20 seconds later, it will probably never hit the disk. Unfortunately, the default VM tuning parameters, which can be controlled by /proc/sys/vm/dirty_expire_centiseconds and /proc/sys/vm/dirty_writeback_centiseconds, means that in practice, a newly created file won’t hit disk until about 45-150 seconds later, depending on how many dirty pages are in the page cache at the time. (This isn’t unique to ext4, by the way — any advanced filesystem which does delayed allocation, which includes xfs and the in the future, btrfs, will have the same issue.)

Essentially, the data for truncated and overwritten files is often cached in memory before actually hitting the disk, for performance reasons.  However, the file truncation doesn’t get cached, and if there is a system failure between the two operations, your files will simply be wiped clean with all previous and new data gone.  This happens frequently for desktop settings because hundreds of small hidden files are updated to maintain user preferences.  As a result, there is a relatively high probability that a truncation and rewrite operation could be happened at any time– including during a system failure.

By POSIX definition, this isn’t really a bug in ext4.  The state of a file after this type of crash isn’t clearly defined.  According to Theodore, it’s really a bug in the way desktop environments are writing their settings files:

[...] If your application is stupid, and has hundreds of dot files in your home directory, each one taking up a 4k disk block even though it is only storing 4 to 12 bytes of data in each singleton dot file, and you have to [write to disk] for each of your one hundred dot files — and worse yet, your application for some stupid, unknown reason is writing all of these hundred+ dot files every few seconds, then [writing to disk] will be very painful. But it is painful because the application is stupidly written — not for any fundamental filesystem fault. It’s like if you had a robot which was delivering mail to mail box numbers 1, 2, 3, 4, 5, and crossing the street for each mail box; on a busy road, this is unsafe, and the robot was getting run over when it kept on jaywalking — so you can tell the robot to only cross at crosswalks, when the “walk” light is on, which is safe, but slow — OR, you could rewrite the robot’s algorithsm so it delieveres the mail more intelligently (i.e., one side of the street, and then cross, safely at the crosswalk, and then do the other side of the street).

Regardless of what a permanant solution should include, there are a series of patches which are set to be included in the final Jaunty kernel to address this issue.  The patches are set to handle the crash situation similar to ext3– keeping the original version in-tact.  However, it comes at a price of performance.  Ext4 won’t be any slower than ext3, but the patch will negate many of the performance gains that ext4 previously achieved.

Once again, ext4 will likely be patched and fixed by the official Ubuntu Jaunty release.  However, it isn’t present in Jaunty Alpha 6, and hasn’t been pushed as an update yet (as of 3/12/09).  There is lengthy and ongoing discussion in the original bug report about possible long-term solutions.  In conclusion, be very careful if you choose to test out the new ext4 filesystem until it is patched.


Feb 26 2009

Linux For Computer Science Majors

Tag: linux, software, ubuntuScott Wegner @ 12:00 pm

TuxMy name is Scott Wegner, and I’m a Computer Science major at the University of Illinois, Urbana-Champaign.

I’ve had Linux installed as my primary OS for about 3 years, and as a computer science major, it’s certainly my environment of choice.  Not only does Linux deliver a rich desktop environment, but also the command-line and its vast number of utilities are indespensible for any sort of development.  It still suprises me, then, when I see other CS majors at my university who are so unfamiliar with Linux, and who cringe when any programming assignment requires Linux for one reason or another.  It got me thinking.

Our computer science department also has a number of computer labs with Linux machines, accessbile remotely and for physical access.  There are also a few Windows machines for those who prefer Visual Studio, although these machines are generally inferior when it comes to speed and stability.  So why do students still flock to them?  I think it’s because the courses at our university only give a terse introduction to Linux and the utilities that the course will require.  What we need is something that will really show students the ease and the power of Linux.  Maybe a 1-hour tutorial, perhaps a half-day workshop, or even a 1-credit hour introductory course.  Yes.

This wouldn’t be the sort of tutorial you see on the internet that praises Ubuntu for it’s robustness and claims that users should never need the terminal.  CS majors need to embrace the terminal and its utilities.  I asked earlier on identi.ca / twitter what people would talk about, and received a number of great responses.  There’s a whole list of tools that students need to be familiar with to really be productive.

  • grep, less, head, tail
  • vim, emacs
  • make
  • svn, cvs
  • ssh
  • man
  • awk,  sed
  • diff,  sdiff, colordiff

There’s also a lot of tools that would simply make their experience more pleasant, such as screen, rsync, latex, etc.  Having an understanding, or at least a crude familiarity of these utilities would certainly improve a student’s experience on projects which require them.  It may even convince them to try the faster Linux machines next time they visit the computer labs.

But how would one structure such a course?  I think a 1-hour weekly lab workshop would be the best setting.  The course could revolve around some simple in-class project that utilizes each of these tools.  Each week could introduce a new command, looking into it’s basic syntax and functionality, as well as providing links and resources to explore its advanced usage.  The majority of class time would be spent working on the project, trying each new command and using it to solve some basic problem.  The hands-on section would be crucial, as this is will instill the basic familiarity that students will hold with them for later courses.  I also think it would be useful to have extra time after class for “install-fests”.  This would give students the opportunity to install Linux at home and see if they would like it– either in a virtual machine, via Wubi, or on a physical drive.  They should be offered, optionally of course, once at the beginning of the semester, half-way through, and towards the end.

So what do you think– could something like this work?  Would it be helpful?  Have you heard of a university that provides something similar?  And what applications would you add to the list?  Let’s hear it in the comments.


Sep 22 2008

Purchase Non-Free (MP3, DVD) Media Codecs For Ubuntu Linux

Tag: deep thoughts, opinion, shopping, software, ubuntuScott Wegner @ 11:00 am

In this week’s Ubuntu Weekly Newsletter, there’s a link to an article on the Canonical Blog about their new offering of proprietary media codecs available for purchase.  Canonical has partnered with Fluendo and Cyberlink to give Ubuntu users a legal option for viewing and listening to their media.  This is similar to those who purchased a computer with Ubuntu preinstalled– generally there is a small premium factored in to have the media codecs pre-bundled.

This is a wise move by Canonical.  Giving their users a legal option for playing their media will encourage more software and companies to also invest in Ubuntu and all Linux media alike.  The announcement doesn’t quite make it clear, but it sounds like the Medibuntu repository will still be available with instructions for Ubuntu users to download similar codecs for free– illegally in many countries.  The adoption of the legal, non-free software will depend largely on how it is marketed inside Ubuntu.  That is, when you try to play an MP3 for the first time, will a dialog prompt you to purchase MP3 support, or offer an easier link to Medibuntu and the ubuntu-restricted-extras package?

One of the reasons that I moved to Ubuntu in the first place was so I could have software I wanted, free and legally.  It’s nice to finally have the option of legal media codecs as well.  What do you think of the announcement?  Will you pay the $40 for most non-free media codecs, or the additional $50 for DVD support?


Sep 20 2008

Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity

Tag: linux, open source, software, ubuntuScott Wegner @ 10:29 am

A couple weeks ago I bought a bluetooth adapter for my computer in hopes that I could easily backup my cellphone contacts on my computer.  I haven’t yet found a program to sync my cellphone data, but I did find a program to use your phone to lock and unlock your screen when you leave and come back to your desk.  With BlueProximity, your cellphone acts as a wireless “key” to your desktop.

Continue reading “Lock Down Your Ubuntu Computer with A Bluetooth Cellphone and BlueProximity”


Sep 15 2008

Gamers – More Than Just Nerds?

Tag: blogging, softwareBrian Wegner @ 7:45 pm

As I sat there on a Friday night, the only logical thing that came to mind to do was to play stupid 2D games with a couple of my closest friends: my brothers.  The time was 9:26 and I was happily downloading a new game just so I could have fun and be sociable.  Granted this is nothing new to me, because I am an avid gamer.  I tend to like the more interactive games such as first person shooters and MMORPG’s .  My favorite first person shooter game(s) are anything in the Half-Life series, mainly Counter Strike, Counter Strike: Source, and Day of Defeat.  For the MMORPG side of gamer life, I have a new addiction to a game called Minions of Mirth (MoM) that my brother downloaded and bought.  For all you people out there that don’t know what MMORPG stands for, it is an acronym for Massively Multiplayer Online Role Playing Game.  Games like this include Everquest, Asheron’s Call, Minions of Mirth, Final Fantasy (series), and World of Warcraft (Warcrap in my opinion).

My gaming career goes back quite far; I’m talking back into the first stages of apple computers, back with the computer with green screens, using “floppy disks” that were actually floppy and the size of your average sandwich you’re going to have for lunch.  Granted these games I started out with were all educational and not really for personal amusement, but trust me, it wouldn’t take many more years before I started to find games that I really enjoyed.

As you could probably tell, I was never really one to play games on a game system all day because that just didn’t appeal to me.  I really liked the way a PC felt and played games.  I want to say my gaming really started to emerge once Windows ‘95 came out.  I started out with the cheesy solitaire, minesweeper, and a few games of free cell (even though I still to this day can’t figure out how to play that game).  From there I was introduced to games such as Need For Speed and Doom, and that’s when my career really took off.  I progressed into more strategy based games like Age of Empires, Myst, and Tribes.  From there I moved onto the MMORPG’s and the first person shooters.

After that stage my love for gaming focused more on the first person shooters and the MMORPG’s because I loved the fact that you can interact with people from all around the world who had the same passion as you; to grab a dessert eagle, semi-automatic P-90, 2 flash grenades, an HE grenade, and just storm up the middle to surprise the terrorists and keep them from planting the bomb at bomb site A.  (For those of you who didn’t figure it out, the game described above is Half-Life: Counter Strike).

I don’t really know where my gaming career will lead me next, all I know is right now I feel as if I have a second set of friends that I meet up with every day, all around the world.


Sep 15 2008

Easy Subversion GUI for Nautilus and Ubuntu

Tag: how-to, software, ubuntuScott Wegner @ 4:47 pm

Just about every software project uses some sort of versioning control system, and subversion is arguably the most popular tool.  Having your files versioned and backed up in a central repository is essential.  I’ve written about how to set up your own subversion repository, but you can go a step further and install a graphical interface to use subversion right within Nautilus.

Installing and setting up the subversion GUI is as simple as three commands.

  1. Install the nautilus-script-collection-svn package:
    sudo aptitude install nautilus-script-collection-svn
  2. Enable the plugin (this is required to access the plugin from nautilus):
    nautilus-script-manager enable Subversion
  3. Restart Nautilus:
    killall nautilus

Afterwards, Nautilus will have a new entry in the context menu when you right click.  You can now access most basic subversion commands without touching a terminal.

The interface isn’t quite as pretty as some Windows clients, such as TortoiseSVN.  However, it is still a nice alternative for users who prefer a GUI and only need basic functionality.  There doesn’t seem to be any support for merges, and other commands will use the default parameters.


Sep 12 2008

Organize Your ToDo List in Ubuntu with Remember The Milk and Tasque

Tag: how-to, linux, open source, productivity, software, ubuntuScott Wegner @ 8:22 pm

I am a big fan of the previously mentioned Remember The Milk productivity webapp.  It does one thing– manages your Todo list– and it does it very well.  Remember The Milk offers a clean web interface, as well as integration inside Gmail, Google Calendar, and even has an iPhone app.  The only thing that was missing for me, though, was a simple interface for the Linux desktop.  Enter Tasque.

Continue reading “Organize Your ToDo List in Ubuntu with Remember The Milk and Tasque”


Jul 03 2008

Introducing: Pwdhash Sharp 0.8.4

Tag: open source, software, ubuntuScott Wegner @ 4:50 pm

I’ve started another pet project for the summer, and I believe it’s ready for a stable release.  The program is called Pwdhash Sharp, and it’s a C#, Gtk-based desktop implementation of the PwdHash password-generator, written for Ubuntu.   We’ve written about PwdHash before, but if you’re not familiar:

PwdHash automatically replaces the contents of [site address and password] fields with a one-way hash of the pair (password, domain-name). As a result, the site only sees a domain-specific hash of the password, as opposed to the password itself. A break-in at a low security site exposes password hashes rather than an actual password. We emphasize that the hash function we use is public and can be computed on any machine which enables users to login to their web accounts from any machine in the world. Hashing is done using a Pseudo Random Function (PRF).

Now with Pwdhash Sharp, you get the same functionality integrated into your desktop.  When I first started writing this application, the PwdHash Firefox extention wasn’t compatible with Firefox 3 (although they’ve updated the addon since then), so that was another reason I needed an alternative.  Pwdhash Sharp is also convenient for non-browser applications which require a password– now you can easily use strong passwords for them as well.

Pwdhash Sharp 0.8.4 is the fourth version released, and is now relatively stable.  Some of the features include:

  • Passwords exactly match those generated by PwdHash, so they are interchangable.
  • Native GTK window and icons.
  • Create and retrieve passwords for web- or desktop-based applications.
  • Minimize to tray for convenient access when you need it.

There are two ways to download Pwdhash Sharp 0.8.4.  You can either download the .deb for your platform from the release page, or you can get uploads via my personal PPA.  The benefits of the PPA is that you will receive automatic updates of pwdhash-sharp as they occur, just like all other programs in Ubuntu.  To add it:

  • In the panel, select System > Administration > Software Sources
  • Select the “Third-Party Software” tab, and “Add…” to add a new entry.  In the popup, enter the line:
deb http://ppa.launchpad.net/swegner/ubuntu hardy main
  • Close the software sources manager, and allow the repository cache to reload.  Now, you can install pwdhash-sharp from your favorite package manager.  On the command line:
sudo aptitude install pwdhash-sharp

Once installed, you can launch it from the “Accessories” submenu.  Use it just like the form on the pwdhash.com website.

I’m pretty happy with the project so far, but it’s by no means complete.  It’s been a learning experience in packaging for Ubuntu, as well as developing using Mono and GtkSharp.  There’s still a few bugs to work out, and some features that I’d like to add.  Namely:

  • For some reason, Pwdhash Sharp can’t be launched from within Gnome Do.  Anybody have this issue?
  • I’d like to add some preferences to automatically copy generated passwords to the clipboard.  Also, it might be useful to automatically minimize, and “forget” the previous site password, for security reasons.
  • Also, “man” pages aren’t generated correctly, but this seems to be a packaging issue.
  • It would also be nice to port to Windows, and should be relatively easy since it’s in C#.  I could either do a Gtk port, or use a native Windows interface.  Anybody interested in helping?

So, give Pwdhash Sharp a try, and let me know what you think.  I’m open to suggestions and feature requests.

PS: The PwdHash algorithm generates only pseudo-random passwords, which could be decrypted, given at least half of the key.  Can anybody figure out the password in the screenshot?


Jun 25 2008

How To: Host a Subversion Repository in Ubuntu Hardy

Tag: deep thoughts, diy, food, how-to, linux, open source, review, software, ubuntuScott Wegner @ 10:46 pm

Have you ever wanted to set up a subversion repository on your home computer? Whether it be for a new software project, versioning your personal documents, or any other reason, there are many benefits to using version control. Some free websites that will host your project for you, such as SourceForge or Google Code, but it’s often necessary to have a little bit more control.

I set up a subversion repository for a new project the other day, and the process was relatively painless. I’m using a standard Ubuntu Hardy Heron 8.04 desktop setup, with OpenDNS and DD-WRT for port-forwarding, and without an Apache web server. Keep reading to host your own subversion repository server.

Continue reading “How To: Host a Subversion Repository in Ubuntu Hardy”


Jun 18 2008

Did You Download Firefox 3? Show it Off!

Tag: Firefox, softwareKyle Wegner @ 7:45 pm

firefox 3 download day certificate kyle wegnerMany of us at automaticable downloaded the all-new Firefox 3 we helped to announce yesterday.  For those of you that haven’t, you can still install the fastest browser in the world by clicking here.  Anyone who did download on June 17th, however, has something to be proud of. You were 1 of more than 8 million downloads that occurred, easily placing Firefox in the Guinness Book of World Records for the single day download record.

Anyone who participated (ok, and wannabe’s too) can get an official personalized Firefox 3 download day certificate! As you can see, I’ve already downloaded mine and am proudly displaying it here on automaticable. Get yours now!


Next Page »