Computer

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.

iOS 4, my iPhone 3G and me

It’s been almost two weeks since I upgraded from 3.1.3 to 4.0 on my old iPhone 3G and I must say: it’s slow!
iOS 4 feels much slower on my old 3G than 3.1.3. Apple, do you want to force me to upgrade by that? It’s annoying! I am willing to upgrade, but T-Mobile doesn’t want me to! They lost my pre-order… damn you!

Empty Trash issues in Snow Leopard

I recently had many issues with Mac OS X 10.6′s Trash. The problem is that, when you Empty the Trash in Snow Leopard, Finder sometimes can’t erase all items because some of them are still in use. The funny part about this is, that most of the time, it’s the Finder itself that still uses the items! I haven’t found a solution so far, but there are at least two workarounds which don’t require logging out or even rebooting.

The first one is to force a relaunch of Finder via Apple -> Force Quit and then try it again.

If that doesn’t help it gets more complicated. You will need to open Terminal.app or any other terminal emulator.

Then type ps auxw | grep <yourfile>. The output will look something like:

$ ps auxw | grep Scan.pdf
Finder     169 chrisk   13r     REG       14,2       286 1417024 /Users/chrisk/.Trash/Scan.pdf/..namedfork/rsrc

This might look complicated, but it’s actually simple. The first column is the name of the application, which uses your file, the second column is the PID (process ID) of the application, third column shows the username and the last column simply shows the path to your file in the Trash folder.

Now use ‘kill’ and the applications PID to terminate it.

$ kill 169

You should be able to empty your trash again.

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.

Mobile Office 2.0


I am back home! Well, at least until June :-)

After 6 weeks without a Laptop I am finally mobile again. The new MacBook Pro has been delivered last Saturday and I am totally happy with it. I sold my Dell XPS M1530 because of it’s unreliability and the ignorance of Dell, and switched back to a Mac. Build quality is so much better, and let’s not talk about the Touchpad, I don’t think I’ll need my Bluetooth mouse any longer!

The new MBP with it’s Intel Core i5 also feels much faster than my one year old Mac Mini.  And the display seems to be more accurate than my old 22″ Samsung LCD, so until I get to replace that one I think I’ll edit my images on the laptop. (Display calibrator is next on my shopping list)

Take care. I’m now going to copy last months images from the mobile HDD.

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).

Dell Crappiness

I heavily shortened this article… it just happened way too much between Dell and me to tell everything.

In Summer 2008 I bought myself a Dell XPS M1530. An actually pretty nice and very fast laptop. I mean… the first one I received was damaged, the touchpad wasn’t in place. But they managed to sent me a new one after a month or so and I was happy again.

Six months later I even wrote an almost totally positive article about the laptop, though they already had to change the fan once on-location.

Now, another 14 months later I have a totally different opinion about Dell. Since Summer 2008 I had 6 repairs. Not that that isn’t enough, but their pick-up service usually doesn’t show up in schedule and even if they do… all they tell you is “be there between 8am and 6pm”. Once they didn’t even show up, and another time they came two days earlier then scheduled so I haven’t had any chance to erase my data. Surprisingly exactly that time they changed the HDD, which actually worked fine. (More about that soon) Ah and did I mention that it takes two weeks until you get your laptop back?

But I’m not even at the worst point. The last two service requests were only needed because the technician damaged my laptop. The first time they bent the alu-cover, the second time the display cover and the HDD was damaged (Yes, they changed my HDD, kept my data and installed a damaged one!).

Now let’s come to the strangest point: Because I insisted on some kind of compensation for the damage on my laptop they generously offered me a one-time on-location repair which I should pay for!!!!!! Wait? I shall pay to get your mistakes fixed?I Errr… no! I then told them I contacted my lawyer and all of a sudden their so called “head of department” wrote me a mail that they would do a favor and do a one-time on-location repair for free to get things finally fixed.

I accepted… the technician showed up with about 12 boxes of spares. And changed everything except the screws and the DVD drive. Lol!

It now works well again, but decided to sell it. It’s caused too much stress.

Ah and here’s a short list of all the repairs they had to make in the past 20 months:
- Replace Fan (on-location)
- Replace Fan
- Replace Mainboard
- Replace HDD (came back with damaged Alu-cover)
- Replace Alu-cover (replaced Display, HDD and Alu-cover – now Display-Cover and HDD are damaged)
- Replaced Alu-Cover, Display-Covers, the entire case, Motherboard, Fan and HDD – on-location


Their eMail support is also pretty much a joke. You write with people somewhere in Bratislava, which don’t have any power to decide anything. All they do is clicking together platitudes. It took me 5 mails until they finally understood that I want them to forward my mails to their principal.

I now sold it. No more Dell.

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.

Christian KildauHi, my name is Chris. I am a wannabe photog, traveler & geek that is again a student and lives in Hesse, Germany. more about me...

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


enjoyyourcamera.com


Advertise here Advertise here Advertise here Advertise here
Nikon-Blogger-Linkring :: powered by KLUGERD Photo Blogs Blogs - Blog Catalog Blog Directory Photoblogs.org - The Photoblogging Resource blogarama - the blog directory