sesam.hu

Engineering Manager | Trail Runner | Stockholm, Sweden

How to make a linux server appear in Finder

Update 1: Added nss-mdns service and runlevel defaults.

For a while now I've been battling with the router my ISP gave me. In the name of user-friendliness it has a Japanese administration interface with a lot of katakana for the IT terms. More importantly it simply doesn't offer IP issuance over DHCP based on MAC addresses. Which means with the linux box and the MacBook switched on and off randomly they'd get completely different IP addresses and I have nothing to prevent that.

router

(The MAC Address Filtering only works if the wireless extension is installed, not with wired LAN.)

Now that started being a major nuisance after I shared everything via NFS. OS X can connect to NFS shares with the Command+K  "Connect to Server..." option in Finder but it needs the IP address of the machine. I also set up the NFS server to accept connections only from the IP of the MacBook - I don't like open doors - but then that had to be changed as well every time the bloody machines swapped IPs after a restart.

Not too sophisticated.

It recently occurred to me that there must be some implementation of the zero configuration networking technology of Apple called Bonjour. The idea behind this is that no matter what their IP is machines broadcast the services they offer and find each other on the network without any user interaction whatsoever.

A prime example is when there are two Macs on a network and you set up file sharing on one of them in matter of seconds it will pop up at the "Shared" section of the other's Finder. With Leopard this feature has been extended so Windows machines are recognised automatically as well. When I visited home upon connecting to the LAN the public shares of all the Windows PCs in our house appeared almost instantly. After supplying the usernames and passwords of the respective computers I could browse the files without configuring anything. (You need to set up Samba - well not as much set up more like tick a checkbox in the System Preferences - if you want Windows computers to see Mac shares over the network.)

I think we can all agree that the zeroconf approach is pretty cool. But what if you have a linux box?

Surprisingly it didn't take long at all to figure out a solution. I wonder why I didn't do it earlier to be honest. Here's how it should go on a Gentoo box:

Step 1, Set up netatalk, the open source implementation of AFP, Apple's file sharing protocol. After emerging it needs a few tweaks. In /etc/netatalk/netatalk.conf some protocols are better switched off.

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

Now add the last line to /etc/netatalk/afpd.conf to configure the AFP daemon. (Make sure it is one line with no line break.)

- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh

Then proceed on configuring the shares. They can be added at /etc/netatalk/AppleVolumes.default but I just went with the default sharing of the home folder.

With the following command add the netatalk daemon to the default runlevel (so it autostarts every time with the machine) and start it.

rc-update add atalk default
/etc/init.d/atalk start

Step 2, Configure Avahi, the open source replacement of Bonjour (zero configuration networking). AFP shares is one thing but if you want them to pop in Finder without any hassle you need Bonjour to advertise their presence on the network. Apple has its own source code available for linux but I found mDNSResponder vastly inferior to Avahi. (i.e. I had no idea how it worked...)

Avahi needs a config file at /etc/avahi/services/afpd.service to contain the following:

<?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>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

The txt-record entry specifies the type of machine OS X will think your share is on. This will result in OS X machines to display your linux box with a nice Xserve icon. Undefined shares get an Apple monitor icon or a Windows CRT with BSOD on it as far as I know.

Update 1: In order to be able to use machine names instead of IP addresses from the linux box you will need to emerge the nss-mdns package too. In /etc/nssswitch.conf find the line starting with hosts: and add mdns to the end of the line. Mine looks like this now:

hosts: files dns mdns

Finally add to the default runlevel and start Avahi as well.

rc-update add avahi-daemon default
/etc/init.d/avahi-daemon start

Step 3, profit. That's all to it because after starting Avahi an icon for the linux box will appear in matters of seconds in Finder. Press Shift-Command-K to go directly to the Networks location and wait for your server there. When it pops a double click will result in a can't connect error but don't panic. Just use the "Connect As..." button and specify your linux username and password. Congratulations, you can now browse the linux server as if it was any other Mac on the network.

lillemor in osx

If you want to use more types of services the Gentoo Wiki page on Avahi can help with the configurations. If you'd like to use the linux server as a Time Machine backup location Matthias Kertschmann's guide explains that as well. My post is based upon his guide except I changed the file locations to their Gentoo equivalents.

It is important to mention that if you run any firewalls on the machines they need to be disabled or adjusted to work with Bonjour/AFP. This mainly means you have to allow communications over port 548 and 5353.

Still Flying

I'm alive.

Nothing is broken, but it's the International CSS Naked Day! :D

Kitto Katsu

Szégyentelen tartalomrablás Komavárytól - ez percekre letaglózott reggel:

A Kit Kat japán sikerért két dolognak köszönheti: az egyik az egyre extrémebb ízvariáció, időszakos és helyi specialitásokkal (mint ez itt fönt), a másik pedig a neve.

Különösen a középiskolai, egyetemi felvételik időszakában ugrik meg a Nestlé slágercsokijának az eladása. Hogy miért, azt szerintem először még a cégnél sem tudták, azután gyorsan kapcsoltak, és manapság már direkt készülnek. Például ilyen bögrékkel:

Kit Kat bögre

Ami elsőre furcsa lehet, az az, hogy ez bizony egy ötszögű bögre. De miért?

Nézzük a márkanevet! Japánul ez úgy hangzik, hogy Kitto-katto (キットカット). Ez pedig majdnem ugyanaz, mintha azt mondanánk: Kitto kacu! Vagyis きっと勝つ, azaz tuti nyerek, tuti meglesz. És miért ötszög? Hát mert aminek öt sarka van, az gokaku (五角), ha egy kicsit megnyújtjuk, akkor lesz belőle gókaku (合格). Vagyis sikeres vizsga.

Ez így már erős talizmán, nem véletlen, hogy vezeti a vizsgakabala-ranglistát az ötszögű ceruza (szintén gokaku) és a piros szalaggal átkötött ötjenes (go en (五円), ugyanígy hangzik a goen (御縁), a nagy szerencse is.) előtt.

Eszement japán szójáték-logika. Plusz ráébredtem, hogy valójában micsoda talizmánom volt nekem: az első napomon Japánban találtam egy ötyenest a kampuszon, még anno Tokyoban. Később ezt a kulcs-strap telefontartó madzagjára kötve tartottam mindig magamnál, mint szerencsepénzt. Persze fogalmam sem volt az ötyenes különleges voltáról.

Aztán nemrégen végleg megadta magát a telefontartó cérnája: teljesen elkopott és elszakadt. Lehet, hogy az elveszett szerencsepénztől lett ilyen kimenetele a vizsgáimnak? (Nem.)

Through gritted teeth

It's been a bit hard writing to this journal lately, because I wasn't sure about sharing what really was on my mind. After all once something is out there is bits and bytes there will always be a way to retrieve it. There's no going back, and eventually too much honesty will surely just blow up in my face.

Anyway, readers with a keen eye to details should already have asked themselves: if the first posts from Japan are dated from April 2004 and the scholarship is for 5 years then what the hell is he still doing over there?

Well, the reason is that I have failed. At the end of my eighth semester I didn't have the required number of credits to graduate.

Just writing this down is hard, because I wasn't thinking of myself as a person who couldn't finish university on time. When it came to studies I was considered smart, successful. Well that's the past, so now I feel very angry - mostly at myself - and terribly awfully ashamed. Not wanting to look people in the eye ashamed. (Good thing there's this site and I don't actually have to talk to anyone.)

After all many have overcame this obstacle before. And not even with substantial hardships at that. I can visualise their gloating faces and the I told you sos quite well. I shudder at the thought of becoming the anecdotical example reminding the future generations who come here to study what to avoid.

But really, how did it come to this?

I could put the blame on external causes. In general, Japan as a country and its inhabitants as individuals have never really warmed up to the non-Japanese. I have always been viewed as the unwanted problematic foreigner in classes and never received much help or encouragement from the professors. Rather some had me failed just on the account of being a nuisance. In addition to that the credit system is one of the strictest here in Kobe, with not much room for mistakes, at least compared to other Japanese universities. I couldn't just take a lot of classes in hopes of passing at least a good number of them because there is a limit on how many credits a student can take per year. This limit - while more than enough for the Japanese - can be problematic if we take into account the fact that I am not quite fluent in the language just yet. Of course this has never been seen as an issue by the administration, not even when I asked if I could try and take a few extra credits' worth of classes in my last semester. Rules are rules and they won't be bent for some filthy gaijin.

At the end of the day however none of these matter and I can only blame myself. I applied for the scholarship. No one forced me. I knew it was not going to be a walk in the park. I knew that I shouldn't have been lazy about certain classes, that I should have just forced myself to sit down and study all night if I had to. I should have taken the first year of language studies a lot more seriously. I shouldn't have lost credits to absolutely stupid things like mistaking the day of the exam. I probably should have made more friends, especially with locals. Because now everyone else I knew finished and went home and I am here pretty much alone. I was even told I should have had a Japanese girlfriend: if anything that would have had a great effect on my language skills.

I didn't do any of the above and now I'll have to stay in Kobe for another semester. To make matters worse naturally the scholarship is over, I won't receive a penny anymore. I'll have to pay tuition and living expenses. And by 'I' I mean my parents of course. Ironically the recent changes in exchange ratios just doubled these costs. More reason to feel contrite.

But there isn't anything else I could do. I am not about to just drop out and fill shelves in a supermarket. Even though when I finish, if I finish, prospects won't be much better. At the age of 26 a simple BA degree is hardly impressive. Of course with no agreement between Hungary and Japan this degree will worth exactly nothing at home, as if I didn't have one.

Well, least I have seen a part of the world most people will never, I guess.

New home

The transition to the new host has finished. SeSam.hu is now powered by wpress.hu. It still might take a few hours for all the DNS servers to update and direct here, but essentially all's done. The RSS feed is still under FeedBurner so that should work without readers noticing anything.

The transfer was surprisingly hassle-free. I received a lot of help: I only needed to provide the data to be uploaded, and the rest was done for me. The new server seems a lot snappier as well, so I think I made the right choice.

You may have noticed that the /WordPress part disappeared from the address (if it didn't you are still on the old site). This is a change I've been wanting to make for a while now and this server move provided a good opportunity. The links in the posts have been fixed as well.

As usual, should you stumble upon any, please do report any possible malfunctions or broken links via email or comments.

More eggs of the Easter kind

I am sure this is nothing new to people who scout out for such stuff but a guildie just found out that in the Dalaran sewers' arena circles the later to be Teenage Mutant Ninja Turtles are receiving training from a wizened rat:

ninja-turtles

If you leveled any character in vanilla WoW I am sure you remember fondly of the Darrowshire questline, that started by the ghost of little Pamela Redpath. The inventory icon of her doll must have been the single creepiest drawing in game at that time. Now with the Culling of Statholme event in the Caverns of Time you can find the whole Redpath family, all of them alive still, on the second story of the inn. Pamela even has the infamous doll on the bed:

little-pamela

While browsing wowhead.com for links I also stumbled upon this masterpiece; a player named Cranius was so inspired by the Darrowshire questline that he made a music video with an original song telling the tale of the Redpaths. Now seriously, you can claim that most MMO players are mindless addicts, but gems like this video prove that it's not all about wasting time in front of a computer screen... if you ask me.

[youtube]http://www.youtube.com/watch?v=1dTxcHulFBI[/youtube]

fee.fm

In a surprise move today last.fm announced that their radio feature will only be available for subscribers outside the US, UK and Germany. Subscription costs 3 Euro for a month. The way I understand it this will affect everything from friend channels to recommendation radios. Non-subscribers will be eligible for 30 tracks of free samples then they will need to subscribe to continue listening.

The only grey area for me is how they will decide who's in the US and who's not. Is this based on IP-detected geolocation or simply the user's country setting? Also if I downloaded my iPhone app from the US iTunes Store do I count as a US user?

It is easy to tell that even though 3 Euro is not that high a price this change will be extremely unpopular. The announcement post is already filling with comments expressing emotions ranging from dissatisfaction to pure white hot rage. And I am not entirely sure that that the sometimes really bad quality, slow streaming and "not enough content" errors won't prevent many from even considering subscribing.

It would really be helpful in understanding the situation if they actually released any information as to why this change was necessary. Is it the music industry trying to squeeze more money out of them or a corporate decision from CBS? Also what is the money going to be used for? Is it going to fill the pockets of the label owners or the actual musicians?

Sorting out the issues with the radio service and the usually meager content first wouldn't have been a bad idea either. People are a lot more likely to pay for something that's actually worth it.

NIN/JA

Just received to my mailbox: NIN's giving away more free tracks. This time a five-song sample from the new Nine Inch Nails / Jane's Addiction US tour can be downloaded free of charge.

ninja2009-ep

Isn't this a great idea by the way? Providing a few songs surely attracts attention to the tour. The costs - I presume - are minimal since these numbers are already recorded and mastered. The band just needs a site to download from. If I lived in the US this would surely make me want to go to a gig more than any flyer or ad.

New Terrorism

A „bárki-bármit-bárkiről-bárhol” – mértéket, határt, szabályt, normát, törvényt – nem ismerő sajtószabadsága, amelyben láthatatlanná válik, „csuklyát ölt” a „véleményét megfogalmazó” személy és amelyben a szerző és a szerkesztőség azonosíthatóságával együtt megszűnik a minden nyilvánosan közölt véleményért viselendő állampolgári, emberi és szakmai felelősség – nem a szabadság, hanem a vadság új állapota, amely káoszként, lélektani hadviselésként, hétköznapi média-terrorként ölt sokszínű alakot. (forrás)

Via Yummie.

Nos, kedves Szilágyi Ákos, welcome to the internet. Vajon a 4chanon jártál már?

Ezt a bejegyzést csuklya hiányában kapucniban írtam.

boys and girls

Új Nike+ őrület: férfiak a nők ellen. Azt hiszem ennél ősibb ellentétet nehéz lett volna választani. A hivatalos TV szpot alant.

[youtube]http://www.youtube.com/watch?v=wLyFlDAikac[/youtube]

Ebből persze mi magyarok sem maradhatunk ki. A futóblogon több challenge is fut egymás mellett: öt héten át öt-öt szerző versenyez, az olvasók is külön kihívást kaptak, és van egy országos párbaj is. Úgy éreztem ezek után muszáj lesz még egy félmaratonnal elvenni a lányok kedvét...

boys-vs-girls

Ezzel kapcsolatban még híres is lettem.