Archive for the ‘Articles’ Category

How to build a chroot jail environment for CentOS

A chroot environment is simply a directory – inside which you can find a file system hierarchy exactly like your original operating system. You can then use the UNIX chroot command to open a shell in that directory so that command running under that shell see only the chroot environment and can’t mess up your system. This is very useful for many different reasons – for example if you want to build some software packages and you don’t want their build dependencies to pollute your real system.

Building a chroot environment is not difficult at all using the right tools, and YUM – the CentOS installation tool – has what you need.

(more…)

Another Mac-styled update for Ubuntu – Window buttons to the left!

As we’ve know for quite a long time now, Ubuntu is aiming to look and behave as much like Mac as possible1 – we’ve already seen the Growl-like on screen notifications (which are rather cool) and here is the next major user interface change:

In Ubuntu 10.04 – due to be released on late April of this year – the window buttons (close, maximize,minimize) will be on the left side of the window! See here for the branding screenshots.

(more…)

  1. within 2 years Mark Shuttleworth said in 2008, so he’s clearly running out of time []

Upgrading CentOS 5 to Fedora 12

Its time to update an old post about updates: Fedora 7 is again rather old, with the current Fedora being at 12, and 13 is right around the corner, but We’re still with CentOS 5 (I hear that RedHat is deep into beta with their next version – 6 but when it comes out is anyone’s guess).

In the mean time, if you want to run something a bit more modern maybe you’d want to upgrade your CentOS installation to Fedora 12 which can be considered pretty stable after a few months on the market. The reasons for the change may be numerous – maybe you need to run the latest subversion (with better merge tracking) or a new version of Ruby. Either way, if upgrading from CentOS 5 to Fedora 7 was a pain, guess how it is more the two years later?

Before we get to the action itself, I would be remiss if I would not recommend you to reconsider what you are about to do – this is a challenging exercise for many system admins and can sometimes end badly. I do not guarantee anything and if it breaks you get to keep both parts. Often its much faster and easier to just go to the server, stick a Fedora 12 DVD in the slot, reboot and let the DVD upgrade your system1. That being said, this is fun if you’re into that sort of thing, so if you’re still with me, lets dive in!

(more…)

  1. another safer options would be to upgrade to Fedora 7 using the instruction in the previous article linked above, and then use Fedora’s preupgrade tool to upgrade to Fedora 8, then to fedora 10, and from there to Fedora 12, though this procedure will also require physical access to the machine and multiple reboots and multiple long downloads []

15 years in the making

One of the most annoying issues with Linux’s graphical system (and any UN*X), is that if you have some keys setup for switching the keyboard layout – when using two or more keyboard layouts, such as for writing English and Hebrew – then that key combination cannot be used in any other keyboard shortcut.

Its most annoyingly present when setting the keyboard layout switching command to ALT+SHIFT (like in MS-Windows), then you can’t do any keyboard shortcut that has ALT+SHIFT in it – such as ALT+SHIFT+TAB to move to the previous window.

Well, finally there is a solution! As detailed in FreeDesktop.org’s Bugzilla and Ubuntu’s Launchpad , and thanks to Ilya Murav’jov we now have a patch to solve this ancient X11 problem.

(more…)

Script day: grep in jar (or zip) files

Here is another script I wrote for work and I thought it will be interesting enough to share:

Say you want to check which JAR files (or ZIP files for that matter, as Java ARchive files are just ZIP files with a different extension) contain files that contain some text. grep is the obvious answer, but how to grep files in JARs?

(more…)

Why HTML access keys do not work in Firefox Linux

Well, they don’t work for me – haven’t worked since Firefox 2, I think.

If you’re not sure what I’m talking about then its about the ability of web pages to define keyboard shortcuts to access and enable features on the web page using the keyboard instead of the mouse. Common actions are to focus text edit boxes or to trigger links directly.

(more…)

Script day – Shutting down multiple servers at once

A system administrator in my company recently approached me with a problem – how to shutdown multiple Linux servers at the same time from a central location. Apparently this is something that people in the MS-Windows world use all kinds of applications, like the Remote Shutdown Tool from Microsoft (though I don’t understand how they handle the authentication – this tools doesn’t seem to require any authentication so it appears that any person with network access can shutdown any computer).

Anyway, apparently searching the web for “Linux remote shutdown” yields no useful results (or so I’ve been told), but frankly – when you have standard UN*X tools at your fingertips, a remote shutdown tool is simply typing ssh root@server shutdown -r now at your local console. But still, for people who want a “tool” – read on.

(more…)

More Internet Explorer Bugs

[Update: initially I thought this problem was limited to IE7 and earlier, I was wrong and it also happens in Internet Explorer 8. Kind of destroys what ever expectations I’ve had remaining for IE8]

Although Internet Explorer 8 was already released1 most users are going to stick to previous versions – I know this for a fact as even though Internet Explorer 7 is already more than a couple of years on the market it still only has slightly better then 50% of the Internet Explorer market (not including other browsers).

That being said, its always “fun” finding more Internet Explorer bugs, something which the web developer I’m working with is proficient in (which she isn’t really doing on purpose – I’m not sure if it counts in her favor or not 🙂 ), so here is the latest one she stumbled upon2: (more…)

  1. and it boasts a superior rendering engine – which is almost on par with  Firefox 3: it breaks horribly in the WordPress edit post dialog – its the first serious rendering problem I’ve seen with IE8 []
  2. I haven’t documented the several previous ones we encountered – I might do so in the future []

Cloning VirtualBox VM Snapshots

This is another “how to” tech article, anyone who is not interested in such things may stop reading now.

VirtualBox is a great virtualization software (hypervisor as the lingo currently goes) – I believe it matches up nicely against the current VMWare Workstation line and they offer both an open source version which is free for any use as well as a commercial version (with some added features such as SATA support) that is free for personal use.

VirtualBox allows you to take snapshots of the current VM state so that you can safely return to a previous state of your VM if you messed something up (for example – installed too much software on your Windows XP VM). Unfortunately, unlike what the VirtualBox UI will have you think, the snapshot features allows you to take progressive snapshots but you can’t fork your snapshot tree – you can’t create branches off old snapshots. Snapshots which are not current can be either discarded (have their state merged into another state) or reverted too (discard all the newest data and return to the old state).
old state

Additionally, you can’t copy (clone) VMs with snapshots except copying the oldest state1.

(more…)

  1. which is most often not what you want. If you don’t mind discarding all of the old snapshots, you can clone the current VMs state using the method described in this VirtualBox forum thread []

Live upgrade of Fedora 8 to Fedora 9

As noted below, Fedora 9 came out recently, and I think its time my work computer would get a “brain transplant”. I can’t have a lot of downtime on this machine – its the one I do most of my work on, so this upgrade needs to be a “live updated” – I can’t afford the time to shut it down, load an installation of even a live CD (that doesn’t have my environment) and wait until it installs.

(more…)