Timmy's Blog

Creating a custom protocol dissector for Wireshark

 

24/02/2010 21:02:32

Wireshark is an open source network protocol analyzer and quite probably the best
of its kind. If you are a developer working with a lot of networking code, it’s a must have!

It can recognize many standard protocols such as POP3, NTP, Jabber, etc…
Most of the development I do is related to communicating with hardware devices
using TCP/IP. These devices implement their own communication protocol unknown to
Wireshark. While I can still use Wireshark to monitor the raw data, I thought it would
be much better if I could actually tell it what my data is so it can be displayed properly.


Nice tools missing in action

 

17/03/2008 1:13:01

Just after I installed the latest build of Ubuntu 8.04 I noticed a nice little tool
in the Application/Menu/Internet section called Avahi SSH Server Browser.
Nothing more than a simple dialog listing all the Avahi published SSH servers in the network.
Even though you couldn't specify user credentials, it was still a great tool.

After the first dist-upgrade however, the tool dissapeared and is now
nowhere to be found in the repositories... wtf?

PS: Check out the System/Administration/Authorizations tool! Finally!
Comments: 0 (view/add)

Ubuntu Mobile

 

28/02/2008 0:09:32

I know... I know... Ever since I got hooked on Mac OS and .NET 3.5 I've given
very little attention to Linux on the desktop, and to be honest, I don't think I'll be
giving it a lot of attention any time soon. It just doesn't suite my needs at this time.

I am however interested in a better desktop alternative for the eee PC,
and today I stumbled accross Ubuntu Mobile, something I read about ages ago but
which got lost in the back of my mind. (At the time it didn't seem interesting enough).

I haven't looked at the details closely yet, but when I saw the screenshots and the
typical MID features, the eee PC was the first thing that popped into my mind.

The MID features as listed on the site:
  • Small size/form factor
  • 4 to 7 inch touch screen
  • Physical and/or virtual keyboard
  • Wi-Fi, 3G, Bluetooth, GPS, WiMAX
  • 2GB to 8GB Flash or disk storage, 256MB+ memory/512MB+ recommended
  • USB, camera, head phone jack, speakers, microphone

While the eee PC doesn't come with a touchscreen (yes there is a hack), I think
Ubuntu Mobile, or at least a customized version, might be great for the eee PC.

So is anybody willing to give it a try?
Comments: 2 (view/add)
Tags: linux | opensource

Autostart applications in Xfce4

 

26/02/2008 0:41:49

My customized Ubuntu Live CD automatically creates a new Xfce4 session and starts
the custom application without any user interaction. Since it's a normal desktop application
running in full screen mode, I had to make a few changes to the default Xfce4 session.

First I had to remove the two panels from the default configuration. I did this by
editing /etc/xdg/xfce4/panel/panels.xml and removing the panel definitions:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE config SYSTEM "config.dtd"> <panels> </panels>

The next step was to create a new file in /etc/xdg/autostart/ . This directory contains
files with the .desktop extension. Every file represents an application which is to be
loaded with the default Xfce4 session. The file I added looks like this:

[Desktop Entry] Encoding=UTF-8 Name=FrontScreen Comment=Front Screen Application Exec=frontscreen 0 Terminal=false Type=Application Categories= OnlyShowIn=GNOME;XFCE; X-Ubuntu-Gettext-Domain=frontscreen

The parameter passed to Exec is simply the name of the executable. Since it's located
in /usr/local/bin I don't have to specify an absolute path.

Nothing fancy, but I've had quite a few people asking me how to do this.
Comments: 3 (view/add)
Tags: linux | opensource

Create your own Ubuntu live cd

 

26/02/2008 0:21:55

Earlier today I was writing a small application for JO3RI which he intends to deploy on
a few Linux systems. Because he seemed to have problems deploying the application,
I deciced to create a customized Ubuntu Live CD with Mono 1.9 and the application pre-installed.
When you boot from the cd it automatically starts a new Xfce session and loads the application.

It's really easy to create a customized Ubuntu live cd. I'll quickly guide you through the process.

First you'll have to install some variant of Ubuntu. It doesn't have to be a live cd version,
but you will need a live cd in order to build the iso image, which is what we want of course.

Once you're done, add a new repository to the Apt sources. You can do this by adding
a new line to /etc/apt/sources.list or by creating a new file in /etc/apt/sources.list.d/.
Personally I prefer adding a new file and I'll call it linuxmint.conf. It contains a single line:

deb http://www.linuxmint.com/repository romeo/

Run apt-get update and install remastersys using apt-get:

apt-get install remastersys

Now you're ready to customize Ubuntu. Add or remove applications, change default settings, etc...
The only thing you need to keep in mind is that user settings will not be persisted as the current
user's profile will not be added to the live cd; instead the default live cd user will be added.

When you're finished making adjustments, simply run the following command:

remastersys dist

This will create a few files in /home/remastersys:

control customdist.iso dummysys ISOTMP varexc

We're only interested in the iso file. You can burn it to CD/DVD or test it in a virtual machine.
Once you've burned the image you can clean up the mess remastersys made by running:

remastersys clean

That was easy, wasn't it? The remastersys application doesn't just create live systems,
you can use it as a backup solution as well. Make sure you check out the various options.
Comments: 2 (view/add)
Tags: linux | opensource

What they don't tell you about the Eee PC

 

17/02/2008 23:50:40

At least not before you buy one...

The hardware is great, especially given its size and price. The software however is not so great.
All over the web you'll find articles giving you the impression that Asus has created a customized
version of Xandros Linux especially for the screen resolution of the Eee PC, the truth however
is that they simply created a single 'desktop application' to replace the classic applications menu.

Granted, the desktop interface looks great:



But take a look at the following screenshots:



As you can see the dialog window hardly fits on the screen. The 'Help' and 'Close' buttons overlap
with the 'File Types' groupbox, removing parts of the UI.



Here we have the Thunderbird preferences dialog. As you can see the 'Close' button overlaps with
part of the UI, making impossible to press the partially hidden button. There is no point in moving the
windows with the Alt+mouse function (which is no good for inexperienced users anyway), as the
controls will remain hidden anyway. Another example:  



But it gets even worse. When you compose a message with Thunderbird,
you only have about 3 visible lines to type your message. If that message happens to contain
the original message in-line, you're completely pooched. Most of the space is wasted on 3 empty
fields. Trying to expand the body textbox completely wrecks the UI.
I haven't got a screenshot of this, but I'll try and take one tommorow when I go visit my parents.

This is what Google Reader looks like on the Eee PC:





A quick solution here is to change your user agent to match that of a Windows Mobile or iPhone device.

The system update feature didn't seem to work very well either:



This is hardly a user friendly notification that something went wrong.

Conclusion:
Asus introduced the Eee PC as a solution for end users. They called it the 'easy revolution'.
In reality however, using the Eee PC is far from easy. Like I said before, the hardware is great
and has great potential, the desktop looks amazing... but that's where the good news stops.

After that, they simply took Xadros, made a few kernel tweaks and dropped it on the Eee PC,
once again leaving end users with the impression that Linux is hardly ready for the desktop.

The applications haven't been optimized for the small screen and the exception messages are
anything but user friendly. Without connecting the Eee PC to a large screen and activating
advanced desktop mode end users will have a hard time getting anything done.

The small screen should not be used as an argument as to why the UI is such a PITA,
just take a look at what Apple has accomplished with their IPhone/IPod Touch UI.

Sure, us geeks love this device, but Asus promoted it as an end user appliance... trust me it's not!
(Asus didn't put any real effort into the OS)

Next, I'll take a closer look at the various applications and talk about what needs to be done
in order to make the Eee PC the 'easy revolution' Asus is talking about.
Comments: 6 (view/add)

Setting up netatalk on Ubuntu

 

11/02/2008 22:06:16

I was trying to set up AFP with netatalk on my Ubuntu server to share files with my
Apple devices.  After installing with Apt the service started but I couldn't connect
to the shares. In most cases an Apt-Get install of netatalk works fine with the
exception of a warning  message on Leopard because  the standard install of
netatalk on  Ubuntu doesn't come with encryption support due to a license issue.

Because I couldn't get it to work and wanted encryption support anyway
I decided to compile from source. Normally I'd simply get the sources for netatalk,
but this guide showed me a better way of compiling packages from source on Ubuntu.
Instead of getting the latest sources, you can get the source used to build the
original Ubuntu package using the apt-get source command.

1 cd /usr/src/ 2 apt-get source netatalk 3 apt-get build-dep netatalk 4 apt-get install devscripts cracklib2-dev dpkg-dev libssl-dev 5 cd netatalk-2.0.3/

Line 2 gets the sources for netatalk from the apt-get repositories while line 3 gets the
packages required in order to build netatalk from source.
Line 4 get's extra packages required to add  encryption support to netatalk
and to be able to build Ubuntu packages.

Next you simply build a new Ubuntu netatalk package with SSL enabled:

DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -us -uc debi

This will compile the sources, create a package and install it all in one go.
Because we don't want Ubuntu to install a new version on the next dist-upgrade,
we'll lock the package in the dpkg selections list:

echo "netatalk hold" | dpkg --set-selections

Normally the system should be up and running now,
but you might have to change a few settings.
Unlike most systems, Ubuntu stores the netatalk configuration file in /etc/default,
so you'll have to edit /etc/default/netatalk instead of /etc/atalk/netatalk.
It should contain the following:

ATALKD_RUN=yes PAPD_RUN=yes CNID_METAD_RUN=yes AFPD_RUN=yes TIMELORD_RUN=no A2BOOT_RUN=no

Next you'll have to modify /etc/netatalk/afpd.conf,
my configuration has a single line at the bottom of the file:

- -noddp -uamlist uams_dhx.so

Every line in this file represents a single server, so I only have one.
The -noddp parameter tells netatalk only to work over TCP and
not the native AppleTalk protocol.

Next you'll want to edit /etc/netatalk/AppleVolumes.default.
This is where you define the directories  to be shared.
These shares will show up in Mac OS when connecting to the AFP server,
but only if the user has read access to those directories on the server.
Example configuration:

~/ "Home Directory" /srv/media "Media Directory"

The first line shares the home directory for each user.
The second shares another directory on my server.
The good thing about netatalk is that it uses standard unix rights for authorization.

That's it as far as basic setup is concerned.
Please note that my solutions is based on various references I found
on the net and by no means unique. I just wanted to share the Ubuntu specific
solution as most guides seem to work for Fedora and other distros but not for Ubuntu.

After setting this up, you might want to look into Avahi
to "publish" your server on the local network.
Comments: 1 (view/add)
Tags: apple | linux | opensource

Sun is going to by MySQL AB

 

16/01/2008 15:19:04

It seems Sun is interested in buying MySQL AB.
I wonder if they will change the license of their connectors
back to LGPL then. I can't live with the GPL licensed versions.

I'll contact one of the developers, see if I get some more information.
Comments: 0 (view/add)
Tags: opensource

Bash scripting

 

3/12/2007 22:12:47

I wrote a simple backup script for the Linux Professional course.
It's not safe to use as a real backup solution, but it does show
the basics of bash scripting. It didn't display properly in the
mailing list, so here's the formatted version of the code:

#!/bin/bash CURDATE=`date +%s` SRCDIR=$1 DSTDIR=$2 LASTUPDATE=`cat lastupdate.log` echo ${CURDATE} echo ${SRCDIR} echo ${DSTDIR} echo ${LASTUPDATE} if [[ "${LASTUPDATE}" == "" ]]; then touch lastupdate.log LASTUPDATE=0 fi if [[ "${SRCDIR}" == "" ]]; then echo "Gelieve een bron directory op te geven" exit fi if [[ "${DSTDIR}" == "" ]]; then echo "Gelieve een doel directory op te geven" exit else DSTDIR=${DSTDIR}/${CURDATE} mkdir -p ${DSTDIR} fi for i in `find ${SRCDIR} -maxdepth 1 -type f` do CURFILEDATE=`stat -c %Y $i` echo ${CURFILEDATE} if [[ ${CURFILEDATE} > ${LASTUPDATE} ]]; then echo $i is bijgewerkt, we maken een kopie cp $i ${DSTDIR}/ else echo $i is niet bijgewerkt, we maken een ... ln $i ${DSTDIR}/ fi done echo ${CURDATE} > lastupdate.log

It simply checks the files in the specified directory
and creates a copy or hard link of those files depending
on wether or not they have been modified since the last backup.

If you're looking for a "real" backup solution, check out this guide.
It explains how to use rsync which is licensed under the GPL.
Comments: 3 (view/add)

RSS-NET owned by ToolButton Inc

 

14/11/2007 23:16:27

A few months ago I submitted a patch to the open source RSS.NET project
to handle encoded content in RSS feeds. Sadly the patch never made it
upstream and RSS.NET was later bought by ToolButton Inc who's now selling
the library for $149.00 (or $99.00 for the personal edition).

We're currently working on Blicbox 2.0 and I was looking for a new version
of the library when I noticed this. The original project had a lot of potential,
especially since it was being used by big projects such as Monologue.

The open source version contains a few bugs which I'll have to fix
for Blicbox 2.0 and when I do, I'll publish the updated version somewhere.
Since the original code will always remain open source there is nothing stopping
me from doing that. Guess the freedom that comes with open source cuts both ways sometimes.

Comments: 0 (view/add)

|<< 1 2 >>|