Cadaver and proxy auth

Posted in Linux / unix, Software-related, Work on October 25th, 2008 by Jan

At work we regularly have to send over files to $vendor. $Vendor has two ways of accepting files: FTP, and Webdav (over https). Since our company’s policy is to not send things out unencrypted, we have to go the webdav way. It’s also the policy to send things over our internetproxy if possible.

After some searching for a console-based webdav client we ran across cadaver, a lightweight client that seemed to do the trick. It has proxy support, so great ;)

What isn’t so great is that it doesn’t have any way to supply the proxy authentication in a non-interactive way, which is crucial to allow us to script this file transfer.

Today I took the time to create a patch that allows just that - setting the proxy info in advance. It also includes a parameter to trust the server certificate implicitly, otherwise it was yet another step where cadaver would come and ask for user input.

Now it works like a charm! :)

Reading DRM’ed Adobe Ebooks on Linux

Posted in Linux / unix, Software-related on September 3rd, 2008 by Jan

Sade linked me to this nice ebook by Neil Gaiman, Neverwhere. Unfortunately, you need Adobe Digital Editions for it, which only exists for Windows and Mac. Since she’s a Linux user, that one didn’t really fly with her.

So, to get that thing to work, here’s a very low-tech way of doing it:

  1. Install Digital Editions on a supported OS (I used Mac OS)
  2. Download/open the ebook’s ebx.etd file
  3. Let Digital Editions open, download and authenticate the file
  4. Print to PDF 40 pages (the damn thing won’t let you print more)
  5. Close the digital Editions app
  6. Delete (in my case) the ~/Documents/Digital Editions directory
  7. Reload the webpage
  8. Goto step 2

Repeating this until you have the entire ebook in PDF’s for easy reading at home, under your favourite OS / device! ;)

Iodine (dns tunnel) on your Mac (to escape those evil firewalls)

Posted in Internet, Linux / unix, Mac OS, Software-related on July 7th, 2008 by Jan

Here’s a short how-to to get the iodine dns tunnel working on your Mac.

In this short howto, I’ll assume you’ll be using a linux server to act as your gateway to the world. I’ll also assume you’ve read the iodine documentation and setup your DNS accordingly. For my example, I’ll be using a (nonexistant) DynDNS.org static DNS entry, iodine.rulestheworld.tld. I’ll also assume that you’ll be using a public internet address of 1.2.3.4, and a private subnet of 10.0.0.1.

  1. Install the tun/tap driver for Mac OS X. Easy as doing *click* *click* done! :p
  2. Next, install iodine on your Mac. Easy as download, extract, and typing make; make install
  3. Now, install iodine on your linux box. It’s included in the package repositories of the usual suspects, for instance debian: apt-get install iodine.

    Start it (or configure it to use) with:
    iodined -P <password> <unused private IP> <dns name>
    or in our example:
    iodined -P mypass 10.0.0.1 iodine.rulestheworld.tld

    This should return the following:

    Opened dns0
    Setting IP of dns0 to 10.0.0.1
    Setting MTU of dns0 to 1024
    Opened UDP socket
    Listening to dns for domain iodine.rulestheworld.tld

  4. Configure your linux box for IP forwarding: sysctl -e net.ipv4.ip_forward=1
    (and add this to your /etc/sysctl.conf file), and configuring your firewall (iptables) for masquerading:
    iptables -t nat -A POSTROUTING -s 10.0.0.0/255.255.255.0 -o eth0 -j MASQUERADE
  5. Next, download NStun.sh, a very handy script that does all the hard work of changing the routes and so on :p

    You’ll want to change the script: change the first lines as the script reads, and lower, change the

    NS=`grep nameserver /etc/resolv.conf|head -1|awk ‘{print $2}’`

    line to read

    NS=”62.213.207.197″

Now, start NStun.sh on your Mac, and surf away! (well, slowly, but freely, atleast!)

CoRD and xrdp

Posted in Linux / unix, Mac OS, Software-related on June 29th, 2008 by Jan

I was trying to get xrdp running on my Linux box, so I could takeover the screen from the outside world. The rdp protocol is a (huge) bit more performant than VNC, which is why I wanted to use it.

Today I was trying for the 3rd time to get it to work, using CoRD as an RDP client, but I never got any image back - the client started, I saw the connection being built up, but I never got any image over. Starting rdesktop locally gave me the output I expected.

This gave me the idea of using Microsoft Remote Desktop Connection Client for Mac 2 Public Beta, to see if it might be a problem with the client… and yup, it is.

Seems CoRD 0.4.3 (the current stable) is unable to handle the output of xrdp. I now installed the 0.5 beta 1 which works without any problems.

Copying files and dirs with tar

Posted in Linux / unix, Software-related on June 21st, 2008 by Jan

If you want to copy a bunch of files from one spot to another, but preserve links/permissions/ownership/…, it’s usually a big hassle.

With tar, you can make this hassle disappear!

Copying a directory tree and its contents to another filesystem using tar will preserve ownership, permissions, and timestamps. You can use pipe tar to another tar to prevent having to create an intermediate file to store the stuff you want to copy around.

To copy all of the files and subdirectories in the current working directory to the directory /destination, use:

tar cf - * | ( cd /destination; tar xfp -)

The first part of the command - tar - makes a tarball of all the files, and writes this to stdout. The second part of the command part will first change directory, and then extract the tarball in that location, reading from it’s stdin.

Since the cd and tar commands are contained within parentheses, their actions are performed together.

The p option in the tar command instructs tar to preserve the permission and ownership information, if possible. So if you want to move a lot of files around, it’s advisable to do so with the root user to keep all them permissions!

Funpidgin

Posted in Linux / unix, Software-related on May 16th, 2008 by Jan

Thanks to a post on Frank Goosens’ blog I discovered FunPidgin! A fork of Pidgin, a multi-messenger client formerly known as Gaim.

My biggest (and actually, only) gripe with Pidgin is that they changed the way the contact list works/behaves - you no longer have a clear view of what protocol a user is added with, so you also don’t know what protocol to pick for someone to send him/her a message/file. Since they were obviously not going to listen to their users (although it has been requested a ton of times, search their Trac), it was only a matter of time before a fork was created: Funpidgin.

“What makes us different from the official client, is that we work for you. Unlike the Pidgin developers, we believe the user should have the final say in what goes into the program.”

I’m definitely gonna check it out!

Linux on my MacBook

Posted in Hardware-related, Linux / unix, Software-related on January 13th, 2008 by Jan

I’m currently trying to get Linux (Debian Sid) working on my MacBook… it’s installed, but still needs lots of tweaking.

Most of the things work out of the box, except the things listed below:

Specific things that work (after tweaking):

  • Xorg with resolution at 1280×800
  • WiFi (atheros)
  • special buttons (volume/brightness/…)

Things that need to work still:

  • Touchpad (well, it works, but it needs to work better)
  • iSight

Sources I’m using at the moment:

I’ll write a detailed post on this later… when I’m not uberly lazy ;)

Vmware console on Debian Lenny

Posted in Linux / unix, Software-related, Virtualisation on December 30th, 2007 by Jan

I just installed VMWare server on my gf’s linux-laptop, but the server console didn’t want to start for some reason… Just came back to the command line, nothing happening.

Running vmware as
LD_PRELOAD=/usr/lib/libdbus-1.so.3:$LD_PRELOAD vmware made things work, strangely enough ;)

Guess it’s because she’s not running any dbus-aware windowmanager, and thus said library not being loaded before the start of the server console. Ah well, fixed now ;)

Ubuntu LTS… not so very L?

Posted in Linux / unix, Software-related on December 26th, 2007 by Jan

Ubuntu has these versions of it’s distribution they label LTS: Long Term Support. Now seems that if you use an LTS, and want to go to the next LTS… you’ll have the pleasure of either breaking your system, or reinstalling from scratch.

Majorly big bug?

Go Ubuntu! :p

arm-linux crosscompiling on Debian Sid

Posted in Linux / unix, Software-related on September 29th, 2007 by Jan

Here’s a simple howto on how to install an ARM crosscompiling environment on your Debian Unstable:

  1. Install crosscompiler packages from http://debian.speedblue.org/
  2. Create a virtual deb package extraction directory:
    1. Create the directory /usr/arm-deb
    2. Create the directory /usr/arm-deb/usr
    3. Create the following symlinks in /usr/arm-deb/usr:
      1. ln -s /usr/arm/bin /usr/arm-deb/usr/bin
      2. ln -s /usr/arm/lib /usr/arm-deb/usr/lib
      3. ln -s /usr/arm/include /usr/arm-deb/usr/include
      4. ln -s /usr/arm/share /usr/arm-deb/usr/share

    This will allow easy package extraction.

Now, download the packages you need manually (from http://packages.debian.org/ and extract them in the directory using dpkg -x <package file> /usr/arm-deb

To compile something, you first have to add /usr/arm/bin to your path (export PATH=/usr/arm/bin:$PATH), set include paths to those include files (export CPPFLAGS=”-I/usr/arm/include”) and add
-host=arm-linux to your ./configure.

Happy compiling ;)