Category Archives: Red Hat Enterprise Linux

AES Zip archives with 7zip 7za on RHEL 6

Littleplanet-Versuch picture

Mortgage Madness

I refinanced again–once again with no closing costs while sacrificing some on the rate.  Interest rates are again at historic lows which meant I had to take avantage of two great opportunities–lowering my rate by three quarters of a percentage and shortening the length of my loan to a 15 year term.  With no out of pocket costs involved (or closing costs financed), there was nothing to lose.

The upside is that I keep making the same payment I’ve always made and more money goes to driving the principle balance to zero because of the lower rate and shorter duration of the loan.  Two great sites I found for following rates and the mortgage process are:

Collecting and Sending all those statements

Usually I rely on my tried and true fax machine, but this time I decided it was time to join the rest of the world and managed to collect everything as PDFs. After gathering them all in a folder I realized I didn’t want to send them unencrypted over the wire.

Next I searched for a way to zip all the files and lock the archive with a password that couldn’t easily be hacked and read on Windows. From what I could find on Google, the regular linux zip password protected algorithm was not secure, however encrypting with AES was.

I discovered that 7zip could do strong AES encryption and store in a zip format–presumably most Windows users (and my loan officer) would be able to read the archive, however the instructions I found to do so were horrible.

After google failed me I turned to the powerhouse of Red Hat engineers on an internal list… and in less than 24 hours I had a solid answer–thank you Norman Mark St. Laurent!  There is very little coherent information on Google about using 7zip with RHEL–the package names are confusing, the man pages are incomplete, and none of the examples I found for other platforms worked.  This post aims to remedy that.

Creating an AES encrypted archive with RHEL 6 and 7zip

1) Make sure EPEL (Extra Packages for Enterprise Linuxe is enabled)

2) Install the 7zip package (note the package name is not the same as the executable).

$ su -c 'yum install p7zip'

3) Create an encrypted archive readable by WinZip.

$ 7za a -y -tzip -pMY_PASSWORD -mem=AES256 archive-name.zip /path/to/directory-of-files

Image by Alexander Stielauvia flickr used under a Creative Commons license.

Running the Latest Thunderbird on RHEL 6

Column picture by Tonton Jaja

Today I ran into a strange problem where messages seemed to be missing from my Inbox. Running “repair folder” from the properties tab automatically moved several messages to the trash. Moving them back to the inbox and repeating the process resulted in the same behavior. I thought maybe it was time to move on from the default version in RHEL 6, presently thunderbird-3.1.15-1.el6_x86_64, and live more on the edge.

I’ve also been using the same Thunderbird settings directory for two or three years so there was also the chance of some cruft build-up there as well.  What better way to rule out all possible issues than to run the latest version of Thunderbird with a fresh profile?

A simple way to do this is to rename ~/.thunderbird. If you change your mind or want it back, it’s simply a matter of closing Thunderbird, changing the name of the directory back, and running Thunderbird again. I believe there is also a way to this with the profile manager, but I like this way best.

I ran into one small problem due to my machine being 64bit and the regular Thunderbird Linux download being 32bit.  The solution was in this helpful forum post.

RhEL 6 Thunderbird Installation Steps

1) Download the latest stable Thunderbird version.

Updated October 27, 2011:  Thanks to the comment from Matej, pre-built 64bit packages are available, I’m not just not sure how regular folks like me would know to find them.  Back track on the link if you want a different language.

2) Un-tar the file that you download.  For simplicity I prefer to put it in my home directory.  With this approach it will not be accessible to other users, however it will not conflict with the existing installed RHEL rpm version.

$ cd Downloads
$ tar -xvf thunderbird-7.0.1.tar.bz2 -C /home/myuser

3) If you are running 64bit RHEL, you may encounter this error message:

thunderbird-bin: error while loading shared libraries: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory

Installing the dbus-glib.i686 package provides the library you need:

$ su -c 'yum install dbus-glib.i686'

4) Run the new version of Thunderbird

$ cd /home/myuser/thunderbird
$ ./thunderbird

5) If you want to modify the launcher to run this version instead of the default installed RHEL version, right click on the launcher icon, select properties, and change the path to point at the Thunderbird binary in your home directory.  Something like: /home/myuser/thunderbird/thunderbird

Nostalgy is the most important add-on

The Nostalgy add-on is the primary reason I can’t bring myself to change email clients.  The ability to file messages with ease into any folder with one or two key strokes is something I cannot live without.  Don’t miss “shift + s” to save a message to the last folder you saved to.

Benefits of the latest version

  • Once you set the column view you like you can apply it recursively to all your folders. This was a huge pain in the past where columns had to be set manually for each folder.
  • Newer themes work and are compatible
  • Everything feels polished, newer and faster

Use at your own risk

The downside of running Thunderbird this way is that you aren’t running the officially supported version provided by Red Hat and you are relying on Mozilla to provide the latest version to you.  This should happen automatically via Thunderbird’s built-in updating service.  Preferences for automatic updates can be changed in the “Advanced” tab.  Naturally the packages built and provided by Fedora and RHEL have this feature disabled.

I’m currently running the latest version of Firefox the same way and have not encountered any issues.

Image by Tonton Jaja used under a Creative Commons license.

Resuming Corrupted Suspended Guests

virt-manager screen shot

My recent post on fixing terminator was months in the making, partly because I lost the environment I was using to double-check all the steps and partly because other things just kept coming up.  Several months back when I found the original fix it was only available as a patch in bugzilla.  I’d constructed a whole article about how to get the patch, update the spec file, build a new rpm, etc. but in the midst of this I lost the virtual machine I was using twice to a suspend that would not resume.  I also ran into some problems using yum-downloader to get the source rpm I could not reliably reproduce or document.

Time went by and an updated source rpm was available to fix vte so it seemed silly to document all the tedious steps to patch the spec file and rebuild when that work was already done, but then I was thwarted again when I rebooted my laptop and forgot I had a guest running.

It was a frustrating situation from the virt-manager GUI and the command line–my only options were resume (which didn’t work because of the error message below) and shut-down (which did the opposite of what I wanted the virtual machine to do).

On Google I found scant references to this situation so I turned to a company-wide mailing list at work where anyone can post technical questions.  I had the solution in 30 minutes!

This was the cryptic error message I received in virt-manager when trying to resume the guest:

Error restoring domain: Unable to read from monitor: Connection reset by peer

Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 44, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/domain.py", line 1050, in startup
self._backend.create()
File "/usr/lib64/python2.6/site-packages/libvirt.py", line 510, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Unable to read from monitor: Connection reset by peer

The error message made no sense to me--I can’t resume the domain because the monitor cannot be read?  How about, “Unable to resume domain.  If this persists try ‘virsh mangedsave-remove’ from a command line to remove the suspended session and reboot your machine.” Including the word “suspend” in the command instead of “managedsave” would also be more intuitive.

Here is the command to remove a corrupted suspended virtual machine session so you can boot your machine again–naturally you’ll lose the suspended session you had:

$ su -c 'virsh managedsave-remove <domain name>'

I’ve also confirmed on RHEL 6.2 (beta) that rebooting the hypervisor with a running guests, smoothly suspends and resumes them again when the hypervisor returns.

Bringing the Cursor Back to Terminator

Terminator Screenshot Picture

In my switch from Fedora to Red Hat Enterprise Linux (RHEL) one of the things I lost was Terminator.  Even though it was in EPEL and installed without issue, the cursor wasn’t visible, making it hard to use.  For a while I put up with it.  After a while it drove me crazy so I fell back to Gnome Terminal.  And that was fine for a while until I started doing more command line things again and missed a working in Terminator so badly that I asked Google how to fix it.

It’s a bug in VTE

Wouldn’t you know, other people had the same problem as noted in bug 658774.   It turns out the problem is not with Terminator, but in the VTE package.

I’ve seen the problem on RHEL 6.0 and 6.1 and it looks to be fixed in RHEL 6.2.  It is presently available in the RHEL 6 Fastrack channel (if you have a RHEL subscription) as an update (login required to view).  I’d assume, but haven’t verified, that the same problem exists on CentOS 6.

If you are running CentOS and have the same problem or if you’d like to build a fixed package on RHEL yourself, here’s how.

Building a new VTE package with the fix

To build a new rpm with the fix you’ll need:

  • a non-privileged rpm build environment
  • the updated source rpm for VTE
  • required build tools and libraries

Set up a non-privileged rpm build environment

If you don’t have a local rpm build environment specified, these commands will create it for you in your home directory.  There are several ways to do this, I found this somewhere long ago (maybe it was an RHCE class?) and like it because it is simple. You should always build the rpms as a non-privileged user–not as root.

$ mkdir -p ~/rpmbuild/{BUILD,RPMS,S{OURCE,PEC,RPM}S}
$ echo "%_topdir $HOME/rpmbuild" > ~/.rpmmacros

Get the latest vte source rpm

$ wget http://ftp.redhat.com/pub/redhat/linux/enterprise/6Workstation/en/os/SRPMS/vte-0.25.1-7.el6.src.rpm

Install the tools and libraries you need to build

$ su -c 'yum install rpm-build yum-utils gcc'
$ su -c 'yum-builddep ./vte-0.25.1-7.el6.src.rpm'

Build the new package

$ rpmbuild --rebuild ./vte-0.25.1-7.el6.src.rpm

Install your new vte rpm from ~/rpmbuild/RPMS

$ su -c 'yum localinstall /home/nopriv/rpmbuild/RPMS/x86_64/vte-0.25.1-7.el6.x86_64.rpm'

Run Terminator and you should be back in business.

OpenShift Express Servname not supported for ai_socktype

I came across an interesting situation yesterday with OpenShift Express.  I was trying to register a new domain using rhc-create-app  and received this cryptic error message:

There was a problem communicating with the server.
Response message: getaddrinfo: Servname not supported for ai_socktype
If you were disconnected it is possible the operation finished withoutbeing able to report success.
You can use rhc-user-info and rhc-ctl-app to learn about the statusof your user and application(s).

After a bit of rooting around and troubleshooting with the always helpful people on #openshift on irc.freenode.net, in this case Mike McGrath, we discovered that I had an http proxy set in my shell variables. One way to troubleshoot this error message is to review all the variables set in your session and look for something like this:

$ export | grep -E 'prox|http'

And look what we found:

declare -x HTTP_PROXY="http://localhost:8080/"
declare -x http_proxy="http://localhost:8080/"
declare -x no_proxy="localhost,127.0.0.0/8"

I’m told the rhc tools have difficulty communicating over a proxy, but that a bug has been filed and is scheduled to be fixed.

This appears to be symptomatic of the way that switching web proxies with the ProxySwitchy! plug-in in google-chrome affects all desktop proxy settings.  A quick look at System → Preferences → Network Proxy shows that this setting has been made at a global level for the Gnome Desktop which I know I did not do.  I’m running RHEL 6.1.

Also interesting that this problem is limited to gnome-terminal.  Terminator does not import the global proxy variables the same way gnome-terminal does and in this case that is good.

It seems the best work-around if you not need a web proxy is to unset the http proxy variables or use Terminator.

Making Python Bugzilla Work

I’ve been a big fan of python bugzilla for a long time and used it often in Fedora to gather bugs for the release blocker meetings.  If you aren’t familiar with python bugzilla, it is a very useful library and command line utility that talks to the Fedora and Red Hat Bugzilla instance–a defect (bug) tracking system.

I tried to use it yesterday with Fedora 15, but it didn’t return any bugs.  James Laska pointed me at some unreleased patches and the commands to make it work again.  It doesn’t appear that any updates have been made to this package since August 2010, so hopefully a new release is on the way.

Here are the steps I followed:

$ git clone  git://git.fedorahosted.org/python-bugzilla.git python-bugzilla.git
$ cd python-bugzilla.git
$ curl "https://fedorahosted.org/python-bugzilla/attachment/ticket/32/0001-Fix-for-ticket-32.patch?format=raw" > /tmp/ticket32.patch
$ git am /tmp/ticket32.patch

Now, run the patched version from your git directory:

$ ./bin/bugzilla

A good example to try out is the example provided in the Fedora Blocker Meeting SOP.

Try Out OpenShift Today

I couldn’t be prouder of today’s OpenShift (PAAS–Platform as a Service) cloud announcement by Red Hat. It’s not often that you get to be project manager on a release this big or exciting. It was a massive team effort involving many smart and driven people at Red Hat and it was inspiring to work along side them.

If you’re looking for a free place to host your unmodified PHP, Ruby, or Python application, look no further than OpenShift Express.  See the OpenShift site for for more information about Express and the other offerings.

This is the culmination of one of the roles I assumed after transitioning from Fedora in November 2010.  Another project I took on will also soon release in Red Hat Enterprise Linux 6.1. It is an elegant, comprehensive certificate based system for managing your Red Hat subscriptions that goes beyond the existing Red Hat Network. This project was also particularly interesting and challenging since it involved a number of groups inside Red Hat I haven’t worked with before.

Speaking of Fedora, I hear they are on track for shipping Fedora 15 on May 24, 2011! I’ve enjoyed being obliviously unaware of the trials and travails of this release cycle while appreciating the very polished and stable Fedora 15 beta release. I wasn’t too sure I would like GNOME 3 after what I’d heard about the laptop power experience, but I do like it. I most miss the ability to see multiple time zones under the calendar and also find the calendar dim and hard to read at a glance.  For now they are minor inconveniences.

Running Elluminate Live! on RHEL 6

I’m continuing to run RHEL 6 on my laptop and encountered a recent challenge getting a Java based collaboration tool called Elluminate Live! (now known as Blackboard Collaborate) to run on it.  The necessary package is installed by default in Fedora and it ran fine there so I never paid much attention.

This took way longer to figure out than I thought it should so here is the bottom line:  If you are using the version of Java that comes by default in RHEL 6.0 you need the java-1.6.0-openjdk-plugin found in the “Optional” channel on RHN (or in RHEL6.1 and thereafter icetea-web).

If you’re running RHEL 6.0, java-1.6.0-openjdk-plugin is unavailable. I logged bug 678806.

[root@localhost ~]# yum install java-1.6.0-openjdk-plugin
Loaded plugins: refresh-packagekit, rhnplugin
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package java-1.6.0-openjdk-plugin.x86_64 1:1.6.0.0-1.21.b17.el6 set to be updated
--> Processing Dependency: java-1.6.0-openjdk = 1:1.6.0.0-1.21.b17.el6 for package: 1:java-1.6.0-openjdk-plugin-1.6.0.0-1.21.b17.el6.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.6.0-openjdk-plugin-1.6.0.0-1.21.b17.el6.x86_64 (rhel-x86_64-workstation-optional-6)
           Requires: java-1.6.0-openjdk = 1:1.6.0.0-1.21.b17.el6
           Installed: 1:java-1.6.0-openjdk-1.6.0.0-1.39.b17.el6_0.x86_64 (@rhel-x86_64-workstation-6)
               java-1.6.0-openjdk = 1:1.6.0.0-1.39.b17.el6_0
           Available: 1:java-1.6.0-openjdk-1.6.0.0-1.21.b17.el6.x86_64 (rhel-x86_64-workstation-6)
               java-1.6.0-openjdk = 1:1.6.0.0-1.21.b17.el6
           Available: 1:java-1.6.0-openjdk-1.6.0.0-1.31.b17.el6_0.x86_64 (rhel-x86_64-workstation-6)
               java-1.6.0-openjdk = 1:1.6.0.0-1.31.b17.el6_0
           Available: 1:java-1.6.0-openjdk-1.6.0.0-1.36.b17.el6_0.x86_64 (rhel-x86_64-workstation-6)
               java-1.6.0-openjdk = 1:1.6.0.0-1.36.b17.el6_0
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Update: 2011-03-29.  It turns out the latest available openjdk package which fixed some security issues did not contain a new openjdk-plugin and thus the reason for the problem above.  If you are on RHEL 6.0 there is no current work-around except to try a different java jdk like Sun or IBM–also available on RHN.

In the RHEL 6.1 Beta and thereafter things should install fine.

$ su -c 'yum install icetea-web'

To get access to the public beta of RHEL6.1 enable the RHEL 6 beta channels for your system in RHN.

RHEL 6 EPEL

With less time to live on the edge in Fedora-land these days I went looking for less excitement by way of Red Hat Enterprise Linux 6 for my Dell XPS M1330 laptop.  I was motivated to take a step back from Fedora 14 by a couple of things.  The first was the ongoing unresolved kernel bug surrounding wake-ups.  The second was hoping for a more reliable suspend and resume experience which has become more annoying the more time I spend on a MacBook.  To its credit, on RHEL 6, suspend and resume works 99% of the time–hibernate and resume, closer to 30% of the time, or once or twice before a reboot is required.

I love the Dell XPS M1330 notebook as an extremely lightweight, powerful, and cost effective machine.  I’m less enamoured with its repair record in the 20 months I’ve had it: a new motherboard, DVD drive, battery, and two touch pads because the spring in the left mouse button keeps breaking.  Each time a technician comes to fix it they tell me this machine wasn’t made for the amount of much travel I do, which if they knew, isn’t very much. Thankfully it has gold corporate support so it usually gets fixed within a day or two.

Oh yes, this post was about EPEL.  My appreciation and respect for all the people who make EPEL possible has increased ten fold!  Without many of the packages in EPEL, I wouldn’t be able to continue to work the way I did on Fedora.  Thank you EPEL people!  I get it now.

Here are the steps to get rolling with EPEL on RHEL 6–this assumes you have obtained RHEL 6 through normal channels and have a valid RHN subscription.

1) Install the RPM containing the repo definitions

$ su -c 'rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm'

2) Enable the Optional channel for your host by logging into RHN and enabling the Optional channel.  According to the EPEL wiki page this is required to resolve package dependencies.

3) Make sure EPEL and the Optional channel are enabled

$ yum repolist

Learn more about configuring EPEL at the Fedora wiki.

If you prefer to configure the EPEL repo by hand, follow these steps:

1)  As root, put the following in a separate file (with a name ending in .repo) in /etc/yum.repos.d:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

2) import the EPEL rpm key:

# rpm --import https://fedoraproject.org/static/0608B895.txt

3) Enable the Optional channel for your host by logging into RHN and enabling the Optional channel.  According to the EPEL wiki page this is required to resolve package dependencies.

4) Make sure EPEL and the Optional channel are enabled

$ yum repolist

Thanks to my ever-present technical support person, Paul Frields, for providing the file above way back when the RHEL 6 EPEL repo RPM was not available.