OpenShift and MacOSX

If I wanted the least amount of trouble I would probably use OpenShift on a Fedora laptop or a RHEL6 server.

Since I always give myself a challenge, I decided to use MacOSX to work with OpenShift. Not that it is a bad idea but it gives additional challenges I did not expect. There is always something positive about these challenges. When the basic things don’t work you have to learn about them and how everything is setup. It is always the best setup to learn. Certainly a quick success on that aspect.

Installing the rhc tools to create a domain and app on openshift requires that you have XCode installed. Only $5 to get the app from the Mac App Store but I did not know that it was installing an installer. Once I learned that I needed to install from the installation I was golden to get something done. So I had a relatively empty application from the WSGI template setup on my MacBook Air.

It is great to code on the laptop but sometimes I prefer to use the iMac with the bigger screen and more comfortable setup. I tried to simply do a git pull to get the repo but it would always fail on me. After getting some help from the OpenShift Express Forums I learned that I needed to copy the files from .ssh that were created with the rhc tools. The config and libra_* files were copied and my git pull worked as it should.

Basic things but it is great when it works and that you have learned where things are.

Now I have this great idea that I should try to put Spring Python in OpenShift Express. Looking for more learning, I guess.

Red Hat Summit: The culture shock I needed

I was not suppose to go this year because it was the turn for a co-worker but since that person left us for greener pastures I was lucky to be the next in line.

I was quite happy to be going.

I did not really remember why I wanted to be there until I was there for a few hours. Yes I wanted to go to many of the technical sessions and my agenda was made before the event started. I am always impressed that the presenters are the people doing the code or in charge of the technical team responsible for what is being presented. The presenter can answer many of the questions and if they can’t most of the time the rest of their team are in the audience. The quality of these presentations are great because of this involvement.

But as much as the technical sessions are great it was Jeremy from trendhunter.com that reminded me why I loved the Summit so much. It is about the culture.

The culture at the Summit and at Red Hat is very different than what I see where I work. The collaboration with everyone is the norm in the open source communities and Red Hat certainly makes it a point to always act in collaboration.

That different mentality is good shock and certainly allowed me to see others thinking differently but also to wake me up. When you are challenged in how you execute your job you can better evaluate the reasons you do it that way. You can also see what you can change.

In my case it is a little more than that. I am uncomfortable in how we approach our execution of what we need to do. I am a lot more interested in the collaboration model that I have seen during the Summit. In that regard I think that I need to challenge a lot more than just myself. Is it just the greener pasture syndrome, I don’t know. I think that I will have to wait a month and re-evaluate what I have seen and how I feel about it.

I think that the most important sentence from this Summit will be “culture over strategy”.

How to do a SVN Dump from a remote repo

Found this great article on how to hack your way to do a SVN dump from a remote repo. I had never use the svnsync command but this allows you to make the remote repo a local one and you can easily use it to create your dump file. Very useful when you have lost admin access to the original server and you need to migrate to a new SVN server.

Quick command list:

  • svnadmin create temprepo
  • echo ‘#!/bin/sh’ > temprepo/hooks/pre-revprop-change
  • chmod +x temprepo/hooks/pre-revprop-change
  • svnsync init file://temprepo https://server/svn/origrepo
  • svnsync sync temprepo
  • svnadmin dump temprepo > dumpfile

Copy the dump file over to the new SVN server and on it:

  • svnadmin load reponame < dumpfile

A quick word of warning because the UUID will change with this process so doing “svn sw” on existing working copy might prove to be challenging.

rhn_register erroring out

It took me over an hour to figure out why it was failing like this:

An error has occurred:
exceptions.TypeError
See /var/log/up2date for more information

In the log you would get this explaination:

[Tue Mar 23 11:30:43 2010] rhn_register There was an error while reading the hardware info from the bios. Traceback:

[Tue Mar 23 11:30:43 2010] rhn_register
Traceback (most recent call last):
File “/usr/share/rhn/up2date_client/tui.py”, line 1510, in _activate_hardware
hardwareInfo = hardware.get_hal_system_and_smbios()
File “/usr/share/rhn/up2date_client/hardware.py”, line 863, in get_hal_system_and_smbios
props = computer.GetAllProperties()
File “/usr/lib64/python2.4/site-packages/dbus/proxies.py”, line 25, in __call__
ret = self._proxy_method (*args, **keywords)
File “/usr/lib64/python2.4/site-packages/dbus/proxies.py”, line 102, in __call__
reply_message = self._connection.send_with_reply_and_block(message, timeout)
File “dbus_bindings.pyx”, line 455, in dbus_bindings.Connection.send_with_reply_and_block
dbus_bindings.DBusException: The name org.freedesktop.Hal was not provided by any .service files

[Tue Mar 23 11:30:43 2010] rhn_register
Traceback (most recent call last):
File “/usr/sbin/rhn_register”, line 82, in ?
app.run()
File “/usr/share/rhn/up2date_client/rhncli.py”, line 65, in run
sys.exit(self.main() or 0)
File “/usr/sbin/rhn_register”, line 64, in main
ui.main()
File “/usr/share/rhn/up2date_client/tui.py”, line 1721, in main
tui.run()
File “/usr/share/rhn/up2date_client/tui.py”, line 1608, in run
if self._show_subscription_window() == False:
File “/usr/share/rhn/up2date_client/tui.py”, line 1562, in _show_subscription_window
self.password)
File “/usr/share/rhn/up2date_client/rhnreg.py”, line 588, in getRemainingSubscriptions
smbios)
File “/usr/share/rhn/up2date_client/rhnserver.py”, line 50, in __call__
return rpcServer.doCall(method, *args, **kwargs)
File “/usr/share/rhn/up2date_client/rpcServer.py”, line 199, in doCall
ret = method(*args, **kwargs)
File “/usr/lib64/python2.4/xmlrpclib.py”, line 1096, in __call__
return self.__send(self.__name, args)
File “/usr/share/rhn/up2date_client/rpcServer.py”, line 38, in _request1
ret = self._request(methodname, params)
File “/usr/lib/python2.4/site-packages/rhn/rpclib.py”, line 314, in _request
request = self._req_body(params, methodname)
File “/usr/lib/python2.4/site-packages/rhn/rpclib.py”, line 222, in _req_body
return xmlrpclib.dumps(params, methodname, encoding=self._encoding)
File “/usr/lib64/python2.4/xmlrpclib.py”, line 1029, in dumps
data = m.dumps(params)
File “/usr/lib64/python2.4/xmlrpclib.py”, line 603, in dumps
dump(v, write)
File “/usr/lib64/python2.4/xmlrpclib.py”, line 615, in __dump
f(self, value, write)
File “/usr/lib64/python2.4/xmlrpclib.py”, line 619, in dump_nil
raise TypeError, “cannot marshal None unless allow_none is enabled”
exceptions.TypeError: cannot marshal None unless allow_none is enabled

I also tried the rhnreg_ks utility with the –nohardware argument and that is when it gave me more information about the error:

[Tue Mar 23 15:18:39 2010] up2date Warning: haldaemon or messagebus service not running. Cannot probe hardware and DMI information.

I started the haldaemon process and I could then rhn_register my host.

Why did we disable the haldaemon process? It is part of the CIS recommendation to disable that startup service.

You learn the side effect of security as you go try things.

Forwarding DNS Server

options {
directory “/var/named”;
forwarders {172.16.10.1; 172.16.10.2;};
forward only;
};

I had to setup a forwarding DNS servers today and since I had never done it before I was looking for a quick way.

I installed the bind rpm package that comes with RHEL5 and was puzzled since it did not create the /etc/named.conf. So I created one with this content:

options {
directory “/var/named”;
forwarders {10.1.1.1; 10.1.1.2;};
forward only;
};

Changed the ownership to named:named and started the service.
Quite simple and in our lab it is a simple way to address an issue with routes to access a DNS Server.

Sun Java in KUbuntu

That was not an obvious one. Under KUbuntu I typically use the KPackageKit application to install and update applications.  It did not work well. I tried to install the sun-java-jdk package many times and every time it would list the dependencies and do the install but the “java -version” would tell me that I was still using the OpenJDK.

After reading a few different posts in forums I tested the idea to use the synaptic package manager. The installation worked much better.

To finalize the install I ran a few commands at the cli:

sudo update-java-alternatives -l

This listed the fact that I now have the OpenJDK and Sun Java installed on my workstation.

sudo update-alternatives –config java

This allowed me to specify to use the Sun Java as my default JVM.

java -version

This now reports the Sun Java JRE as my JVM.

I can now use Maven to compile some test projects.

I guess there are still a few issues with the OpenJDK to be fully compatible (might just be some configuration that I am not aware of).

64 bits Linux and NVidia Drivers

I spent days trying to get the NVidia drivers to work on different 64 bits Linux distributions without success. Initially I was blaming Kubuntu 9.04 for these issues but I tried with Slamd64 and downloading the drivers from NVidia and had the same issues. I also tried with openSUSE 11.1 64 bits and it did not work.

Some desperate time passed…

I tried Kubuntu 9.04 32 bits and it worked on the first try.

I am quite puzzled about this. The Slamd64 site specifically mention that they have done testing to make sure that binaries like the NVidia Drivers would work. They work to install and compile but the X server does not start properly.

Not only that issue is bothering me but I can’t have one monitor turned 90 degrees and the other in normal mode. These limitations are not pleasant.

I must be missing something since it should work.

Rebuilding the DVD ISO for CentOS 5 or RHEL 5

I found a few documents on the Internet about what I needed to do to rebuild the DVD to integrate my kickstart file. Unfortunately none of the solution had all the needed command in one place for my setup to work so here is my cookbook from the different sources.

First I mounted the dvdrom with the CentOS DVD to /mnt/cdrom:

mount /dev/cdrom /mnt/cdrom

Then I copied a few files:

  • cd /tmp
  • cp -R /mnt/cdrom/isolinux ./
  • cp -R /mnt/cdrom/CentOS ./isolinux/
  • cp -R /mnt/cdrom/* ./isolinux/ [say yes to overwrite the TRANS.TBL]
  • cp -R /mnt/cdrom/.discinfo ./isolinux/
  • cp ks.cfg /tmp/isolinux/

For my RHEL5.1 rebuild I did similar commands but the paths are a bit different:

  • cd /tmp
  • cp -R /mnt/cdrom/isolinux ./
  • cp -R /mnt/cdrom/Server ./isolinux/
  • cp -R /mnt/cdrom/VT ./isolinux/
  • cp -R /mnt/cdrom/images ./isolinux/
  • cp -R /mnt/cdrom/Cluster ./isolinux/
  • cp -R /mnt/cdrom/ClusterStorage ./isolinux/
  • cp /mnt/cdrom/* ./isolinux/ [say yes to overwrite the TRANS.TBL]
  • cp -R /mnt/cdrom/.discinfo ./isolinux/
  • cp ks.cfg /tmp/isolinux/

I had to change permissions on 2 files:

  • chmod 664 ./isolinux/isolinux.bin
  • chmod 664 ./isolinux/isolinux.cfg

I had to edit the isolinux.cfg (in the isolinux directory) to change a couple of lines:

  • the “default linux” line became “default ks
  • The 2 line after “label ks” went from “append ks initrd=initrd.img” to “append ks=cdrom:/ks.cfg initrd=initrd.img

The isolinux.cfg file now looks like:

default ks
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label ks
kernel vmlinuz
append ks=cdrom:/ks.cfg initrd=initrd.img
label local
localboot 1
label memtest86
kernel memtest
append -

To build the ISO (all this on one line):

mkisofs -o centos5-dvd1.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -r -R -J -V “CentOS 5.1 (CentOS) Disk1” -A “CentOS 5.1 (CentOS) Disk1” -p “Cinq” -T isolinux/

For Red Hat Entreprise Linux 5.1 I had to change the label for the DVD from “CentOS 5.1 (CentOS) Disk1” to “RHEL_5.1 x86_64 DVD” (obviously I am using the x64 version for RHEL5) so the command became:

mkisofs -o centos5-dvd1.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -r -R -J -V “RHEL_5.1 x86_64 DVD” -A “RHEL_5.1 x86_64 DVD” -p “Cinq” -T isolinux/

Reference sites:

Cisco VPN Client and Linux Kernel 2.6.21

I had some problems installing the Cisco VPN client 4.8 on my Slackware 12.0 workstation so I searched a bit on the net and fond a page that had almost everything to the t: http://blog.360.yahoo.com/blog-.WURHFYwdq8.zfEosWC6j8jQ?p=55. A few very small differences that are due to the fact that the kernel has changed a bit more since this doc. So here are the very quick steps:

  1. cd /usr/src/linux/
  2. make menuconfig – and check that everything is good
  3. make bzImage
  4. cd include/linux
  5. ln -s autoconf.h config.h
  6. cd /whereever/vpnclient/
  7. perl -p -i -e ‘s/CHECKSUM_HW/CHECKSUM_COMPLETE/g’ interceptor.c – to replace references of CHECKSUM_HW with CHECKSUM_COMPLETE; there are only 2 to fix
  8. perl -p -i -e ‘s/skb_checksum_help(.*)/skb_checksum_help(skb)/g’ interceptor.c – to replace the 5 references to skb_checksum_help() with the proper parameters
  9. ./vpn_install – to install the Cisco VPN client

If you have a different experience don’t hesitate to let me know how it works for you.