Showing post in category: Linux
Informative error message… NOT.
I’ve installed php-gtk on a machine and got the above error when trying to start php from cli via ssh.
After a while it suddenly hit me that I hadn’t forwarded X when I logged in via ssh. After that I was able to use php again.
php with php-gtk is unable to start without a X server.
Tags: php-gtk
At work I was assigned to package some software to make it easier to distribute and update. One of those software packages was php-gtk which with one patch to the build/configure files now cleanly builds on Ubuntu. You will be able to find the package on my Ubuntu PPA. You will be able to find builds for both 32bit and 64bit platforms.
I’m also in the process of uploading packages for FriFinans which is an Open Source economy / accounting application. This should be easier… lets see how it goes
For a long time I thought the only way to restore something deleted on ext3 was to cat the device and grep for known strings from the deleted files.
Which:
- only worked for text files like like config and code files.
- was very cumbersome and error prone.
Anyway thanks to Carlo Wood, ext3grep and this fine tutotial about HOWTO recover deleted files on an ext3 file system which has proven me wrong. Not that I need it right now but I’ve been there and will probably end up in the situation again.
Tags: ext3, restore, undelete
At work I had to setup the network on Ubuntu Server (Hardy) so it was able to scan several networks with nmap as if they where local networks (and thus able to get MAC addresses). Until now the networks was scanned through a router which means the MAC addresses was lost. The reason for the importance of the MAC addresses was to identify whether a machine was likely a virtual machine or a physical machine.
The machine scanning is a virtual machine in VMware. Seven networks needed the ability to scan MAC adresses. VMware has a limitation of only 6 hardware devices (at least in ESX 3.5) which meant that having two harddisks it was only able to scan four out of the seven networks giving the machine a virtual NIC in each network.
The ESX server separated the networks with VLAN tags so to work around this we created a virtual trunk NIC.
Notice: The VLAN ID is optional but an empty VLAN ID means it cannot see VLAN tags. If you want a VMware NIC. To see all VLAN tags the VLAN ID must be 4095 (this might be VMware specific). This gave me and a colleague quite a headache before we figured it out.
To create trunked NIC in VMware:
- Click on the ESX server you want to create it on.
- Click on the “Configuration” tab to the right.
- Find the virtual switch in which the trunked NIC should reside in and click on “Properties…”.
- Click on the “Add…” button at the bottom to start the wizard.
- For “Connection Types:” select “Virtual Machine” and press “Next”.
- Give the NIC a name ie. “Trunk” and set the “VLAN ID (Optional):” to 4095 and press “Next”.
- Now just press “Finish” and notice the right information pane now indicating VLAN ID is set to “All”.
For Ubuntu Server (Hardy) to play nice with this new trunked NIC I found some help on the Ubuntu forums on how to setup VLAN.
First you have to install the vlan package:
sudo aptitude install vlan
Now enable the module:
sudo modprobe 8021q
And make sure it gets automatically loaded the next time the machine starts up:
sudo sh -c 'grep -q 8021q /etc/modules || echo 8021q >> /etc/modules'
Now configure your NIC in the following file:
/etc/network/interfaces
The following example sets up the ip 192.168.1.100 with 8 as a VLAN tag on eth0:
auto eth0.8
iface eth0.8 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
Now bring up the interface with:
sudo ifup eth0.8
Tags: nmap, vlan, vmware
I like that fact that development of towards Gnome 3.0 seem to be minimal but realistic. Preparing the platform for ease of development will pay off in the other end. I think they are focusing the energy the right places to get off the ground.
After 3.0 is released I hope they will look into this problem:
I have multiple computers and I can imagine the number will grow considerably over the years.
- Workstation (currently using)
- Laptop (currently using)
- Mediacenter (currently using)
- HTC Phone with Android (planing to buy)
- Computer in Kitchen (planing to buy)
I would like to access my contacts, calendar, notes, todo, file area (dropbox like), rss feeds, bookmarks etc. no mater what which computer I’m sitting at, or even via a browser if I’m not on one one of my own computers… or worse in Windows. I don’t want to manually sync stuff around, it is in efficient and is bound to go wrong at some point. Some effort have been made in order to store ie. Tomboy notes centrally via ssh or webdav which is acceptable because there is no alternative. Similar is Tasque able to store the todo online using an online service called Remember the Milk and Firefox plugins have been created to sync bookmarks across computers.
The real solution:
Create a service which can store all these information and host it. Now people could create a “Gnome Account” if they wanted to use this service. This kind of service would generate considerable amounts of data which is why the free Gnome service might have to have limitations on ie. how many contacts a user can have sync’ed or how much space the shared file area can take up. I also wouldn’t rule out the possibility of having commercials integrated in some way for this free service ie. like in Gmail.
For all those who cannot live with the limitations the “Gnome Account” has or just don’t like the commercials they can install the service on machine them selves or use the service from another provider. Ie. Ubuntu might want to provide the service to their users but want to sync bookmarks from Firefox instead of Epiphany. Or a company installs the server software and provides the service for a monthly fee without the same limitations than the “Gnome Account”.
Perhaps even companies could install their own sync service for all their employees.
To sum up this would ease the pain moving between several devices. Also when upgrading or installing a new device all you had to do is enter the “Gnome Account” once and all supported applications would instantly be in sync.
Tags: gnome, sync
Yesterday I played around with git-svn because git will be the future version control tool we will be using at work and we still have some projects stored in svn. I wanted to try out git but we are not about to convert the old projects just yet.
First I needed to check out the current code from svn and get it into git. I searched the net for how this was done and found something that cloned the entire svn repository to git… not quite what I needed but nice to know:
git svn clone svn://192.168.1.5/htdocs git_htdocs
The above takes the project htdocs from my current svn repository and saves it locally into git repository in the folder git_htdocs.
I just wanted to start hacking so I found that the following fetched the code I wanted:
mkdir git_htdocs
cd git_htdocs
git svn init svn://192.168.1.5/htdocs
Now you are ready to actually fetch some code from svn with:
git svn fetch -r1519
I found the revision I needed (the newest) by issuing a svn info within my old svn checkout.
Make your changes and commit locally with:
git commit lib/class.csv_import.php
When ready to push changes back to the central svn repository use:
git svn dcommit
To keep your local git checkout in sync with the upstream svn repository you can run:
git svn rebase
This article was great reading for me: An introduction to git-svn for Subversion/SVK users and deserters
Happy hacking
Lately I found myself wishing for more in the world of Linux and Open Source. Yesterday I installed the free VMware Server 2.0 which in my opinion is an upgrade worth while. I didn’t need to patch anything to get the modules running on my Ubuntu Intrepid system, and on my laptop where I’m still running Ubuntu Hardy matching binary modules was actually included in the installation… no need to compile them … I like that. Bridging the Atheros wireless on my laptop still doesn’t work, but I guess thats not VMwares fault.
Anyways after installing VMware Server I installed a virtual Ubuntu 8.04 server (Jeos – Just enought operation system) and wanted to install the VMware Tools on the machine. But honestly would like to just install a deb package. I searched the web for a bit to see if someone had created some debs ready to use…. nothing.
At some point Ubuntu hard Debian packages for both the VMware server itself and the VMware Tools. I want that!
Well a package with Open Virtual Machine Tools would do as well. I think my choice on Ubuntu (or Debian for that matter) mainly is because the gigantic repository of quality packages. But this is one of the few times when it comes short. As far as I can tell open-vm-tools will be packaged for Intrepid… looking forward to it
I’m still ripping all my music to FLAC and today I found some old pieces of music which had been tagged wrong. I was browsing my music library with Rhythmbox and right clicked to change the tag but I couldn’t edit it
I found a few bugs which seems to describe my problem… and it seems to be fixed in gstreamer-plugins-good version 0.10.11… to bad Intrepid only have 0.10.10 atm
Last but not least I wish the nvidia driver would support Xrandr… though I’m not holding my breath
I’ve bumped into several other wishes but these was the ones I could remember on top of my head. It seems that for every time the overall quality Linux raises I just raise my expectations by the same degree.
This weekend I decided to try and get my Apple remote to work on my Mac mini which I just upgraded to Hardy the other day.
Configuring the package lirc you are able to select the apple remote from a list but I couldn’t get it to work that way. So I found a way to create my own configuration file for the Apple remote:
sudo irrecord -H macmini -d /dev/usb/hiddev0 macmini.conf
-H tels irrecord which driver to use
-d is the device irrecord listens for input on
macmini.conf is the file where irrecord saves the configuration when done
First you need to hold a button. I had to wait almost 25 sec before it was satisfied and went on with the configuration. Now just follow the on screen instructions and in the end you should have you own configuration file. I recommend to compare the following file with the one you just created to check out the differences:
/usr/share/lirc/remotes/apple/lircd.conf.macmini
I made sure to call my buttons the same as in lircd.conf.macmini.
After that I altered these two files to point to my newly created configuration file and removed pointers to lircd.conf.macmini:
hardware.conf
lircd.conf
I then restarted lircd with:
sudo /etc/init.d/lirc restart
now you should be able to check that it is working with the command irw:
irw
Just Ctrl+c when you are satisfied with the result.
At some point I would like to use my remote with Elisa which just released a 0.5.6 which have DVD playback support, but for now I’ll just stick to Totem just to try getting it to work.
To use the remote in Totem you first have to enable the IR plugin (Edit -> Plugins…). Then you have to configure what to buttons are supposed to do which is done in a configuration file in you home folder:
~/.lircrc
Content could look something like this (read more about syntax on LIRC’s website):
begin
prog = Totem
remote = Apple_A1156
button = vol+
config = volume_up
end
Since the Apple remote have a combined Play/Pause button I wanted to find out if that was possible. I had a bit of trouble figuring out what was going in the config = line and looked through all documentation I could find on LIRC’s website. Suddenly it hit me that the values in config a specific for the application. Not much about this on the Totem website so I downloaded the source code for Totem. Don’t worry this isn’t going to be hardcore. I unpacked the source code and searched for files with the name lirc:
$ cd totem-2.22.1
$ find . -name \*lirc\*
./data/lirc_example
./src/plugins/lirc
./src/plugins/lirc/totem-lirc.c
./src/plugins/lirc/lirc.totem-plugin.in
I opened the file totem-lirc.c and found about 25 definitions for IR commands something like the following:
#define TOTEM_IR_COMMAND_PLAY "play"
#define TOTEM_IR_COMMAND_PAUSE "pause"
#define TOTEM_IR_COMMAND_NEXT "next"
#define TOTEM_IR_COMMAND_PREVIOUS "previous"
#define TOTEM_IR_COMMAND_SEEK_FORWARD "seek_forward"
#define TOTEM_IR_COMMAND_SEEK_BACKWARD "seek_backward"
#define TOTEM_IR_COMMAND_VOLUME_UP "volume_up"
#define TOTEM_IR_COMMAND_VOLUME_DOWN "volume_down"
#define TOTEM_IR_COMMAND_FULLSCREEN "fullscreen"
#define TOTEM_IR_COMMAND_QUIT "quit"
#define TOTEM_IR_COMMAND_UP "up"
#define TOTEM_IR_COMMAND_DOWN "down"
#define TOTEM_IR_COMMAND_LEFT "left"
#define TOTEM_IR_COMMAND_RIGHT "right"
#define TOTEM_IR_COMMAND_SELECT "select"
#define TOTEM_IR_COMMAND_MENU "menu"
#define TOTEM_IR_COMMAND_PLAYPAUSE "play_pause"
#define TOTEM_IR_COMMAND_ZOOM_UP "zoom_up"
#define TOTEM_IR_COMMAND_ZOOM_DOWN "zoom_down"
#define TOTEM_IR_COMMAND_SHOW_PLAYING "show_playing"
#define TOTEM_IR_COMMAND_SHOW_VOLUME "show_volume"
#define TOTEM_IR_COMMAND_EJECT "eject"
#define TOTEM_IR_COMMAND_PLAY_DVD "play_dvd"
#define TOTEM_IR_COMMAND_MUTE "mute"
#define TOTEM_IR_COMMAND_TOGGLE_ASPECT "toggle_aspect"
Other multimedia software might be better docuemented when it comes to IR but I guess you would be able to use something similar to figure out what possible config-options you have in the lircrc for the software.
Anyways Totem have a Play/Pause toggle and I ended up with:
begin
prog = Totem
remote = Apple_A1156
button = play
config = play_pause
end
After my server was restarted twice by my hosting center I decided to make sure Teamspeak would start automatically.
I read a few posts on how other people did it but in the end I decided that I created my own minimal script.
My two goals with this init script was:
- Run the Teamspeak server as an unprivileged user.
- Make sure the Teamspeak server starts up after reboot even though it wasn’t shut down properly
- A little bonus was that it reuses much of the init script that is bundled with the installation
Init script (/etc/init.d/teamspeak):
#!/bin/sh
TEAMSPEAK_DIR=/usr/local/teamspeak
TEAMSPEAK_USER=teamspeak
# Make sure that Teamspeak starts even though it wasn't closed nicely last time (ie. by a power cut)
if [ $(su - $TEAMSPEAK_USER -c "ps ux" |grep tsserver2.pid|grep -v grep|wc -l) -eq 0 ] && [ -f ${TEAMSPEAK_DIR}/tsserver2.pid ]
then
rm ${TEAMSPEAK_DIR}/tsserver2.pid
fi
cd ${TEAMSPEAK_DIR}
su - $TEAMSPEAK_USER -c "./teamspeak2-server_startscript $1"
cd -
I’ve installed Zimbra on SLES9 for a costumer because they wanted Zimbra on Suse. The costumer wanted the community maintained version and I felt it was too risky to install Zimbra 5 release candidate.
First a little Suse bashing (sorry but I just get irritated about this over and over again). Zimbra recommends using imapsync to migrate emails to Zimbra and it seems to be a fine piece of software.
- I started out by using yast to search for this tool but as I expected nothing.
- After downloading it from the website and trying to run it I got a message that I was missing
Mail::IMAPClient lib.
- I tried to find SLES9 rpm packages (or just RPM packages) with the
Mail::IMAPClientlib.
I tried to install this with cpan:
cpan
cpan> install Mail::IMAPClient
....
Writing Makefile for Mail::IMAPClient::MessageSet
Warning: prerequisite Parse::RecDescent 1.94 not found. We have 1.80.
I’m no cpan / perl expert so I couldn’t figure out why I couldn’t get Parse::RecDescent installed.
- Anyway what is the benefit of having a supported enterprise version of Suse if you trash it with all sorts of unsupported software.
You could argue that Zimbra should provide imapsync as some part of migration tools.
Anyway the solution was that I installed imapsync on my Ubuntu Gutsy laptop:
sudo apt-get install imapsync
I just gets so disappointed that things are so “hard” in a professional Linux compared to Debian or Ubuntu.
When I’m done I’ll just uninstall it and all its dependencies again:
imapsync libdigest-hmac-perl libdigest-sha1-perl libio-socket-ssl-perl libmail-imapclient-perl libnet-ssleay-perl libparse-recdescent-perl
Important note: I had imapsync on Ubuntu Gutsy hang when it connected to the Zimbra server. I found that passing --noauthmd5 with the example in User Migration in Zimbras wiki made imapsync not hang. An earlier version of Ubuntu (Edgy with an earlier version of imapsync) didn’t need this.