Monday, January 31, 2011

KVM : disabled by BIOS

I had no idea what Intel AMT was before I tried to fire up libvirt.

While working through the Fedora virtualization quick start, I ran :
$ lsmod | grep kvm


which should have returned :
$ lsmod | grep kvm
kvm
kvm_intel


Unfortunately I had only, "kvm." The troubleshooting guide suggested running :
$ dmesg | grep -i kvm



Which returned,
$ dmesg | grep -i kvm
KVM: disabled by BIOS

Happy day. I booted into the BIOS ("Press the blue, ThinkVantage button!") and disabled AMT. Unfortunately that didn't do it either. I rebooted again, pressed "the blue, ThinkVantage button," chose "CPU" and enabled the two settings for virtualization,"Intel Virtualization Technology" and "Intel VT-d Feature."

After the next reboot all was well.

Tuesday, January 11, 2011

SOAPui

This post is a shameless plug for soapUI.

I came across soapUI while running through the Self-Paced Workshop for the JBoss SOA Platform (pdf download.) It is incredibly simple to create a test for a web service. There is even an Eclipse plugin, but I haven't tried that yet.

Happy coding.

Monday, November 29, 2010

Recursive setfacl or how to add your PostgreSQL data directory to Git

This was an interesting annoyance.

I was working on some examples and wanted to be able to delete everything cleanly after I was done.

I had an instance of JBoss and wanted PostgreSQL to use a local directory for data.

My directory structure was :
example/
data
jboss-eap-5.1
logs

I had a user "postgres" to run PostgreSQL. Since the rest of the directory was created by me, "jeremy," I used setfacl to add "postgres" to the data directory:
setfacl -m u:postgres:rwx ./data/

When I ran :
initdb -D data/

It wasn't happy. I got :
"initdb: could not change permissions of directory"

Next up was :
sudo chown -R postgres:postgres data/

That worked for "initdb." I was able to su to the "postgres" user and execute "initdb" in "data/."

I was happy until I tried to add "data/" to Git :
[jeremy@jeremy example]$ git add data
error: open("data/PG_VERSION"): Permission denied
error: unable to index file data/PG_VERSION
fatal: adding files failed

setfacl to the rescue!
sudo setfacl -Rm u:jeremy:rwx ./data/

Unfortunately I got the same error.
I was missing the important "d" argument. The following worked :
sudo setfacl -Rm u:jeremy:rwx,d:u:jeremy:rwx ./data/
"sudo" was necessary because of changing the ownership to the "postgres" user.

I added everything to Git.

The moral of this rambling story : use the "d" flag with setfacl to cascade permissions to the files.

Tuesday, October 12, 2010

xlcip or How to copy past from the command line to x-windows

Brain Ashburn, my colleague in the Atlanta Red Hat office, introduced me to the xclip utility today. It copies output from the command line and puts it into x-windows.

For example, to copy the current directory :
 pwd | xclip -i -sel "clip"

There are of course more useful things that can be piped to it. To try it out create a file, add some text and :
cat newfile | xclip -i -sel "clip"

Its available through yum :
sudo yum install xclip

Tuesday, October 5, 2010

Installing MySQL with Yum

A quick note on installing mysql with yum in case anyone else is lazy (like me) and runs :

sudo yum install mysql

That only installs half of what's needed. nixCraft sums it up nicely for RHEL. It also works for Fedora :

$ sudo yum install mysql
$ sudo yum install mysql-server

To start it up and set the root user/password :

$ sudo yum install mysql
$ sudo chkconfig mysqld on
$ sudo /etc/init.d/mysqld start
$ mysqladmin -u root password PASSWORD
$ mysql -u root -p

H2 Connections in Eclipse

H2 is a great database for prototyping and local work. Eclipse does not come with a default driver definition though.

Dan Allen has a nice tutorial on Google code illustrating how to set one up.

Friday, October 1, 2010

You don't have permission to access / on this server.

More fun with Apache.

There was a time when I could configure Apache without the help of Google. Alas, that time was years ago.

I wanted several versions of Apache on my machine so that I could test different mod_cluster configurations side by side.

I downloaded the Apache source, built it and put in "/examples" under my home directory. After I started it I got :
You don't have permission to access / on this server.


I immediately checked the directory permissions. They looked okay. I spent some time monkeying with the SELinux security settings.

The problem was simple: Apache needs execute permissions all the way up to the root directory.

Simply moving my "examples" directory to the root fixed it.