Saturday, October 23, 2010

IPv6, dyndns and all the rest

I have a dream! And that is listening to music from my server without 10 minutes of foo to get it started. I am still working on a solution that is plug'n'play. There are two major solutions that i considered: A network audio system and a filesystem share with a local player.. Since Pulseaudio (and basically every other network audio solution except esd) doesn't have MacOS support and because my admin wouldn't install nfs and sshfs under Mac is a joke I am going to rely on esd.

Now that server needs to push its sound to me somehow and i wanted this to be done without thinking about firewalls, natting and the like. That is why i wanted it to work over IPv6 since this is virtually unfiltered in the networks i live in at the moment. The only problem is that i need to push the data not pull, so the server needs to know my ip. I thought: That's easy, just use dyndns.
What i didn't know is how difficult it is to get a dynamical dns provider that actually supports ipv6. I had a long list of services grabbed from some update client.
  • dyndns.* would have been my first choice, if it weren't for them only doing ipv6 in beta in their non-free custom dns scheme. 
  • freedns.afraid.org was next and it has a ipv6 enabled dns server which you get for free but you can't update it via the client api! :(
  • no-ip.com doesn't have v6 at all from what i could gather
  • ... 
By this time i was annoyed and googled more thoroughly again and found: majimoto. Now that guy is awesome. Seems to be a german who does web hosting in his spare time and was annoyed by the same things as i am and just made a free, client updatable ipv6 enabled dynamic dns available to the general public. YEAH! This guy deserves some applause.
Now onto esd :)
Update:  Joshua from afraid.org answered me and yes it is supported just not officially:
"If you create a IPv4 A record, go to 'dynamic DNS' and get the update URL, you can then append &address=<ipv6 address> (without <>'s) and it will convert the record into a AAAA record "

MacOSX and IPv6

MacOSX supports IPv6 natively of course but what good is that if your ^.*$ network administrator won't allow that. Now my dorm is part of a larger network run by an organization which really goes out of its way to provide IPv6 and they offer static tunnels (unpractical in my case), Teredo (not stable/performant enough by their own judgement) and ISATAP.
Now Snow Leopards ISATAP support is virtually inexistent. In fact it was only offered by ancient miredo versions and support was dropped in version 1.1.6. I could have lived with an old version since i don't suscribe to the idea of software magically turning stale over time although this meant compiling by hand in this case. The only problem is miredo is just such a bitch to configure that i couldn't get it to work for the life of me.

Anyway I then used the linux instructions for doing it by hand and converted them to the mac equivalents:
#!/bin/sh 
ISATAP_RELAY="10.156.33.6" # isatap-relay.lrz-muenchen.de
IPV6_PREFIX="2001:4CA0:0:FE00::" # LRZ ISATAP-Prefix 
IPV4=$(ifconfig $(route get ${ISATAP_RELAY} | grep interface | sed -e 's/ interface: //') | egrep '\' | awk '{print $2;}')
ifconfig gif0 tunnel ${IPV4} ${ISATAP_RELAY} 
ifconfig gif0 inet6 ${IPV6_PREFIX}5EFE:${IPV4} prefixlen /128
route -n add -inet6 default ${IPV6_PREFIX}5EFE:${IPV4}

Test with: 
ping6 www.lrz.de 

Sunday, October 3, 2010

Zuchini, Tomato, Spinach Risotto

Today I was inspired to make do with what i had (read I didn't go shopping, it was sunday and i was pretty much out of everything). I had Tomatoes (molding), Zuchini (overdue) and frozen, thawed, refrozen spinache, rice, noodles as well as half a grana padano. I was sick of pasta with sauce and thus sat there for a while, pondering and finally came up with a splendid idea: risotto



List of ingredients:
  • A pound of rice
  • 4 tomatoes (estimated from what was left after cutting out the mold)
  • A third of a pack of frozen spinach
  • A yellow zucchini
  • 2 cloves of garlic
  • A big white onion
  • Butter
  • Olive oil
  • 150g grana padano
  • A tiny rest of ginger that had to go
  • 7 sun dried tomatoes rehydrated
  • A tea spoon of rosemary
  • A tea spoon of basil
  • Broth (half a liter?)
  • The last dregs of red wine
  • The juice of one lime 
  • A lily for decoration (I didn't have basil) 
The rest works as always, cut it all finely (or press the garlic if you are lazy), put onion, garlic, and ginger in a pot with a big stick of butter and let it fry in that for a while; add zucchini. Meanwhile put olive oil in a bigger pot and add the rice, heat and stir. Once you feel its good add red wine, (in my case it was gone shortly after so i didn't have to wait). Wait a bit until its not soggy anymore, add all the veggies and keep adding broth while stirring but only so much that it is barely covered, once you're out of liquid, add spices and grated cheese, fold it in and enjoy.

I have plenty of ideas on how to make it better (for a start take fresh veggies and herbs instead of old ones) but this was so tasty that I am still surprised. I haven't quite figured out what made it so yummy.

Friday, October 1, 2010

US Alt Gr Intl

I was annoyed by the weird keyboard layout on my mac (de) way back and so i learned about ukelele and hacked up my version of us alt gr intl. The problem is i can't find the full version anymore. I believe the woman i will always love took it with her on her external hdd when she dumped me. I only got the minimal version i use left, which is plain us + umlauts and ß.
If that is of any use to you get it here.

Wednesday, September 15, 2010

Why MacOS is not ready for the Desktop yet

After owning my macbook air for roughly half a year and using it daily i feel quite entitled to some sort of small review. At first i was mad at it for behaving in ways i felt "wrong" but I overcame a few of those which were of course just the usual head banging experiences you have because something is different. Still after getting used to the mac way and using it rather extensively I still feel it seriously lacks in certain ways.

It's probably worth pointing out I'm not a "Mac Person". I've only used MacOS for about 6 months where I've used Linux for over four years now and Windows for like 15 years already. To be fair some issues wouldn't exist if you ran MacOS on better hardware but then again that's not a very standard or supported choice so I think it's valid to critize Apple for that. I will also not exclude problems coming from Safari, iTunes and Quicktime, since they're so integrated into the OS that they are essentially a part of it.

Ok. So what's wrong with MacOS that makes it not ready for the desktop? I've tried Leopard and Snow Leopard but will mainly focus on SL since it is the newer one. The issues fall into 5 basic categories stability, simplicity, consistency, size and comfort.

The first issue whose existence i found rather surprising is stability and i actually mean the crashing kind. Before switching to Mac I heard all these stories of a miraculary stable Unix System underlying MacOS. It was somewhat chilling to see how untrue that was. It is a triviality to crash Safari, Opera and Firefox on the Mac. I see at least one crash in these browsers once every two days but that's not all. Since I live on the Internet these are the most noticable nuisances but I managed to crash Quicktime and even the UI server as well. That one time when the UI server restarted every 5 seconds I even had to reinstall despite some rather advanced methods employed in trying to fix it. I have not seen a problem that forced me to reinstall Linux in years and even Windows is getting there. The regular user will not tolerate this sort of hickup and give up although I have used Windows long enough to overlook this until Apple has had more time to produce a stable OS.

The second issue is the lack of simplicity. First of all why do I need to hunt all sorts of packages for my system to achieve functionality that should have been implemented by the OS in the first place like custom keybindings, undervolting, fan monitors, usable keyboard layouts,... The list would go on for quite a while and I'm not even talking about hunting their dependencies. Of course for a few essential (and some not quite so important) pieces of software there is always fink and macports, but then both are still "source based" as in you have to compile all of it because there are no binaries for snow leopard. If I had wanted LSF or Gentoo i would have installed it in the first place. How can apple expect regular users to cope with such an incomplete desktop with no decent installer?

An important obstacle for a regular user is consistency: Of course anybody who learns a new system will feel uncomfortable when her or his old ways stop working and the new ways just seem wrong. This is painful but unavoidable and it was all worth it once you have learned new and better ways (I am not arguing to be as similar to Windows/Linux as possible that would be foolish). The problem is that shortcuts plain don't work the same across all applications. Yes some of the very basic work the same in every application which is very commendable (copy, cut, paste, Preference Dialogue), but a lot of important ones don't like Beginning and End of line, moving wordwise and selecting text in between. On top of that it would be a lot easier to remember differnt ways of working if they followed a philosophy (like all text editing short cuts using the ctrl key) but this isn't consistent either. This is confusing to the regular user and will make them unwilling to relearn their skills and overcome their muscle memory.

The fourth major matter of contention for me is size: Of course it is not as bad as Windows 7 for that matter but still I am struggling to keep my system with just bare functionality under 25 Gb. Getting rid of languages and more importantly code for different architectures is absolutely non-trivial and highly risky business and should not be necessary. MacOS really fails in this area and Apple should try to make amends if they ever want to conquer the regular user segment of the market.

The final major issue is comfort. It is just plain to hard to use comfortably and this encompases a lot of issues. Why does there have to be an update roughly every other week that forces me to restart the computer? Why does Apple make it impossible to swap a few keys or make more custom keyboard shortcuts possible and Yes I am prepared to argue that the default is brain dead. Why can't i reasonably use MacOS with either just mouse/touch pad or keyboard (i could live without mouse but keyboard is essential)? I guess this isn't all that import if you have a macbook but for standard desktop macs without a touchpad close to the keyboard this is just painful. And last but not least, why is there no compatibility for Windows applications and don't tell me about wine it's a very long way from usable even for the more tech savy user.. How is a regular user to switch to mac if all the programs he or she needs are Windows based. This really is more important than most people think. If the regular user is pushed too far out of the regions she knows and expects she will just not follow and instead go back to what they are used to even if it means an inferior OS.

I think of MacOS the way I thought of gimp years ago: a very promising product with a rather limited audience. Apple made a big effort that deserves admiration and MacOS really is a nice product for nerds and enthusiasts but too inconsistent, uncomfortable and idiosyncratic for the regular user. If MacOS is to make major inroads on the regular desktop it will have to receive a lot of polish before that.

Friday, August 27, 2010

Communication fail

I had an interesting fail combination today. First of all the d-link dir 655 i just bought decided to reboot roughly once a minute on average. This was somewhat unsatisfactory since the WLAN reconnect of my macbook takes over 20 seconds :).

So I started phoning the hotline, the number of which i already had from the day before. Now the fun begins: My phone doesn't support tone dial but the hotline insists on being directed by those which the nice lady explains to me as slowly as she can so it costs me 50 cents just to listen to her telling me to do something I can't.

I figured I could just turn tone dialling on on my phone but it doesn't have that feature either (Why is this so hard?). My next try was googling for a tone dial sound generator applet on the internet (this one works btw: http://www.dsptutor.freeuk.com/dtmf/ToneGenerator.html) and holding the telephone microphone close to the pc speaker but then my ISP screwed the routing and internet was down as well. :(

Great Internet down -> phone down -> internet down. Don't you love modern times.

Friday, August 20, 2010

What is forward/backward searching?

Forward searching (in this context) is the process of editing a latex file and by a keypress and some magic you are catapulted into your pdfviewer to the exact same point that your cursor was pointing to in your editor.
Backward searching is the reverse process, where you click on some place in the pdf viewer and you are then referred to the source of this text within your favourite latex viewer.

Requirements:
Vim/MacVim and latex-suite; some pdfviewer (skim here) with pdfsync support and one of the two latex/tex packages pdfsync/synctex.

To make it work in Skim you need to open the preferences, goto the sync tab and enter:
Preset: Custom

Command: mvim

Arguments: --remote-silent +":%line;foldo!" "%file"
Drop this code into a file in your path and make it executable
#!/bin/sh

/Applications/Skim.app/Contents/SharedSupport/displayline -r "$2" "$1" "$3"
 
Then put this into your vimrc file:
let g:Tex_ViewRule_pdf = 'pathtofile'

let g:Tex_ViewRule_ps = 'pathtofile'

let g:Tex_TreatMacViewerAsUNIX = 1
This was the only way i could get it to work under vim and macvim simultaneously. Then you just need one last line in every tex file you want it to work to set everything up:
\usepackage{pdfsync}
It's really that easy. Now in order to jump from vim to skim you need to type \ls and to get from skim to vim you would Shift+Command-Click
Try it; its grand. Enjoy!