Development Tools, Mac, Troubleshooting

Arduino Clone USB Driver on OSX (CH340, CH341)

So, most cheap Arduino I can found in Indonesia’s marketplace is basically a SMD version that based on CH340 USB Serial chip.

You can find the drivers on this site here, but there’s easier way to install the driver if you already have brew installed. (OSX developer must have `brew` installed! MUST HAVE! :P)

First Install cask (OSX developer who have brew also must have cask :D).

Run the cask recipe

brew cask install caskroom/homebrew-cask/wch-ch34x-usb-serial-driver

(it’s basically a script that is doing the driver downloading and installing for you)

Open up your Arduino and make sure there’s new `tty.wch` device listed on the open port.

Additional notes:

If somehow it’s still not detected, try to restart and change the cable. The UNO that I receive only have USB with Power (not include data)

Debug, IOS, OSX, Troubleshooting

Enable Remote Debugging for Safari Mobile iOS (iPhone and iPad of course)

Just realized that safari on mobile can also support remote debugging like chrome + adb.

So one day I was having issue with quirky CSS bug that only occurs on Safari Mobile, so the first thing I do is turning on the iOS emulator.

If you want to turn on iOS emulator without turning on Xcode; You can run it using Terminal with the command below:

open /Applications/\

Screen Shot 2015-09-11 at 11.19.29 PM

You emulate any kind of iOS devices by toggling the device on Hardware menu.

Of course I turn on Mobile Safari and try to reproduce the quirky CSS bug on it. Well Yup… it’s reproducible on the Emulator (so we can safely assume that this is the same Mobile Safari on real devices) and the next logical step is to enable Developer options.

Go to Emulator `Settings` -> `Safari` -> `Advanced` and turn on the `Web Inspector` option

Screen Shot 2015-09-11 at 11.25.44 PM

After that open Mobile Safari and point it to your web page.

Open Desktop Safari on your Mac. And make sure that you have a `Develop` menu shown on top

Screen Shot 2015-09-11 at 11.28.02 PM

If you don’t have it – go to `Safari Preferences` -> `Advanced` and make sure the `Show Develop menu in menu bar` is checked

Screen Shot 2015-09-11 at 11.29.05 PM

Go to `Develop` menu – and your Emulator should be listed. If it’s not – try to restart your Desktop Safari (and make sure you Mobile Safari is active and showing a web page)

Screen Shot 2015-09-11 at 11.30.33 PM

Click on the appropriate page. And a developer tool will show up.

Screen Shot 2015-09-11 at 11.33.41 PM

Happy debugging!

Devops, Ubuntu

Install Imagemagick with WEBP on Ubuntu

Somehow standard imagemagick on Ubuntu does compiled with `WEBP` support, There’s a bug report with “wishlist” level on Ubuntu about it here

So we need to compile it on our own, this is what I do on my Ubuntu machine

First: When you are planning to compile things on your own – you need to install the build-essential

sudo apt-get install build-essential

And then install plethora of dependencies that may be needed by imagemagick

sudo apt-get build-dep imagemagick -y

Download latest imagick and extract it

tar xf ImageMagick.tar.gz 

Download latest libwebp and extract it

tar xf libwebp-0.4.3.tar.gz

Download dependencies for libwebp

sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev

Compile libwebp

cd libwebp-0.4.3
./configure --prefix=/usr
sudo make install

Compile imagemagick! (note: you may want to change the version number to the latest imagemagick)

cd ImageMagick-6.9.2-0/
./configure --prefix=/usr
sudo make install

Aaaand done!