• Disable OSX Lion from re-opening saved app state

    If you are like me, hate to see all closed files or tabs coming back after re-opening applications in Lion, you won’t be pissed any more.

    Basically, Lion saves every single thing you do in every single applications in~/Library/Saved Application State. This is where the problem rises. Every applications will look at this saved state while opening up and will try to restore back to the same right before you closed, which I find this behavior annoying.

    To fix it: You have 2 choices,
    1. disable write-access to this directory, by using chmod command. This will disable in every apps or by each app depending on which directory you are changing.
    2. disable savedState per application by using command

    defaults write [application_name] NSQuitAlwaysKeepsWindows -bool false

    where application_name will look like following:-
    >> com.microsoft.Word for Microsoft Word
    >> com.apple.Safari for Safari
    >> com.google.Chrome for Chrome

    Example, to disable saved state for Microsoft Word, do as following:-
    defaults write com.microsoft.Word NSQuitAlwaysKeepsWindows -bool false

    You can find by open ~/Library/Saved Application State and look at the name. Unfortunately, Lion also keeps ~/Library hidden too. You can fire up terminal and typeopen Library to open ~/Library in Finder and go through quickly.

    To revert action: just use the same command with -bool true

  • afpd on Debian

    When you are on #OSX regularly, CIFS/SMB is not that good option. What you would need to do so is installing afpd and bonjour. Obviously, they won’t name as they are in Apple product. Their package names are netatalk and avahiconsecutively. Installation is as easy as one regular apt-get.

    Setting up both at the same time, then we would configure later.

    # apt-get install netatalk avahi-daemon libnss-mdns

    After installation, we need to configure a bit for both service.

    afpd — what we are going to do now is to disable legacy Apple File protocol back in pre #OSX time which we don’t need.
    # vim /etc/default/netatalk

     # enable new service
    # disable legacy service 

    All you need to do is making sure if these values are assigned correctly. Next, we have to declare sharepoint. You can append to these new settings to the end of this file.
    # vim /etc/netatalk/AppleVolumes.default

    /your/path VolumeName allow:@groupname options:usedots,upriv

    You can do a share by username.

    ~/ "$u" allow:myusername options:usedots,upriv

    For Time Machine, you can do this; it might be a good idea to limit volume size before Time Machine takes over the whole drive by using volsizelimit:100000 in MB; 100000 = 100GB

    /home/username/TimeMachine "TimeMachine" allow:myusername options:usedots volsizelimit:100000

    Restart netatalk to see the change
    # /etc/init.d/netatalk restart

    For more info: http://linux.die.net/man/5/applevolumes.default

    Avahi (Bonjour)
    Next, we need to do help setting up bonjour or avahi. A setting file is/etc/nsswitch.conf which is belong to mDNS (mDNS comes helping hostname resolution.) we need to enable mdns module by add “mdns” to hosts: line as following:

    hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

    Last but not least, we customize how any device see afpd. Create a new file named/etc/avahi/services/afpd.service and paste this in.

    <?xml version="1.0" standalone='no'?><!--*-nxml-*-->
    <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
     <name replace-wildcards="yes">%h</name>

    You can change model to something else which change icon you will see on #OSX client side. AppleTV, iMac, MacPro, Xserve, MacBook, MacBookPro, MacBookAir, Macmini, etc.

    Restart avahi-daemon to see the change

    # /etc/init.d/avahi-daemon restart

  • MacJournal to Evernote

    I was a short-period Evernote user after OneNote took over by all features and everything many years ago. However, once I moved to Mac OSX, I had yet to find a right tool as OneNote alternative. Although VMWare Fusion 4 has been improved over the years, why on Earth I have to keep Windows running wasting my memory at all time.

    I tried a lot of alternatives: OneNote on VMWare Fusion — Unity view of course, MarsEdit,OmnifocusCircusponies NotebookJournlerMacJournal, Springpad (webapp), Catch (webapp.) As a result, MacJournal it was by its simplicity for months. However, lacking of synchronization sucked big time, esp. with all mobile devices. Then there was an underdog option showing up again. Evernote. At least this piece of software was built with cloudsync in mind.

    Well, this time, after couple years w/o using EverNote, I could say that it’s been vastly improved. It’s still far from OneNote counterpart, but this is all you can get on OSX. The question left is how to move all data in MacJournal to Evernote?

    Like everybody else. I googled for a solution; I found a script which gave me an error, at least for me. Suddenly I thought of why we have to complicate life this much. So I decided to select all my journal entry, drag them all and drop into Evernote!

    Boom! it works! way too easy, right? it works beautifully also. Evernote will show up tons of windows when it completely grabs each journal, but you can always wait a bit and close them all at once with cmd+q. After reopening Evernote, you would more than happy.

    note: downside — tag doesn’t come along, but there is always a search, right?

  • FreeNAS 8 – cave man can do it

    It’s FreeNAS. It’s easy. Set it and forget it with full fledge NAS you can’t find anywhere else. Well, it might not have DRBD, but for home/personal or even small business should be able to cope with rsync easily.

    At least, this version makes me happy. My SS4200 comes alive w/ port multiplier; it just lives up to its potential.

    Kernel log speaks louder than anything.

    +pmp0 at siisch1 bus 0 scbus1 target 15 lun 0
    +pmp0: &lt; Port Multiplier 0325197b 000e &gt; ATA-0 device
    +pmp0: 300.000MB/s transfers (SATA 2.x, NONE, PIO 8192bytes)
    +pmp0: 300.000MB/s transfers (SATA 2.x, NONE, PIO 8192bytes)
    +pmp0: 15 fan-out ports
    +ada1 at siisch1 bus 0 scbus1 target 1 lun 0
    +ada1: ATA-8 SATA 2.x device
    +ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
    +ada1: Command Queueing enabled
    +ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
    +ada2 at siisch1 bus 0 scbus1 target 0 lun 0
    +ada2: ATA-8 SATA 2.x device
    +ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
    +ada2: Command Queueing enabled
    +ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
    +ada3 at siisch1 bus 0 scbus1 target 3 lun 0
    +ada3: ATA-8 SATA 2.x device
    +ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
    +ada3: Command Queueing enabled
    +ada3: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
    +ada4 at siisch1 bus 0 scbus1 target 2 lun 0
    +ada4: ATA-8 SATA 2.x device
    +ada4: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
    +ada4: Command Queueing enabled
    +ada4: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)

    Thanks, FreeBSD guys enabling this feature. Thanks, FreeNAS folks developing nice-and-easy NAS.

  • XP/Vista cannot load CD driver

    If you have a problem that your CD/DVD-ROM cannot be seen in my computer or exclamation mark on CD in device manager and you can do nothing about it, it can be fixed.

    How come does this issue happen?

    conflict happened when you have >1 CD drivers related installed. It might be from CD/DVD burning app, such as Nero Burning ROM, Roxie, or daemon app like Virtual CD, MagicISO and such.

    How to fix:

    First, uninstalling anything won’t help, neither will updating. What you have to do is getting into Registry editor (start “regedit”)

    Then, find “LowerFilters” and/or “UpperFilters” and delete them. Look carefully, you have to delete only ones in HKLH\System\CurrentControlSet\Control\Class\{4D36E966-E325-11CE-BFC1-08002BE10318} whose Class key is CDROM. However, you don’t have to worry much if you delete in others, you might have to restart more than once since Windows will have to detect and install the hardware driver again.

    After deleted those 2 keys, just restart once. Your CD/DVD will come alive.