Software

My Portfolio

Didn’t get it yesterday, but I finally got my JavaScript/jQuery based Portfolio up and running. I’m using Galleria – a nice script that has Flickr support integrated.

It’s pretty simple to set up – but the docs aren’t straight forward ;)

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Christian Kildau's Portfolio</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="./galleria.js"></script>
<script type="text/javascript" src="./galleria.flickr.js"></script>
<script type="text/javascript" src="./galleria.fullscreen.js"></script>
</head>
<body>
<div id="galleria">

<script type="text/javascript">
	api_key = '0a5a49ea38e03b11f477aaf066b5dcd2'
	var flickr = new Galleria.Flickr(api_key);

	flickr.getSet('72157614373115604', function(data) {
		$('#galleria').galleria({
		data_source: data,
		image_crop: false,
		show_info: true,
		autoplay: true,
		transition: 'fade',
		preload: 3,
	});
});
</script>
</div>
</body>
</html>

No Flash required, so it even works on my (veeeery slow) iPhone 3G…. :)

EDIT: Forgot the link. :o

How to Fix “The file server has closed down” issues in Mac OS and netatalk

Netatalk versions older than 2.1.3 had some issues with the TCP/IP Stack on Linux which resulted in errors like

Luckily they seem to have fixed this in 2.1.3 as the ChangeLog states: fix a serious error in networking IO code.

So the solution is as easy as upgrading. I am running Ubuntu, but two months after netatalk-2.1.3 has been released, they don’t even have it in unstable. Lucky Gentoo users you! I needed to fix this very quickly as it started to disrupt my workflow. Sadly I currently don’t have the time to dig into the packaging system of Debian or Ubuntu, so I looked up Debian’s configure options and just compiled from source:

cp -a /etc/netatalk/ ~
aptitude purge netatalk
apt-get build-dep netatalk
wget http://sourceforge.net/projects/netatalk/files/netatalk/2.1.3/netatalk-2.1.3.tar.bz2/download
tar xjvf netatalk-2.1.3.tar.bz2
cd netatalk-2.1.3
./configure  --with-shadow --enable-fhs --enable-tcp-wrappers --enable-timelord --enable-overwrite --with-pkgconfdir=/etc/netatalk --enable-krb4-uam --enable-krbV-uam --with-cnid-dbd-txn --with-libgcrypt-dir --with-cracklib=/var/cache/cracklib/cracklib_dict --enable-debian --disable-srvloc --enable-zeroconf --with-ssl-dir --enable-pgp-uam --prefix=/usr/local/netatalk/
make
sudo make install
mv ~/netatalk /etc/
/etc/init.d/netatalk start

This saves a copy of your running netatalk configuration to your home directory, removes netatalk, downloads all necessary libraries to build netatalk, downloads netatalk from SourceForge, extracts it, configures it, builds it, installs it, restores the configuration and starts it as usual.

I am running netatalk 2.1.3 for a week now and the error seems to be gone :-)

If you know how to easily create a Debian package, feel free to post in the comments.

Backup! Backup! Backup!

I managed to carry my gear for the entire last month without any damage, but Sunday night at the train station my camera back fell off my other baggage down on the ground. I hurried and checked my camera gear… everything O.K. *phew*.

Today I wanted to copy my images from the mobile HDD that I had to carry with me (because I didn’t have a Laptop with me, Thanks Dell!!!) to dump my images from the cards to it whenever possible. But… Click – Clack – Clack – Clack. DAMNIT! Headcrash!!!

Well, you can imagine that I was about to throw the HDD out of the window, but then decided to make a copy of it using ‘dd’ first. ‘dd’ went through the first 50GiB without any problems… but then the HDD started clicking again. I was able to recover some photos from the unfinished dump and there is still 4GiB of photos on one of my SD-Cards, so cross your fingers! Hope it’s just the video clips on another partition that I lost!!!

What does this tell us? Always have a backup!!!

On my past trips I always had one copy on my Laptop and then dumped the photos to an external HDD which I carried in another bag. But without a Laptop this wasn’t possible this time.

Here’s what worked best for me in the past:

  • Import and copy your images to Lightroom as usual
  • Close Lightroom, go to Finder/Explorer and copy your Picture & Library folder to an external HDD
  • Store the external HDD somewhere safe
  • Now you may format your memory cards

This way you always have two copies of your photos. I also usually formatted the external HDD every night before I copied my backup over. If you’re running Mac OS X you could also use TimeMachine to automate it.

My Mac OS X tweaks

Ohhh nooo! Not another one! However… :-) I’ll make it short:

  • Use TinkerTool to tweak some hidden preferences
  • iTerm is a better alternative to Terminal.app
  • NTFS-3G if you have usb-sticks or external HDDs you want to share with Windows or Linux
  • MacVim is my favorite editor for anything
  • The Unarchiver is great for compressed stuff you downloaded
  • VLC… forget QuickTime X, VLC does more things better
  • Evernote takes your notes and synchronizes them
  • Dropbox (link gives my account additional 250Mb) synchronizes your documents with multiple computers

I also enable SSH (System Preferences/Sharing), change the default icon size to 48×48 and install Xcode and MacPorts to get mtr (an interactive traceroute) and unrar (for things ‘The Unarchiver’ doesn’t take).

How to Fast VNC alternativ to Remote Desktop to a Mac using NoMachine

I am a very happy Mac OS user with a Mac mini and a MacBook Pro coming soon, but one things I really miss about Mac OS X is the lack of a fast and standards based remote desktop solution. The VNC server built into Mac OS X isn’t really compatible with all clients, and I still haven’t figured out if it’s possible to run it with a different resolution and color depth than the real screen!!!

But, I recently re-discovered a solution I got to know in my Linux time on a desktop: NoMachine. You’ll need a server running a recent Linux distribution or OpenSolaris which will act as a kind of a proxy and the setup is a bit complex, but it does work well. I’ll show you how to do it running Ubuntu Lucid.

First go to http://www.nomachine.com/select-package.php?os=linux&id=1 select your architecture and download all three files: client, node and server.

Then install them in the following order, fix the missing dependecies and install a vnclient plus vncpassword:

sudo dpkg -i nxclient_3.4.0-7_x86_64.deb
sudo dpkg -i nxnode_3.4.0-11_x86_64.deb
sudo dpkg -i nxserver_3.4.0-12_x86_64.deb
sudo aptitude -f install
sudo aptitude install xvnc4viewer vnc4-common

Since it’s really advisable I hope you already have PasswordAuthentication no in your sshd_config to disable Password authentication and to only allow key-based authentication. You’ll need to tweak nxserver a bit to get it working with key-based auth. Edit /usr/NX/etc/server.cfg to…

EnablePasswordDB = "1"

…edit the following line in /usr/NX/etc/node.cfg to enable VNC…

CommandStartRFB = "/usr/bin/vncviewer -fullscreen"

…create a key for your key-based authentication and restart nxserver.

sudo /usr/NX/bin/nxserver --keygen
sudo service nxserver restart

Your new key is placed at /usr/NX/share/keys/default.id_dsa.key. Copy it the device you want to connect from using scp or similar tools. Now all you need to do is enable the users you wan’t in nxserver:

sudo /usr/NX/bin/nxserver --useradd <user>

This enables the user in NX’s database and copies the previously generated key to the user’s authorized_keys file.

Now just enable VNC on your Mac. Go to “System Preferences”, select “Sharing” and enable “Screen Sharing”:

Now you’ll need to configure your client. Read more…

Nginx or Apache?

I recently discovered nginx when I was thinking about replacing apache2 as a reverse-proxy that adds ssl and authentication to my internal webserver. I finally chose nginx and it’s now running on my freshly installed OpenBSD 4.7 gateway. I chose nginx because of it’s straight-forward configuration syntax and because it has a much smaller codebase, which means it should run faster and has less security flaws. The documentation also is great. Plus nginx seems to be the rising star on the horizon of webservers :-) Many large sites are already running it as their reverse-proxies/loadbalancers according to this article.

For me nginx runs much faster than apache2. Where apache2 gave about 14MBps for a single download session, nginx gives me 23MBps (It’s a slow Intel Atom machine). Here’s my configuration. But since the nginx docs are that good, you don’t need any how-tos! Just rtfm :-)

user _nginx;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    sendfile        on;
    keepalive_timeout  65;
    gzip  on;
    access_log off;
    error_log off;
	server {
		listen 443 ;
		ssl on;
		server_name ext.example.org;
		ssl_certificate		ext.example.org.crt;
		ssl_certificate_key	ext.example.org.key;
		ssl_session_timeout	5m;
		ssl_protocols		SSLv3 TLSv1;

		location / {
			proxy_set_header X-Forwarded-Host $host;
			proxy_set_header X-Forwarded-Server $host;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_pass http://int.example.org;
			auth_basic "int.example.org";
			auth_basic_user_file /etc/nginx/htpasswd;
		}
	}
}

I just love this thing. Maybe I’ll replace apache2 on my internal webserver, too.

How to Setup KVM on Ubuntu Lucid

More than a year ago I wrote an article about Xen on Ubuntu Intrepid with the intention of blaming Ubuntu. I also clearly said, that I wouldn’t use Ubuntu anymore. This article turned out to be the most hit one on my blog. Maybe because the Ubuntu community directly links to it. Then, last Summer I wrote an article about alternatives to Xen, but I decided to wait and stay with Xen on my homeserver in the meantime. (Please keep in mind, all I use this for is for my private setups!). Last week I upgraded my Server’s hardware and also wanted to re-install it.

Xen still hasn’t made it into vanilla Kernel, it might make it into 2.6.34 or .35, but even if it does, I think it’s not even going to be close to being production ready. Plus most distributions release their next version in the next weeks/months and are already frozen, so they definitely will not ship with Xen. Well, the only real alternative is KVM. I didn’t like the idea of using KVM for a long time, but since almost every distribution now features KVM as their virtualization technique, I went with it. I also went with Ubuntu again (yeah blame me!). Why? Because their next release has long-term support, and I won’t have the time to upgrade it in the next 12-18 months. And what shall I say… I like it. Installation was kinda tricky on a software Raid0, but I was installing a development release, 1 week before the first Beta… and in the end it did work.

The server runs KVM now and it runs fast and stable. I have 4 virtual machines on it now. Installation of the guests using virt-installer and/or ubuntu-vm-builder was much easier and ended up with working VMs out of the box, whereas xen-create-image ended up with an unusable image on Intrepid, because the default console never showed up without tweaks. libvirt is also nice if you need it, but I really want to point out, that you can run KVM without libvirt just with the ‘kvm’ command!

I tagged this article ‘How-To’, but there are already many good KVM guides out there so I won’t write yet another one. I’ll just post a few hints to get KVM running with a bridged networking using libvirt.

First of all I removed /etc/libvirt/qemu/networks/default.xml to disable the dnsmasq features of libvirt. Then I created an LVM volume group where I wanted to place my machines at, but you can also use simple images on your filesystem. The next thing I did was setting up a bridge in /etc/network/interfaces:

auto br1
iface br1 inet dhcp
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

You can now simply create your virtual machine with this command:

virt-install -n $hostname -r 512 -c /home/shared/apps/os/ubuntu/lucid-server-amd64.iso --disk path=/dev/virtdisks/bender --network bridge=br1 --vnc --vnclisten=0.0.0.0 --noautoconsole --os-type linux --os-variant ubuntuLucid --accelerate

Now connect to your host using VNC and install as usual. Another way is to use ‘ubuntu-vm-builder’, but I simply didn’t try… Make sure you limit VNC access to localhost in /etc/libvirt/qemu/$hostname.xml after installation if your network is unsecure.

To make your domain autostart on boot use:

virsh autostart $hostname

This will copy the appropriate xml configuration file to /etc/libvirt/qemu/autostart/.

It’s as simple as that. Way easier than patching a kernel for Xen and all these things. I would have really loved to see Xen in vanilla Kernel a year ago or so, but it didn’t happen and KVM works well enough for me by now… plus you have the benefit of a working power-management.

Take care.

How to OpenVPN on OpenBSD as Layer2 VPN

Getting OpenVPN running on a recent OpenBSD pretty simple. I run OpenVPN 2.1 on OpenBSD-current as of 2010/03/10 (almost 4.7) with PSK as a layer2 VPN. Layer2 because I have some zeroconf/bonjour stuff running at my LAN and I want to connect to my iTunes shares through the VPN. I’ll make it very short: Install OpenVPN from packages (or ports if you want to), configure a bridge, create a PSK and create a simple config file.

pkg_add http://ftp.openbsd.org/pub/OpenBSD/4.7/packages/amd64/openvpn-2.1.0.tgz
ifconfig tun0 create
ifconfig bridge0 create add fxp0 tun0
openvpn --genkey --secret /etc/openvpn/server.key

Paste this to /etc/openvpn/server.conf:

proto tcp-server
port 1194
dev tun0
dev-type tap
secret /etc/openvpn/server.key
push "route 10.1.0.0 255.255.0.0 10.1.16.1"
persist-key
persist-tun
ping-timer-rem
keepalive 10 60
user _openvpn
group _openvpn

To make OpenVPN start on boot create /etc/hostname.bridge0 with:

add fxp0
add tun0
up

And /etc/hostname.tun0 with: (I had to set link0 to get it working)

up link0
!/usr/local/sbin/openvpn --daemon --config /etc/openvpn/server.conf

That’s it. You can reboot to test if it’s working or just run OpenVPN with

/usr/local/sbin/openvpn --daemon --config /etc/openvpn/server.conf

A simple client configuration would look like:

proto tcp-client
dev tap
remote you.example.org 1194
secret ./your.key
persist-key
persist-tun
ping-timer-rem
keepalive 10 60

Hint: Use DynDNS or something similar to use OpenVPN with a dynamically assigned IP-Address.

How to Setup Ubuntu Lucid as a TimeMachine Server

I think starting with Lucid, Ubuntu ships netatalk 2.0.5 which makes setting up Linux as a TimeMachine server much easier. You no longer have to compile on you own nor do you have to create the sparsebundle.

Just install netatalk and avahi-daemon if you want to, add options:tm to AppleVolumes.default and you’re done.

aptitude install netatalk
echo /home/shared/timemachine  "TM" options:tm >> /etc/netatalk/AppleVolumes.default

If you want the service to be advertised on your LAN also install avahi-daemon and create /etc/avahi/services/afpd.service with this content:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

Now you have to point TimeMachine to the TM share and that’s it. As long as you have a server with enough free space running at you LAN that saved you a lot of bucks compared to buying a TimeCapsule.

How to Use Google Apps as a MobileMe or Exchange alternative

I already wrote about Google Apps as a mail-hoster for your own domains. Today I’m going to talk about Google Apps for almost everything else you might need for your office or personal organization. I just set up Google Calendar and Google Address book synchronization on my Google Apps account.

Your Gmail account also has the Calendar, Contacts, Sites and Docs features, but you can’t collaborate with other employees or members that good. On the other hand you have many other features like Reader or Picasaweb within one account.

I used to use Funambol for contact synchronization, but with my iPhone or my Mac or anything else but Thunderbird synchronization was very beta like and crashed my Contact database several times. Plus they went commercial a few weeks ago. My self-hosted Calendar also didn’t sync very well with my computers and mobile devices which is why I was looking for a more reliable solution.

And although I don’t really like the Idea of storing personal information like Contacts and Calendars at the servers of a company like Google, the way better synchronization compared to my previous and the other (free) solutions I tried, made me switch to Google Apps for these two tasks. And I really like it!

Google Apps provides Microsoft Exchange and CalDAV functionality, so you can sync your contacts and calendars to almost every client and device you want. Read more…

Christian KildauHi, my name is Chris. I am a wannabe photog, traveler & geek that lives in Hesse, Germany.

more about me...

PayPal - The safer, easier way to pay online!
Please consider supporting me


Advertise here Advertise here Advertise here Advertise here