Ronald's Journal
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 9 most recent journal entries recorded in Ronald's LiveJournal:

    Tuesday, September 29th, 2009
    12:55 pm
    OS X, Apache and symbolic links
    Crossposted from Ronalds weblog, please leave any comments there

    I use my laptop a lot for web developement, and for some projects I have more files than just the web documents that Apache needs to see. For those I have a directory in my ~/Documents with (amongst other things) a httpdocs directory. I’d like to just see that in my browser by creating a symbolic link in my ~/Sites directory. This proved to be somewhat difficult in OS X 10.5 and also in my fresh installation of 10.6.

    Creating a web symlink in 10.6

    Configure Apache

    The installation of Apache that ships with OS X I use doesn’t allow symlinks by default, so I’ve added Options +FollowSymLinks in the Apache configuration. These are located in /private/etc/apache2 and while you could enable this in httpd.conf I like to keep the system-wide configuration as clean as possible and edited the (ronald is my username) instead. I’ve also added AllowOverride All there to be able to use .htaccess files, but thats another topic.

    Restart Apache by disabling and enabling “Web Sharing” in the sharing preference pane

    Create a symlink

    That’s just a matter of executing "ln -s ../Documents/website ." in the ~/Sites directory. Alas browsing to http://localhost/~ronald/website gives a 403 (forbidden) page. Inspecting the serverlog tells me that either apache is not allowed to follow symlinks (which it is) or the _www user hasn’t got enough rights to access ~/Documents/website.

    It’s all about permissions

    Well, that’s just stupid because the directory is readable/executable for everyone. Changing my ~/Documents folder to be world readable/executable did the trick. Apparently every directory in the path needs to be accessable. Damn me and my inferior UNIX permissions knowledge!

    So it’s either making my entire Documents directory world readable, which I don’t really like, or adding the _www user and myself to some group and change ownership of my Documents directory to that group to make my entire Documents folder readable for myself and the _www user, which is slightly less bad. So chmodding everything except the directories linked for web access inside the Documents folder 700 seems the right way to go.

    In 10.5 the holy grail was to mess around with the Access Control List but that wasn’t needed in 10.6, so I suggest leaving that part alone.

    Tuesday, September 22nd, 2009
    9:14 am
    Snow Leopard
    Crossposted from Ronalds weblog, please leave any comments there

    Once again I’ve installed some new OS and write a small post about it. This time it’s all about Snow Leopard and as usual this is probably more interesting for myself as a checklist sort of thing than for the world to read.

    Installation

    I’ve decided not to upgrade my existing installation of Leopard but to go for a fresh clean installation. Leopard was my first OS X installation and I’ve done quite some installating, customization and so forth and it sounded like a good idea to just start fresh. I remember reading something about a clean install option, but the installer just asks me for the location, gives me some options what to install and starts right away. I had to abort, reboot, and then used the disk utility on the installer DVD to first format my hard drive. Installation went smooth from that point on.

    First impressions are as expected, it works smooth. I am surprised about the time it takes to wake from sleep, almost instantly, but that can also be because this installation is fresh and I was used to my old cluttered Leopard.

    Afterwards

    Time to install some.

    • Firefox 3.5
    • Growl 1.2b4, the latest beta of 1.2 because 1.1 is uncompatible with snow leopard. It seems to work fine, as does the HardwareGrowler.
    • Perian 1.1.4
    • Spark 3.0b9 for global hotkeys
    • iWork ‘09 en iLife ‘09
    • Software updates (10.6.1)
    • Textmate
    • Latest flash version since Snow Leopard ships with an unsafe one.
    • MacTex

    And to tweak some.

    • Copied my old ~/Music directory, iTunes starts with my good old library. Hurray
    • Copied my old ~/Photos directory, iPhoto cannot open (made with a newer version). Running another software update was the key to success.
    • The first sync with my iPhone authorizes my computer with the iTunes store and gives me all my contacts back. Nice!
    • Uncomment the line LoadModule php5_module libexec/apache2/libphp5.so in /etc/apache2/httpd.conf to enable php5. Fortunately for me, snow leopard provides me with pdo_mysql which Leopard did not (and it wasn’t possible to just add that module).

    And to get stuck at some.

    • System clock, going to System preferences > International > Formats > Times (customize button) and changing the medium format doesn’t work anymore :(

    My ToDo list also has some.

    • mail multicolumn
    • mail imap subfolder check
    • spark firewall status scripts
    • adium

    More Tweaks

    Firewall scripts

    I take my laptop everywhere so I want to keep the built-in firewall fully closed at all times. I do, however, sometimes take it down if some sharing/program/game doesn’t work, and I almost always forget to enable it again afterewards. Thats what the following script is for. I use the cron daemon to run it every 5 minutes and it checks the firewall status and gives me a growl notification if it’s disabled.

    #!/bin/sh
    if [ `defaults read /Library/Preferences/com.apple.alf globalstate` -eq "0" ]; then
    echo Firewall is currently disabled | /usr/local/bin/growlnotify -a /Applications/System\ Preferences.app -t Warning;
    fi

    I also added an applescript to a global hotkey in Spark to change the firewall status. It checks the status, displays it with the options to change it with a timeout of 5 seconds.
    # brings the dialog window to front
    delay 1
    tell me to activate
    # read status
    set fw_status to (do shell script "defaults read /Library/Preferences/com.apple.alf globalstate")
    # check status, show dialog
    if fw_status is equal to "2" then
    set dlg_result to display dialog "Allow only essential services" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 3 cancel button 3 with icon note giving up after 10
    set res to button returned of dlg_result
    else if fw_status is equal to "1" then
    set dlg_result to display dialog "Set access for specific services" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 2 cancel button 2 with icon caution giving up after 10
    set res to button returned of dlg_result
    else if fw_status is equal to "0" then
    set dlg_result to display dialog "Allow all incomming connections" with title "Firewall Status" buttons {"All", "Specific", "Essential"} default button 1 cancel button 1 with icon stop giving up after 10
    set res to button returned of dlg_result
    end if
    # Check dialog result and set firewall accordingly
    if res is equal to "All" then
    do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 0"
    display dialog "Set to 'Allow all incomming connections'" with title "Firewall Status" buttons {"OK"} default button 1
    else if res is equal to "Specific" then
    do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 1"
    display dialog "Set to 'Set access for specific services'" with title "Firewall Status" buttons {"OK"} default button 1
    else if res is equal to "Essential" then
    do shell script "defaults write /Library/Preferences/com.apple.alf globalstate 2"
    display dialog "Set to 'Allow only essential services'" with title "Firewall Status" buttons {"OK"} default button 1
    end if

    And now I can easily change the status of my firewall

    Thursday, June 11th, 2009
    10:31 am
    Lekker plat
    Crossposted from Ronalds weblog, please leave any comments there

    iTunes Genius - Dikke lul drie bier

    Sommige dingen zijn dusdanig banaal dat een genie ze echt niet meer aan kan.

    Saturday, June 6th, 2009
    4:59 pm
    GeekTool
    Crossposted from Ronalds weblog, please leave any comments there

    GeekTool DesktopThe past couple of days I’ve been playing around with GeekTool a nifty litlle application that can show text files, unix commands output (including scripts), or images (local and from the internet) on your desktop.  There are many sites with examples out there which inspired me to create a GeekTool setup of my own.

    I started playing around with several scripts and GeekTool because it looked cool at first and it was fun to do some shell scripting. As the amount of information displayed on my desktop grew I started wondering why I was creating a lot of small processes taking up a little CPU time. I hardly ever look at my desktop because of all the windows in front of it. But the stats now on my desktop are easily accesable with one key (F11), and some starts are already displayed in either the menu bar or my iStat Pro widget. Removing it there gives me more room in the menu bar (which is starting grow full of icons) and saves some resources used by the widget.

    Now I shall explain the GeekTool entries I created more detailed.

    Read the rest of this entry »

    Wednesday, June 3rd, 2009
    1:07 am
    NetNewsWire
    Crossposted from Ronalds weblog, please leave any comments there

    NewsGator LogoThere are a lot of RSS readers out there, but since I have little requirements I just stick with reading my RSS feeds in Apple Mail. A few weeks ago the products of Newsgator got my attention.

    The application for the Mac looks pretty standard. Multiple feeds organisable in folders, three panes, the usual. The two things I like a lot after using it for a few weeks are the a build-in browser so you don’t have to switch back and forth between your browser and news reader and the support for HTTP digest authentication which is used by Livejournal to gain access to the feeds of livejournals including the protected posts (if your LJ account has access to those).

    The iPhone application is okay, haven’t used it that much.

    But the good part is, besides the fact that these are both free applications, that they sync with each other via a free account at newsgator, so when I read a post on my mac the same post isn’t marked as unread anymore on my iPhone and vica versa. They also provide a web-based RS reader when you login to Newsgator which is a nice extra which I probably won’t use. It only seems usefull when I have some time to kill somewhere when I’m around a computer with internet access and without both my laptop and phone. But it’s a nice extra.

    Tuesday, June 2nd, 2009
    9:36 am
    Errors
    Crossposted from Ronalds weblog, please leave any comments there

    Marbleblast Error
    Some error messages just do not display the way the developers intended them to.

    Twitterfon - not an error
    And sometimes being right is wrong after all.

    Sunday, May 17th, 2009
    11:42 pm
    The day the Apples fell from the tree
    Crossposted from Ronalds weblog, please leave any comments there

    I’m no fanboy per se, I just happen to like my MacBook and iPhone a lot. But not today, as today the battery of my MB broke down and my phone just crashed while making a photo. Also while rebooting I held both keys down to power down the thing which it didn’t respond to until after booting up and showing my background and asking for my passcode just for a second. Of course the timing could also just be a coincidence.

    Wednesday, May 6th, 2009
    10:31 am
    Mosh pit
    Crossposted from Ronalds weblog, please leave any comments there

    The fifth of May is liberation day in the Netherlands. I realy like the liberation festivals because there is always a realy unique atmosphere, a bit more relaxed and friendly than other festivals because everybody is celebrating their freedom. Perhaps this is only the case because I am celebrating my freedom and thus experience the festival different, but that doesn’t realy matter to me. I had a great time moshing around at de Heideroosjes concert, but when the band announched we were going to peform an old eighties tradition I realy had no chance to escape to the back (mostly because of all the people going to the front) and was literaly run over in the circle pit. Great fun for me, I just hope nobody got hurt whilst marching over my hard metal wheelchair :)

    Saturday, May 2nd, 2009
    7:34 pm
    Hello world!
    Crossposted from Ronalds weblog, please leave any comments there

    This is my first post on the third reincarnation of my weblog. It all started years ago when all of a sudden many people around me started with their Livejournals. I was socially forced to start one of my own, not in the least to keep up with their lives and be able to follow the conversations in my own house. As I felt the need to keep control of my blog in my own hands grow I purged my livejournal and created a blog on my own website.

    Now as a proud web developer I like to think I can create anything, and thus can write custom software which fits exactly to my personal needs. But as a lazy-ass blogger I don’t want to spend all that time reinventing the wheel, I want everything, and I want it now! Installing Wordpress comes close enough :).

    Now I have a way simpler way to write blogposts, and I hope I am going to because it’s fun, and even more fun reading back those posts later (I know this because I am importing old posts into this blog and really enjoy reading and formatting them). I also installed a livejournal crossposter, because the LJ people don’t do RSS or reading other blogs a lot. Lets see what happens.

Mijn eigen hoekje van het internet   About LiveJournal.com

Advertisement