Posts about macos (old posts, page 3)

2013-03-13 shortcut to put the display to sleep

  • ⇧⌃⏏ (shift+control+eject)


2013-02-02 How To Change Your Time Machine Backup Interval

tl;dr `` sudo /usr/libexec/PlistBuddy -c 'set"Backup Interval":Interval 86400' /System/Library/LaunchDaemons/ ``

method 1 : vim (or any editor)

  • open the file for edition

    sudo vim /System/Library/LaunchDaemons/
  • replace 36000 (one hour) by 86400 (one day), then quit:


method 2 : plistbuddy

  • you can make it in one line:

    sudo /usr/libexec/PlistBuddy -c 'set"Backup Interval":Interval 86400' /System/Library/LaunchDaemons/
  • this method use the PlistBuddy method to read / write the file. this utility can be used interactively

    sudo /usr/libexec/PlistBuddy  /System/Library/LaunchDaemons/
  • but also directly:

    sudo /usr/libexec/PlistBuddy -c 'print  ' /System/Library/LaunchDaemons/
    sudo /usr/libexec/PlistBuddy -c 'print ' /System/Library/LaunchDaemons/
    sudo /usr/libexec/PlistBuddy -c 'print"Backup Interval" ' /System/Library/LaunchDaemons/
    sudo /usr/libexec/PlistBuddy -c 'print"Backup Interval":Interval ' /System/Library/LaunchDaemons/
    sudo /usr/libexec/PlistBuddy -c 'set"Backup Interval":Interval 3600' /System/Library/LaunchDaemons/


  • reboot.


2012-09-30 discover ports on MacOSX

  • the network utility GUI is useful, but you may get the same results via the command line:
$ cd /Applications/Utilities/Network\
$ ./stroke nas-meduz.local 548 550
Port Scanning host:

         Open TCP Port:         548             afpovertcp
$ ./stroke 548 550
Port Scanning host:

         Open TCP Port:         548             afpovertcp


2012-03-24 Type your paths directly

  • from :

    Let’s move on to a more advanced feature: the Go to Folder dialog. Like in Finder, you can access a prompt for typing a path by pressing ⇧+⌘+G. If you love the keyboard, you’ll love this dialog; frequently, the fastest way to get to where you want to go is by typing its path. This is especially true because the Go to Folder dialog features tab autocompletion: type the beginning of the name of a file or folder and hit tab to fill in the rest of the name automatically. My favorite part about the Go to Folder dialog is that it appears automatically whenever you begin typing a path (/ or ~). When saving, the desired filename can even be included in the path.


2012-03-22 how to leave iphoto

  • is certainly a nice tool, but it is also

    1. slow, unresponsive and locks you in some ugly closed-source format.
    2. also, try to look in forums when you want to share pictures on different {computers / OSs / iphoto versions / places / users} = nightmare!
    3. on top of that, the *cloud stuff is intellectually just very corrupted...
    4. what decided me to drop it entirely was a sudden corruption of the library. It took 2 days to recover my files and re-rotate correctly all pictures...
    5. last nail in the coffin was the fact that libraries are not backward compatible : you have to upgrade to the new product.
  • so time to take back possession of your pictures!

  • I found some supporting arguments here:

  • solution: put the files in folders according to a date organization of the type 2011/P0747444.jpg, other tools for tagging, etc... follow naturally (and you share as you share folders on dropbox or whatever)

  • first, let's set the default application for upcoming pictures from cameras:

    1. With your camera connected, open Image Capture
    2. You will see your camera under devices. Click the icon.
    3. Down at the bottom, you will see “Connecting this iPhone opens…” with a pull-down menu under it.
    4. select "autoimport" (I choose "delete after importation")
    5. another solution is to use a feature from dropbox...
  • then, let's export the data from iPhoto: File.../Export.... I kept the original file names but with the modifications (mainly rotations that were applied to my old camera without a gravity sensor). you should end up with lots of files in one directory. but it ... does not work as iphoto raises a completly unmeaningful error ('could not create file').

  • so, let's explore the library:

    1. it is package, and we can right-click in the finder to 'show package content'
    2. click the Masters folder to open it, and you'll see folders organized by year; inside are more folders organized by date and album, and inside them are photos in JPG format and video clips.
  • then I found and you just have to type

    python Pictures/iPhoto\ Library Pictures/Photos

    to achieve the export

    • I used the following commands to post-process all

      counting if everything was moved (there was some corruption in the library file with MOVies)
      find ~/Pictures/iPhoto\ Library/Masters/2012 -iname *MOV |wc -l
      find ~/Pictures/iPhoto\ Library/Masters -iname *MOV |wc -l
      find ~/Pictures/Photos -iname *MOV |wc -l
      # brute force to compare the content of the trees (brute force for the computer, you can get a coffee)
      mkdir ~/Pictures/Photos/2011
      chmod -R u+rwX ~/Pictures/Photos/2011
      find ~/Pictures/iPhoto\ Library/Masters/2011 -iname *MOV -exec cp {} ~/Pictures/Photos/2011/ \;
      mkdir ~/Pictures/Photos/2012
      find ~/Pictures/iPhoto\ Library/Masters/2012 -iname *MOV -exec cp {} ~/Pictures/Photos/2012/ \;

      (for the last exampls, see )

  • at the end, the great relief is to remove all this iphoto cr*p:

    cd ~/Pictures/
    rm -rf iPhoto*
    cd ~/Library/Caches
    rm -rf
  • I'll be glad to help anybody with similar problem


2012-03-21 installing Dovecot on MacOsX using HomeBrew

  • master howto:

  • Install

    brew install dovecot
    sudo vim /Library/LaunchDaemons/homebrew.mxcl.dovecot.plist
  • Configure

    sudo cp /usr/local/etc/dovecot/dovecot-example.conf  /usr/local/etc/dovecot/dovecot.conf
    sudo vim /usr/local/etc/dovecot/dovecot.conf
  • Mine reads (it's just meant to access imap files from the local mail server and not to serve outside the localhost):

    disable_plaintext_auth = no
    mail_location = maildir:~/Maildir
    ssl = no
    default_login_user = lup
    passdb {
      args = login
      driver = pam
    protocols = imap
    service auth {
      user = root
    service imap-login {
      inet_listener imap {
        address =
        port = 10143
      inet_listener imaps {
        address =
        port = 10943
    userdb {
      driver = passwd
  • Reload

    sudo launchctl unload homebrew.mxcl.dovecot.plist
    sudo launchctl load homebrew.mxcl.dovecot.plist
  • It does not work on the first try... so read documentation

    less /usr/local/share/doc/dovecot/documentation.txt
    less /usr/local/share/doc/dovecot/auth-protocol.txt
    less /usr/local/share/doc/dovecot/wiki/PasswordDatabase.PAM.txt
  • Authentification

    ls -l /etc/pam.d/
    sudo vim /etc/pam.d/dovecot

    with /etc/pam.d/dovecot being

    auth       required
    account    required
    password   required
    session    required


2012-03-16 Creating a bootable Debian USB flash drive on MacOsX

  • largely adapted from

  • download the iso

    wget # or
    hdiutil convert -format UDRW -o target.img debian-6.0.4-i386-CD-1.iso
    mv target.img.dmg target.img
  • identify where is your USB stick

    diskutil list
  • unmount the USB stick

    diskutil unmountDisk /dev/disk2
  • write on the stick

    mv target.img.dmg target.img
    sudo dd if=target.img of=/dev/rdisk2 bs=1m
  • eject the USB stick

    diskutil eject /dev/disk2


2012-03-13 Moving Time Machine to a New Hard Drive

  • There exist some solution to move a time machine data folder to a new drive by making a clone of the drive. My problem is that I already have data on the new drive and that this data can difficultly be moved.

  • It try (after switching off Time machine of course) with rsync while keeping hard links:

    sudo rsync -av -H  /Volumes/tera_enigma/Backups.backupdb /Volumes/2T_un/
  • This takes a while as rsync has to manage a lot of them (may take also a lot of memory, so be patient)


2012-03-11 Stop Bonjour from broadcasting ssh and sftp

largely a copy-and-paste from ; Jun 25, '07 07:30:00AM • Contributed by: delight1
  • After doing a backup, edit the following file:

    sudo vim /System/Library/LaunchDaemons/ssh.plist
  • In the editor, the goal is to delete these two lines:

  • They should be found around lines 22 and 23. In vim, this is easily done by typing \ssh, then n until you are on the right line. Then type d2d to delete these 2 line. Finally issue wq! to save and quit.

  • Save the file and quit the editor. Then go to System Preferences » Sharing » Services, unlock it, disable Remote Login, and final re-enable Remote Login. You can check if things worked by using Bonjour Browser or some such similar app to be sure ssh/sftp no longer show up.

  • A simple grep-irbonjour/System/Library/LaunchDaemons/ gives:

    /System/Library/LaunchDaemons/                  <key>Bonjour</key>
    /System/Library/LaunchDaemons/                      <key>Bonjour</key>
    /System/Library/LaunchDaemons/                        <key>Bonjour</key>
    /System/Library/LaunchDaemons/                       <key>Bonjour</key>
    /System/Library/LaunchDaemons/                    <key>Bonjour</key>
    /System/Library/LaunchDaemons/                    <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                   <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/                 <key>Bonjour</key>
    /System/Library/LaunchDaemons/                    <key>Bonjour</key>
    /System/Library/LaunchDaemons/                     <key>Bonjour</key>
    /System/Library/LaunchDaemons/ftp.plist:                        <key>Bonjour</key>
    /System/Library/LaunchDaemons/ssh.plist:                        <key>Bonjour</key>
    Binary file /System/Library/LaunchDaemons/telnet.plist matches

    so, you may want to change these too.