That’s it, I have switched away from the flag ship text editor of all web dev running OS X. Why ?

I gave Sublime Text 2 a try after upgrading to Lion. With Lion, Textmate started acting quirky. I had display bugs when closing a tab sometimes. At first, I did’t care much for Sublime’s interface (and hated the icon) and as soon as Textmate 2 beta came out, I switched back to my usual editor. But, there is one thing I had got addiced to in the meantime : Sublime is fast, lightning fast. Switching from one file to another is a pleasure and with TextMate 2 it had become waaayyy to slow. And so, after reading this post about icon and looks tweaks, I switched – again.

 

Tweaking Sublime Text

The Icon

Even if the latest update came with an icon, I prefer to use the one by dmatarazzo (available on GitHub)

The Look ‘n’ Feel

I really liked the way TextMate 2 was going with its new interface and I find that the Soda look’n'feel for Sublime brings the same simplicity and efficiency to Sublime.

What makes switching to Sublime possible is that it supports TextMate’s bundles and themes so I imported Tomorrow from my Textmate to Sublime.

Sweetness Everywhere

I try to separate the work computer from the personal computer but it doesn’t mean I don’t code a little bit on the personal computer… So I like for my settings and packages to keep in sync. It was possible with TextMate using Dropbox and it still is possible with Sublime. Move packages, installed packages and pristine packages to Dropbox and create some symlinks.

Awesome Bundles and add-ons

I installed the Package Control and used to install the As Above package but that’s just a start because there are a bunch of cool packages in addition to the existing compatible TextMate bundles.

I installed these two snippets for JSON and XML formatting and validation.

One more thing

Setting up Sublime Text 2, I found this application that will generate themes for TextMate / Sublime Text.

 I upgraded to OS X Lion on release day (I’m more of a geek all the time) and I was very confused with iCal. It immediatly appeared that all the events I created were now set to “all day” by default and I found this very annoying (they used to be set for the default 10am to 12pm slot by default). Researching a way to customize the default length for new events I found out that, new events will be created with start and end dates based on their labels.

Simply create an event titled Sprint 3 meeting from 2 to 4 pm and it will create the event Sprint 3 meeting and assign it the right information. I thought this was awesome and wondered how Apple came up with this feature and why they took the time to focus on this. Then, I saw the iOS 5 keynote and met Siri. Now it all makes sense and I am eager to hire my virtual personal assistant.

Steve Jobs was a visionary. The respect he got from the tech industry is well deserved.

If you are using Mail.app and GMail you might have noticed that emails you read (in Mail.app) are counted as unread in your sidebar.

If you expend the labels in your sidebar, you will notice the unread emails all belong to the default imap GMail labels :

I’ve finally found how to fix this. Simply log in your GMail account and go to your Mail Settings. Click on the Labels tab and uncheck all the “Show in Inbox” boxes for all the GMail “System Labels” except Inbox (which is grayed out anyway)

Back in Mail.app, right click on your account in the list in the left pane and click on Syncronize account. It will update the labels counts and everything will “look better”.

Just a quick note on how to achieve the following purpose. Say you have a 3 months old baby and your mother sends you a 3 month old birthday ecard. Say you wish to download the animation of that ecard and share it on the blog you keep for your family and close friends. I suppose this is “everyday computing” for the rest of them.

Anyway, here is how it is done :

  1. In firefox, you can find the swf animation easily. simply type about:cache in the address bar and locate the swf. Copy it on your desktop or somewhere accessible.
    Warning:
    if you have NO CACHE at all showing when you type about:cache, you might be a web developer using web developer tools with cache disabled. Re-enabled it, re-watch your animation, now it will be in the cache.
  2. In WordPress, upload the swf by using the add media button. Obtain the attachement location by clicking the “Link to Media” button and, in “HTML” view, paste the following code (replace http://url/to/my.swf with the link to your media – twice) :
1
<object id="test1" width="600" height="458" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://url/to/my.swf" /><param name="pluginspage" value="http://www.adobe.com/go/getflashplayer" /><embed id="test1" width="600" height="458" type="application/x-shockwave-flash" src="http://url/to/my.swf" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>

In case you are sharing a disk over network and you want it to be available on your Mac automatically at boot up, you can have it auto mount at login.

  1. Go to System Preferences > Users & Groups.
  2. Make sure your user is selected on the left and go to the Login Items tab
  3. Go to the Finder and press Cmd+K and connect to your network drive. Make sure to save the password to your keychain.
  4. A Finder window opens showing the content of your network drive. Press Cmd + up arrow key to go up a level
  5. Drag and Drop your network volume in the Login Items window
  6. Check the box Hide left to your Volume in the list so the window won’t open at every boot up
  7. Close the System Preferences, you’re all set

A quick note on how to share a USB drive over your private network (Network Attached Storage) using a router running on the DD-WRT firmware. Needless to say, your router needs to have a USB port for this feature to be enabled in the firmware.

  1. Plug the drive in your router USB port and turn it on
  2. Simply login to your router administration console (default credentials are root:admin)
  3. Go to the Services tab.
  4. Go to the USB sub tab and enable the core USB support and the USB storage support. Also, I recommend enabling the auto drive mount.
  5. Select your disk mount point i.e. /mnt and apply settings
  6. The router will mount the drive and give you information about your device
  7. Go to the NAS sub tab and enable the Samba sharing (or FTP if you so desire). Enter your workgroup information and create a share. It should look as follow :
    Path /mnt
    Name nDrive (enter what you want there)
    Public unchecked (you can check this box if you don’t wish any user management for your data)
    Access Read/Write (you can change this to Read Only)
  8. Below, create users and give them access to your device.
That’s all. The DD-WRT makes administration straightforward and, for those who have several routers, it also can make it constant across different devices.

I happen to know an American in Paris. Expats have a wide range of specific problems that most people don’t really ever worry over, for example :

  • how do you teach a child two languages (hoping the child won’t mix them up)
  • do you have to declare/pay taxes in your country of origin ?
  • which address do you give your bank counselor when opening your account ?
  • how do you transfer money from your bank in country A to your bank in country B ?

Anyway, one of the problems expats might have is accessing websites who have an IP-based location check (ie bank account management site, checkout, etc).

Eventually, if the problem is recurrent, you can solve it permanently using a router and a VPN which will give you an IP based in the country of your choice. I tested this setup myself and hre’s what I learnt.

What you will need

  1. Get an account with a VPN provider such as strongVPN. I tested the Lite Open package (monthly fee).
    If you only have one computer, the strongVPN account is all you need. Download the software they provide and you can have a foreign IP at will. If you have more than one machine or various devices you want to use with a foreign IP, read on…
  2. Buy a DD-WRT compatible router. Since strongVPN offers detailed tutorials for the Linksys ones, I tested one of them, the E3000.
  3. Download the quick config from your strongVPN customer area (it is a zip file)

Setup your network

If you already have a router (you probably do as most Internet boxes do create one for you), you will now have two. Basically, you will have two subnets. Depending on which network you use, you will or not have a foreign IP.

Here’s how it looks :

To achieve this, plug a network cable between your new router and your computer. Access your router configuration page, usually at http://192.168.1.1. Login using admin as a login and admin as a password. In the main section, change your router IP to something like 192.168.2.1 / 255.255.255.0 and enter 192.168.1.254 (or whatever your other router IP is) as the gateway. Setup the DHCP to assign addresses like 192.168.2.2 to 192.168.2.50 for example.

If you so desire, enable the wifi of your new router.

Restart your new router. Connect your old router to the new one using a LAN port (not the WAN port) on both ends. Now, if you connect your computer to the old router, your IP will be like 192.168.1.X and you must be able to access the Internet. If you connect your computer to the new router, your IP will be like 192.168.2.X and you should still be able to access the Internet.

If you got this step right, you can go ahead and flash your router firmware.

Configure your router to use the VPN

First, we must modify the router’s firmware to run DD-WRT. This is an open source firmware that aims to make router administration easy (and consistent) while enabling as many features as possible for each device.

If you did get a router listed for easy setup on strong VPN website, I advise you to download your firmware file from there.

If your device is not listed there, get your firmware file from DD-WRT database.

If you did get the Linksys E3000, here are the two files you will need :

  1. dd-wrt.v24-16785_NEWD-2_K2.6_std_usb_nas-e3000.bin
  2. dd-wrt.v24-17201_NEWD-2_K2.6_big-nv60k.bin

Now, it’s time to flash the firmware. Login to your router administration page. Go to administration > upgrade firmware. Select the first file (the upgrade file) and click on start upgrade. Your router will reboot. Return to the same page, select the second file and click on start upgrade again. This time, after reboot, your administration page will look different as you are now running DD-WRT.

Login to your router administration using root as login and admin as password. In the Setup > Basic Setup section, enter the following for DNS servers :

  1. 216.131.95.20
  2. 216.131.94.5

Reboot your router and make sure that you can still connect to the Internet using this new router.

Now, it’s time to setup the router to use the VPN access. Go to Commands and enter the content of the quick config file (downloaded earlier) in the textarea. Click on Save Custom Script. The page reloads, type sh /tmp/custom.sh in the textarea and click on run commands. The page reloads again. Clear the textarea and click on Save Custom Script again. Reboot the router. Now, your router should use the VPN access. If you are using this router, whatsmyip.org should tell you that your IP appears to be in the country you selected when opening your VPN account. Instructions with screenshots can be found on strongVPN website.

Note: If your IP is still the same (your usual IP), you need to contact strongVPN support and ask them to make sure your VPN account is able to work with this setup. If it isn’t, they will adjust it in a matter of seconds.

Test

Connect, either using a network cable or Wifi, your computer to the new router. Go to a website to get to know your IP such as whatsmyip.org and you should now see that your external IP is the one of your VPN provider (in the country of your choice). Hopefully, now, you can use your online banking site or whatever other site which was blocking you for being abroad.

Support

 If you’re having a problem, you could leave a comment on this blog but actually, your best bet is to check the DD-WRT forums. If you did go with strongVPN, you’re in luck, their support is awesome. They have what they call “Live Help” which means some of their support staff can anser you via online chat or even using Skype. Simply head over the Live Help page and find a DD-WRT guru. You will be given his Skype name and be told when he comes on duty. They are super nice and extremely helpful. You can also visit their forums hoping that someone runs the same hardware you bought.

It works, now what ?

 Okay, so, besides using your connection to access your country of origin banking website and such, this is also a workaround to use country based restricted websites or applications such as Netflix, Hulu or Pandora. I have actually had the opportunity to test this setup and Netflix so, if that’s what you’re doing…

Netflix : two extra tips

  1. If it stops working on an AppleTV 2, hard reboot (unplug / replug from power source) the device
  2. If it doesn’t work on iPad, edit your network settings and use Google DNS servers (IP 8.8.8.8)

I upgraded to Lion and everything went fine. Just a minor – known – issue with MySQL server as installed by the Zend Server Community Edition.

I already wrote about solving the mysql error which prevents the server from starting. Researching this again, I found more information about it. Whether running on OS X or any other OS, it appears that these PID errors are permission related.

The two errors I get are :

  1. ERROR – MySQL PID file could not be found
  2. ERROR – Manager of pid-file quit without updating file

First, when upgrading to Lion, it appears that the zend user is deleted. As a result, all the files owner by zend are now owned by nobody. The only way I found to recreate the user was to reinstall Zend Server Community Edition without removing the current installation. All my data remained untouched… Apache configuration, PHP configuration and mySQL data stayed so that was not a problem. On the other hand, that did not fix the permission issues. The correct ownerships and permissions are not restored by the installation process. Eventually, I got the server to restart with the following permissions in place.

Here are the permissions for the files in /usr/local/zend/mysql :

drwxrwxr-x  49 root  wheel  1666 Jul 22 11:19 bin
drwxrwxr-x  62 zend  wheel  2108 Jul 31 10:12 data
drwxr-x—   6 root  wheel   204 Mar  8 16:28 data.dist
drwxrwxr-x  24 root  wheel   816 Jul 22 11:20 lib
drwxrwxr-x   3 root  wheel   102 Jul 22 11:19 scripts
drwxrwxr-x  13 root  wheel   442 Jul 22 11:19 share
drwxrwxr-x   3 zend  wheel   102 Jul 31 10:12 tmp

Basically, the folders data and tmp must belong to zend, the others, to root.

So, reinstalling the server, following my own instructions regarding permissions, fixed the Zend Server Community MySQL server for Mac OS X Lion. No other upgrade problem to report. Awesome job by the OS X Team.

I wanted to change the location of my SQL databases in order for them to be in my user’s home folder (that way, my databases would be portable as I travel with my user’s home folder). By default, when you install mySQL on OS X, everything is located at /usr/local/mysql and the data folder (the one containing the databases) goes to /usr/local/mysql/data.

The location of the data can be set in the my.cnf file BUT, don’t be alarmed, this file doesn’t exist on OS X by default. The server works without it and the file is for you to create if you need to change the server’s default behavior…

Steps :

  1. Download and install mysql for OS X
  2. Install the preference pane. Start your server to make sure it works. Stop it again as we need to alter the configuration.
  3. Move your data folder where you wish to have it i.e.
    1
    mv /usr/local/mysql/data /home/<user>/Applications/mysql/data
  4. Copy the file my-small.cnf in /etc and name it my.cnf
    1
    sudo cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
  5. Edit this configuration file
    1
    sudo vi /etc/my.cnf
  6. Change the data path : datadir=/home/<user>/…./data
    Note: if you use innodb, change the innodb data location directive as well
  7. Launch your mysql server again, it should start normally, if not, review the steps above as something must have gone wrong

One of the thing I wanted to do with the iPad was to watch movies on the go (remember the last time you flew transatlantic and you had to watch The Karate Kid ?…) At this point, I had no Movies, nor TV Shows in my iTunes so I am really starting from scratch here.

Some of the movies I wanted to have on the iPad came from DVD (no Blu-Ray player for me at this point) and one video was a mkv file. So the first step was to import these files in a format that would suit iTunes.

For the DVDs, I used Handbrake.

Here is the procedure :

  • Download and install Handbrake.
  • Launch Handbrake
  • Insert your DVD
  • Click on Source (top left button) and select your DVD > VIDEO_TS folder.

  • Handbrake will read the DVD and determine the chapters to rip in order to import only the movie (no special feeatures, no menus, etc)
  • If you don’t see the presets drawer on the right, click on “Toggle presets” in order to see them
  • I selected and used the Apple TV2 preset myself for my rips though I read the iPhone 4 preset would have worked, too
  • I then adjusted these settings somewhat following the recommendations at the end of this forum post
    - In the main window, adjust the framerate (FPS) to 25 (if your DVD is PAL/region2)
    - click on Picture Settings (top toolbar) and change the anamorphic to strict 


    - click on Filters (the tab at the top) and adjust
    - detelecine to default
    - decomb to deinterlace (push the cursor to the right)
    - deinterlace to slow
    - denoise to medium

  • You can then click on Preview to see what your movie will look like
  • Finally, in the main window, you can modify the destination file path
  • When everything is set, click on Start

The encoding process takes about 1.5 times the movie length for me here…

Of course, if you know better presets for Handbrake to work specifically for a given device (especially the iPad2) feel free to share them in the comments. Your help is welcome.

For the MKV file conversion to MP4 I used the trial version of Video Converter for Mac

  • Download and install the product
  • Drag and drop the video(s) you need to convert
  • Once again, select the preset that suits you best (it can be iPad or Apple TV)
  • Adjust the framesize (if your source is HD and you have an iPad2, you might want to increase the output framesize)
  • Click on Convert

You can find more information on how to use Video Converter in the editor’s website documentation.

That process was very time consuming on my computer… much more than the rips from my original DVD though I must add that the resulting video, on the iPad2, is wonderful. The HD source made all the difference in the world compared to the DVD sourced material. NO, I WILL NOT BUY ALL MY DVDs AGAIN AS BLU-RAY DISCS but I’m sure some of them would benefit from the upgrade…

MP4 to iTunes to iPad

Both Handrake and Video Converter for Mac created for us some mp4 files. These files must be added to the iTunes Library.

I also feel the need to tag them. I need the director name, the release date and the cover – at least… I found the artwork in very high res at getvideoartwork. As for the tagging, a very detailed article at iLounge.com covers the subject of video management within iTunes.

Once your movies are ready, simply sync all your movies (or a selection on them) with your device (which could be an iPad or iPhone)

That’s it, book a long flight for your next holidays and enjoy your movies ;-)

 

 


Next Page >>