Category Archives: Mac

Mac related posts

Build Paho MQTT c library on Mac OS X

This post describes how to build the Paho MQTT library on Mac OS X with MacPorts openssl.

Prepare your system

Install the compiler

You need Xcode or the Xcode command line utils. If you’re not sure if they are already installed open a terminal and try to run the gcc command. If you need to install the compiler a popup will appear to do so.

Install Mac Ports

If not done already download and install the MacPort system and install the openssl library by executing the following command:

sudo port install openssl

You need at least openssl-1.0.1g_0 to not be affected by heartbleed bug!

Clone the repository

Get the latest version because there are some improvements done the last weeks.

git clone git://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.c.git

Prepare the build environment

Change to the build directory within the repository:

cd org.eclipse.paho.mqtt.c/build/

Now we need to export some environment variables:

export SSL_DIR=/opt/local/
export MQTTCLIENT_DIR=../src

If you want to build the samples:

export BUILD_SAMPLES=YES
export SAMPLES_DIR=../src/samples

Now give it a try and run make

make

There should now be some output shown and a darwin_ia64 folder should be created. There you find your paho c library files.

Hope this helps to build your paho library.

 

Add button to Finder for open iTerm or Terminal here

A very useful addon for Finder on Mac OS X is the cdto application. It’s a very basic gadget which helps you open a terminal in the current opened folder. When I am navigating through my filesystem for example browsing a folder of sourcecode or reviewing an extracted tarball you want to have a terminal with an shell opened at the current destination. This little tool helps you to do this. It supports iTerm2 and the default Terminal of course. Download it here.

 

finder with cdto included

Wireshark with XQuartz on Mac OS X Moutain Lion

Since Apple removed the X11 support you may faced some problems with X11 based applications. Wireshark is one of those applications which made trouble on my mac. To fix the problem you need to install XQuartz.

Download the lates Wireshark version and run it. It should come up with and selection window for your X11 application. Click on browse and navigate to your application directory. Open the directory utilities and select XQuartz. Now quit Wireshark using cmd + q and start it again. It can take a second but now your Wireshark should work with Moutain Lion.

Install Eclipse C/C++ Juno on Mac OS X

Description

This tutorial will explain how to install and use Eclipse C/C++ with Mac OS X. I wrote a tutorial for Windows 7 some time ago because you need to install some additional software to be able to compile your programs. With Mac OS X this should be more easier if you already have Xcode installed.

Prepare your system

Apple offers you a free collection of development tools called Xcode. It although contains a IDE for Objective C and iOS development. Beside this it tools there are a lot of useful tools like different version control systems and console tools and very important the compilers. Because this is packed and very easy to install you should go to the AppStore and install Xcode if you don’t have it yet.

You will need to have Java installed on your Mac OS X as well but this is just a click if you try to run a Java application the first time.

Xcode Appstore Screenshot

 

Download Eclipse CDT for Mac OS X

Download the Eclipse CDT version of Eclipse from eclipse.org. I prefer the 64bit version.

Eclipse CDT MacOSX 64bit version

 

Extract the downloaded archive and move the eclipse folder to your Application directory. I renamed the folder to eclipse-cdt because I have different version of Eclipse in my Application folder. But the folder should contain the following files:

Eclipse CDT folder Mac OS X

 

Now you should be able to run the Eclipse IDE.

Eclipse Startscreen

First the Eclipse splashscreen will appear. Then you will be asked to define your workspace like the following prompt:

Eclipse define workspace prompt

Choose a folder or use the default value and continue with OK:

Eclipse CDT Mac OS X empty UI

You should get something like a welcome page or continue an empty overview over your new Eclipse C/C++ IDE.

Create a new C++ Project as shown below:

Eclipse Mac OS X create new C++ project

Eclipse CDT Mac OS X create new C++ project

Build the new project if it’s not done automatically after creation and run the binary:

Hello World programm C++ Max OSX Eclipse CDT

If everything went well you should see the Hello World message in your output console:

Eclipse C++ IDE Hello World on Mac OS X

How to find the eclipse.ini configuration file

Because the eclipse.ini file is hidden in the Mac package I wrote a blog post some time ago how to change it. You can find the post here. Should work for Eclipse Juno as well.

Maybe this helps you to get your IDE up and running to do awesome stuff with it. Feel free to add a comment if I missed a step.

Boxer a dos emulator for Mac OS X

These days I stumbled over a nice DOS emulator for Mac OS X to play some retro games called boxer.

It’s free and most of the games you know from the 90’s are free downloadable from the internet now.

For example I found the shareware battleship I knew from my childhood:

battleship dos game screenshot

battleship screenshot in boxer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Maybe you will have some fun, too! There are a lot of classic games available for free now.

GNUbLIN another ARM Board

I am quite interested in all the ARM stuff. It’s everywhere around us in all this nice and powerful smartphones, cameras, routers and other devices. When I saw an advertisement in the German Linux Magazine I ordered one of this small boards called GNUbLIN. It’s a project created by the embeded project GmbH and the University of Augsburg in the South of Germany.

The Board costs around 50€ and comes with all you need. There is a preinstalled SmartCard with an embedded Linux on it and an USB cable to connect it to your PC.

Connect to Linux PC

If you connect it to your Linux PC this should work out of the box. Just install picocom as recommended by the tutorials on the GNUbLIN project page and run:

sudo picocom -b 115200 /dev/ttyUSB0

Connect to Mac OS X or Windows

If your on Windows or Mac you have to install some drivers. I don’t use Windows but I have a Mac which I want to use for the developing and testing of the board. Therefor got to this page and download the Mac OS X package. You have to reboot after installation. Now when you connect the GNUbLIN Board to your Mac you should see something like this in your /var/log/kernel.log

kernel[0]: com_silabs_driver_CP210xVCPDriver: init
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::attach
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::probe
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::detach
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::attach
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::start – Registered for Power Management
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::start!
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::start – Found device at interface 0
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::SelectInterfaces – BulkInput Pipe is 0xffffff800cb07900 on EP1
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::SelectInterfaces – BulkOutput Pipe is 0xffffff800bd8ce40 on EP1
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::setPowerState – Waking up
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo – Part Number Found: 0x02
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo – UsbConfigurationDescriptor –
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .bLength = 9
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .bDescriptorType = 0x02
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .wTotalLength = 32
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .bNumInterfaces = 1
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .bConfigurationValue = 1
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .iConfiguration = 0
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .bmAttributes = 0x80
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::GetCP210xInfo     .MaxPower = 50
kernel[0]: com_silabs_driver_CP210xVCPDriver64(0xffffff801055c000)::start – Sucessfully loaded the driver
kernel[0]: com_silabs_driver_CP210xVCPDriver64::setPowerState(0xffffff801055c000, 0 -> 1) timed out after 10141 ms

This indicates that your driver was loaded successful. Now the GNUbLIN console should be available under dev/cu.SLAB_USBtoUART. This is where I found it on my Mac. Next step is to install picocom using MacPorts or use screen which is installed by default to connect to your GNUbLIN board:

screen /dev/tty.SLAB_USBtoUART 115200

If you don’t have MacPorts installed yet pleas follow the instructions here. If you have it installed just install picocom:

sudo port install picocom

Now run picocom on the USB device with following parameters in a terminal.

sudo picocom -b 115200 /dev/cu.SLAB_USBtoUART

Maybe you need to hit return to refresh the output. An login mask like this should appear:

 

 

 

 

Login as root and have fun. There are some example scripts in /root. For example run /root/blink.sh to make the onboard LED blink.

 

Gimp 2.8 for Mac

Gimp 2.8.0 is available for Mac OS X now.

You need to have XQuartz installed on your Mac for the new Gimp version.

Why should you upgrade to Gimp 2.8 ? For me there is one major change I am waiting for years now. The one window mode. Gimp uses X11 and on Mac OS X the multi window tool boxes don’t have a good useability.

If you want to have the one-window-mode your default mode. Open Gimp got to Windows -> Single-Window Mode.

Gimp 2.8 on Mac OS X Lion

Installing VMware ovftool on Mac OS X

VMware offers a free tool to convert virtual machine files in different formats for example from .vmx to .ovf.

This tool can be used to convert:

VMX -> OVF
VMX -> OVA
OVF -> VMX
VMX -> vSphere

Or you can deploy a OVF directly to a ESX host. It’s  more powerful than it looks like.

The documentation can be found on the VMware site and it’s short and clear.

Installation:

Download the documentation and the tool from the VMware site: http://www.vmware.com/support/developer/ovf/

You need a VMware id to have access but the tool itself is free.

After you downloaded the tool you can install it using the installer. The stand alone version 2.1 (which I used) will be located here: /Applications/VMware OVF Tool/

Start a terminal and change to this directory:

cd /Applications/VMware OVF Tool/

Now convert your files like you want. For example:

ovftool vmxs/Fedora.vmx ovfs/Fedora.ova

More examples how the tool can be used are shown by the command

ovftool --help examples

Examples:

ovftool –vService:vDep1=provider_1 /ovfs/my_vapp.ovf
vi://username:pass@localhost/my_datacenter/host/esx01.example.com
(specify a vService dependency)

ovftool -tt=vmx /ovfs/my_vapp.ovf /vms/
(.ovf file to .vmx file. Result files are /vms/my_vapp/my_vapp.[vmx|vmdk])

ovftool /vms/my_vm.vmx /ovfs/my_vapp.ovf
(.vmx file to .ovf file. Result is put in /ovfs/my_vapp.[ovf|vmdk])

ovftool https://my_ovf_server/ovfs/my_vapp.ova /vm/my_vm.vmx
(.ova file to .vmx file)

ovftool /ovfs/my_vapp.ovf vi://username:pass@my_esx_host
(.ovf file to ESX host using default mappings)

ovftool /ovfs/my_vm.vmx vi://username:pass@my_esx_host
(.vmx file to ESX host using default mappings)

ovftool http://my_ovf_server/ovfs/my_vapp.ovf \
vi://username:pass@my_esx_host
(.ovf file from a web server to ESX host using defaults)

ovftool /ovfs/my_vapp.ovf \
vi://username:pass@my_vc_server/?ip=10.20.30.40
(.ovf file to vCenter server using managed ESX host ip address)

ovftool vi://username:pass@my_vc_server/my_datacenter?ds=\
[Storage1] foo/foo.vmx c:\ovfs\
(VM on ESX/vCenter server to OVF using datastore location query)

ovftool /ovfs/my_vapp.ovf \
vi://username:pass@my_vc_server/my_datacenter/host/my_host
(.ovf file to vCenter server using vCenter inventory path)

ovftool vi://username:pass@my_host/my_datacenter/vm/my_vm_folder/my_vm_name \
/ovfs/my_vapp.ovf
(VC/ESX vm to .ovf file)

ovftool /virtualmachines/MyVM.vmx \
~my_vApprun_workspace/
(Imports a .vmx file into a vApprun workspace using default name)

ovftool https://my_ovflib/vm/my_vapp.ovf
(shows summary information about the OVF package [probe mode])

CoRD a nice RDP client for Mac OS X

Searched for an alternative for Microsoft RDP client for Mac and found CoRD. It’s a nice free and open source tool for Mac and works fine unitl now.

Nice features are:

  • Bookmarks
  • All sessions in one window
  • Quick connection
  • Share folders

CoRD Application Screenshot Mac OS X

I will include a more detailed review of this nice tool when I have used it for a while.