ldd for Mac
In order to find out about shared library dependencies the command
ldd is used. Well, at least on every UNIX system I worked at, except on Mac OS X. There the command:
otool -L
lists all shared library dependencies.
Manage your Papers
Do you have many research papers on your hard drive and a hard time to find the right one? Maybe Papers can help!
Only by accident I stumbled over Papers. As iTunes helps you to effectively manage your big collection of music, Papers helps you to keep up with a large collection of research papers. Of course there are many other features as well, but you best check them out yourself.
Disable Startup Services on Mac OS X
If your running services are cranked up by SystemStarter and you want to quickly disable them, it is enough to create a .disabled file in the respective directory to stop SystemStarter from starting that service. Thus if I wanted to disable the automatic startup of my PostgreSQL database, I would create the following file:
$ sudo touch /Library/StartupItems/PostgreSQL/.disabled
Funny enough I could not find any official documentation apart from the following blog entry for this.
Haskell - A Beautiful Programming Language
If you push something hard enough, it will fall over. I have been pushing my horizon a bit further and it fell, as it were in the right direction.
The reason why it was so quiet here can be totally attributed to my newly discovered passion for Haskell. I do not really want to state all the language features and why it is such a beautiful language since that is described in many other places in much greater detail than I would wish to do here. On the contrary! What I want to is to outline my learning curve a bit, which might be beneficial for someone else who is seeking to learn Haskell.
My first contact with Haskell was at the University of Edinburgh and Simon Thompsons book Haskell – The Craft of Functional Programming was a very good companion at the very beginning. It also offers a very good description of Haskells type system and includes many many examples. While working through the book many of Haskells features are conveyed by the author. If you have never really used a functional language before the book also teaches you many programming idioms used in the declarative world of functional programming.
The only part I didn’t really like about the book was the chapter about Monads. You are surely asking yourself what in the world monads are and why one needs them? The short story is that monads in Haskell are used to ‘safely‘ perform side effects while maintaining all the nice features a pure functional language with lazy evaluation provides.
Having said that, it is really necessary to grok the concept of monads in order to enjoy the full beauty of Haskell. In my opinion the paper Tackling the awkward squad: monadic I/O, concurrency… by Simon Peyton Jones has one of the best explanations of what monads are. Also Phil Wadler has many nice papers about monads from which I would personally recommend the paper “Imperative functional Programming”. Armed with this kind of information, it should not take long for your brain to comprehend monads.
Haskell has a very powerful type system. Coming from the imperative world I wasn’t really able to comprehend the power of it. Here another very good book, namely Types and Programming Languages offered a great introduction into the topic.
Of course there are many other very good books and papers out there but for the moment this should suffice. Happy hacking with Haskell :-)
To be released soon - Soekris net5501
Forget about Apples all new Airport Extreme and all the other wireless AP products, as soon as this board will be released and ready for sale, I will replace my Firewall and WLAN access point with it, leading to a dramatic noise reduction in my living room, and rock solid stability and security because it will run OpenBSD – there is NO other alternative OS for such a task!
Exploiting Parallelism in Multi-way Recursive Methods
My code generator which is still in the prototyping and experimentation phase does a lot of recursive tree traversals which is quite obvious since it needs to match tree patterns and emit code for abstract syntax trees (AST).
Especially during the code emission phase which does a top down left to right tree traversal it would be nice to recursively evaluate child nodes of an AST in parallel if the evaluation of the child nodes does not yield any side effects. The following paper nicely describes how to transform standard multi-way recursive methods into parallel mutli-way recursive methods in Java.
The transformation described is quite simple and works well for direct recursion. However, due to the attribute type grammar I want to use for my tree pattern matching code generator and the way most tree patterns are augmented with semantic actions, it seems that it would cause a bit of a mess, or at least require a lot of careful thinking how to integrate such parallelism into the tree pattern matching grammar and the code generator which is produced by the grammar specification.
Unfortunately right now this idea can not be assigned a high priority and must be post-poned…
Cool Language Bookmarks Collection
Today I took a look at Klaus Hartkes web page and found that he maintains a collection of valuable links about Programming Languages! Very nice indeed!
Switch Terminal window focus with mouse movement
According to this blog entry, it is possible that the window focus follows the mouse between terminal windows by typing the following in the Terminal:
defaults write com.apple.Terminal FocusFollowsMouse -string YES
Now quit and restart the Terminal to let the changes effect.
All purpose functional language Haskell
- Concurrency Support
- Gtk+ GUI Bindings
- Possibility to execute external commands
- HAPPY: A Parser Generator for Haskell
With these tools I could go ahead and start implementing the all new functional PortBrowser if I had the time to do it…
OpenSolaris Tips and Tricks
OpenSolaris is SUNs attempt to pretend they are open source. This page should be a place holder for information concerning things like installation, administration and other peculiar things.
Some useful documentation can be found at the SUN Solaris website:
- [Developer] http://www.opensolaris.org/os/community/on/devref_toc/
- [Community Tools] http://opensolaris.org/os/community/tools/
- [OpenSolaris] http://www.opensolaris.org/os/community/documentation/
- [SUN] http://docs.sun.com/app/docs/coll/47.16
Setup
System Setup
One can use the Solaris Management Console for system setup:
/usr/sadm/bin/smc &
LDAP Setup Client setup is described here:
Zone Setup
- [Zones] http://opensolaris.org/os/community/zones/
- [Zone Examples] http://users.tpg.com.au/adsln4yb/zones.html
Network Setup
Useful documentation can be found at:
- [Network Setup] http://solaris-x86.org/documents/tutorials/network.mhtml
In order to get a network interface configured for dhcp do the following:
touch /etc/hostname.{interfacename}
touch /etc/dhcp.{interfacename}
ifconfig {interfacename} dhcp start
ifconfig {interfacename} dhcp status
Note: When setting up a server and name resolution does not work even though /etc/resolv.conf has been created correctly, try to do the following:
cp /etc/nsswitch.dns /etc/nsswitch.conf
This must be done in order for the system to use DNS servers.
Software Package Management
Software packages for OpenSolaris can be administered with the Product Registry GUI:
prodreg
- [Prodreg Guide] http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5v5?a=view
The prodreg utility really sucks and there is a better way to install 3rd party software packages, namely with pkgadd:
pkgadd -d /cdrom/cdrom0/Solaris_11/Product SUNWbash
The previous command would add bash the bash package to the system.
Installation of SVN is described here, but it does not support SSL so install SVN through pkg-get (see next subsection):Proper Package Management for OpenSolaris
OpenSolaris base installation sucks! Since we want more cool software to run and a nice package management front end, pkg-get should be installed:
/usr/sfw/bin/wget http://www.blastwave.org/pkg_get.pkg
pkgadd -d pkg_get.pkg all
More information can be found at:
- [Package Management] http://www.blastwave.org/howto.html
sudo, vim and subversion with SSL support are easily installed through pkg-get.
Zone Manipulation
The zone manipulation commands are quite similar to the ones used for XEN:
zoneadm list -cv # list all zones and their status
zoneadm -z vfm boot # boot vfm zone
zlogin -C vfm # login to vfm zone over the console
Perl and CPAN Workarounds
The CPAN version distributed with OpenSolaris is terribly broken! The following checklist should help to configure CPAN:
- Make sure GNU make is used and can be executed as a root user. I just symlinked gmake into a directory which is in everyones path:
ln -s /usr/sfw/bin/gmake /usr/bin/make
- If you haven’t already done this during the openRTSP compile procedure do the following:
sudo ln -sf /usr/sfw/bin/gcc /usr/ucb/cc # this is a bug workaround for OpenSolaris
- Do NOT upgrade CPAN through the CPAN shell! You have to do it manually! Thus download the cpan module from cpan.org, and execute the following commands:
perl Makefile.PL
make
make test
sudo make install
- Change CC (C-Compiler) parameters which CPAN and Perl uses since they have options for the SUN C-Compiler which are not known to gcc:
sudo vim /usr/perl5/5.8.4/lib/i86pc-solaris-64int/Config.pm
....
- change cccdlflags from '-KPIC' to '-fPIC'
- change optimize from '-x03 -xspace -xildoff' to '-O3'
....
- Now you can start CPAN and install modules:
sudo perl -MCPAN -e shell
OpenRTSP
In order to compile OpenRTSP for OpenSolaris do the following:
genMakefiles solaris
sudo ln -sf /usr/sfw/bin/gcc /usr/ucb/cc # this is a bug workaround for OpenSolaris
Parallels and Qemu Installation
In order to install OpenSolaris in these virtual machines, it is necessary disable dma for cdrom atapi devices. For more information check this link http://www.inf.furb.br/~javito/?p=39.
