header

Torsten Curdt’s weblog

Wordpress or Linotype

148793428 6d3cfe1216 t Wordpress or Linotype148793458 bf11ab4b10 t Wordpress or LinotypeI am currently trying to get rid of movabletype. It has served me well but I just don’t like perl. It’s ok as long as you don’t have to mock around with the internals but as soon as you wanna do some funky stuff …and play a little. People probably say I should try the new version first but… still. Trying linotype sounds much more appealing. …more fun. It’s not yet that feature rich but it would be a good opportunity to improve it. Besides: simplicity is often elegance.

This being said I came across wordpress and it seems to be exactly what I have always looking for in the past.

Just install it? Or eat our own dog food? Hm….

Sending ARP Packages

Did you ever try to send an ARP request from java? Unfortunately it’s not that easy. I came across the Jpcap project which uses the libpcap library through JNI. Here is a simplified example for using the pcap library in C. Note that error handling needs to be added.


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include <libnet.h>
#include <pcap.h>

#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif

#ifndef IP_ALEN
#define IP_ALEN 4
#endif

static u_char eth_xmas[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
static u_char eth_null[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

static u_char eth_src[ETH_ALEN];
static u_char eth_dst[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

static u_char ip_src[IP_ALEN];
static u_char ip_dst[IP_ALEN] = {192,168,20,1};

int main(int argc, char **argv)
{
  libnet_t *libnet = NULL;
  char error[LIBNET_ERRBUF_SIZE];
  int i;

  if (getuid() && geteuid()) {
    fprintf(stderr, "must be run as root");
    exit(1);
  }

  // open libnet
  libnet = libnet_init(LIBNET_LINK, "eth0", error);

  // get dst ip address
  u_int32_t otherip;
  otherip = libnet_name2addr4(libnet, argv[1], LIBNET_RESOLVE);
  memcpy(ip_dst, (char*)&otherip, IP_ALEN);

  // get hwaddr
  struct libnet_ether_addr *mymac;
  mymac = libnet_get_hwaddr(libnet);
  memcpy(eth_src, mymac, ETH_ALEN);

  // get ipaddr
  u_int32_t myip;
  myip = libnet_get_ipaddr4(libnet);
  memcpy(ip_src, (char*)&myip, IP_ALEN);

  // print MAC address
  for (i = 0; i < ETH_ALEN - 1; i++) {
    printf("%.2x:", (u_int8_t)eth_src[i]);
  }
  printf("%.2x", (u_int8_t)eth_src[ETH_ALEN - 1]);

  static libnet_ptag_t arp=0, eth=0;

  arp = libnet_build_arp(
     ARPHRD_ETHER,
     ETHERTYPE_IP,
     ETH_ALEN, IP_ALEN,
     ARPOP_REQUEST,
     eth_src, ip_src,
     eth_dst, ip_dst,
     NULL, 0,
     libnet,
     arp);

  eth = libnet_build_ethernet(
     eth_dst, eth_src,
     ETHERTYPE_ARP,
     NULL, 0,
     libnet,
     eth);

  int c = libnet_write(libnet);

  libnet_destroy(libnet);
}

Skype for Linux and OSX

Skype is by far the best voice-over-ip client I know. It even works well with NAT firewalls (how do they do that?!) Now there is also a Linux and OSX version available.

I found some packages for Debian. Just add these lines to your sources.list:

…and then do the usual “apt-get update; apt-get install skype”.

Unfortunately it does not work with proxies yet.


deb http://www.bootsplash.de/files/debian unstable main
deb-src http://www.bootsplash.de/files/debian unstable main

iTunes Covers

Want covers for all your iTunes songs? Try this awesome service

  • The good thing: covers are gonna be saved inside you mp3s
  • The bad thing: covers are gonna be saved inside you mp3s

I mean: I don’t care about a few kilobytes on my local machine (although having the cover in each and every song of an album is quite a waste of space) but I do care what I have on my iPod. Slow but constantly my iPod is filling up. Only about 12GB left. Would be a great feature to strip them off on synchronization.

Debian Desktop

148793375 6a65b61c40 t Debian DesktopFinally I got my desktop properly installed. Since I got a new harddisk and wanted to use LVM anyway I decided to do a clean reinstall. Now I am running Debian unstable. The installation was a piece of cake with the new Debian (sarge) installer. …until you come to the point where you want to configure X. This has always been a pain. And to be honest: most of the tools still just suck. I don’t want to fiddle around with my XF86Config anymore. That’s where the big distributions still have a big competitive advantage. (Installing SuSE or RedHat is now even easier than installing Windows) Also: as much I love the idea of an “untainted system” in the spirit of Debian …when I have to install the Nvidia drivers and mock around with java dependencies because there is no Debian package for the Sun JDK …I could just puke. Probably because once you used the awesome Debian packaging system through “apt-get” you want everything to be as easy. It’s just like with the cool java IDEs – IDEA and Eclipse. If you ever had to go back to Visual Studio or other crappy IDEs you die to have the project done and go back to java. (Hm… maybe that’s how you finish ahead of schedule?)
As for my desktop: I am becoming to feel much more comfortable with Gnome! After some theme tweaking (hint: the theme support still has a lot of room for improvement, guys) I ended up with quite a nice environment. Still some little inconsistencies here and there …but in the end quite nice, slick and functional. Would be great to have a desktop like that right after a few minutes installation time. But maybe that’s the price you have to pay for a stable system you don’t have to reinstall every 6 months?
Having used Windows as (main) desktop system for quite a while I am unfortunately still missing some applications. Has anyone come across a good ftp client e.g.? Don’t tell me gftp until you tried Filezilla – which just rocks! …but is Windows only – unfortunately. Not to talk about the never ending Gimp vs Photoshop battle.

Gnome (and Linux in general) has come along quite a way …and it still getting improving. But you don’t have to be an UI expert to realize that e.g. the Gnome select icon dialog is probably one of the worst designed dialogs in the history of mankind. And: ok, the Gnome folks decided to open a Window on each click on a folder – I am fine with that! But why do I have to go into the menu to open the parent folder? A “..” or arrow would be good and straight forward. …the tiny things that are annoying.

With all this in mind and a brief look at my desktop …it seems pretty obvious where I am heading. I am not too religious about my operating system. But I do I want to trade one proprietary system for another? Although it’s probably trading *the brown stuff that smells* for gold. Hm… maybe that’s already the answer? Hm…

Anyone borrowing me his PowerBook for a test drive while he is on vacation?