Tag Archives: Mac

Setup Ruby development environment with rvm on Mac OS X

Since I experimented with some Ruby web application stuff the last weeks, I want to share some of my conclusions how to setup a development environment which is working for my two major platforms, Mac and Linux. This post will cover the setup of an easy to use development environment on Mac OS X. I am running Mavericks but this should work on all of the latest supported Mac OS X versions as well.

First install XCode or just the command line tools.

Try if the gcc command works for you in a terminal if gcc is not installed a window appears which allows you to install the necessary packages.

Next step is to install Mac Ports

Download the latest install package for your Mac OS X version from: http://www.macports.org/install.php

Install rvm:

Now it is time to install the rvm for your user. Open a new terminal and run the following command:

\curl -sSL https://get.rvm.io | bash -s stable

This will install rvm and add all necessary stuff to your bash profile. If you are using a different shell or something does not work for you please have a look at the rvm documentation: http://rvm.io/rvm/install

The install output gives you the advice to run the source command for your user, copy it and run it in your active shell to make rvm available in this shell. The command looks something like: source /Users/<YourUsername>/.rvm/scripts/rvm

Install ruby:

For my applications I am using the ruby 2.1 version. You can install any version you want or need and rvm allows you to switch your active ruby version on the fly.

Lets start with Ruby-2.1 for now:

rvm install ruby-2.1

Activate that ruby version and make it default ruby version for now:

rvm use ruby-2.1 --default

Test it:

ruby -version

Thats it. You should now have the Ruby-2.1 version active and you can start installing gems or start your development with Ruby. If you want to switch your active Ruby version just use the rvm command and install a different version and use it.

I hope this helps you to save some time and trouble setting your development environment up.

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

First very basic MQTT Mac App

Since I had to bring my self up to speed with all this fancy M2M stuff our developers doing right now I started a small project by my own to learn something about MQTT and M2M communication.

My application is a very basic Objective-C application for Mac based on the Eclipse PAHO library. This library is open source and implements the MQTT protocol.  I am not a very good and experienced programmer please feel free to implement this in a better and smartert way. My few lines of code are free for use on github and open source under the Apache License.

To test this application I am hosting a public mosquitto broker sponsored by BayCIX running a nice mqtt-dashboard to monitoring what is going on on the broker developed by a colleague of mine at dc-square.

Here what it looks like up to know after a few hours of coding:

SimpleMessage MQTT Client v0.1.1

Future releases will be more generic and with some more preferences to test MQTT and the broker in a more experienced way:

  • SSL encryption
  • User authentication
  • Connection options
  • Basic performance measuring

Update v0.1.5

New version with some bug fixes and some small enhancements released.

SimpleMessage MQTT Mac OS X Client

Download SimpleMessage v0.1.5 here.

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.

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

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.

 

iTerm2 a tool you must have

iTerm2 Logo

 

 

 

 

 

 

 

I was using iTerm since I bought my Mac and was very happy with the tool. It is stable and worked well for me. It has nice features like full screen mode on Snow Leopard but after the update to Mac OS X 10.7 alias Lion the full screen mode didn’t work anymore. I was looking at the SourceForge page of the iTerm project and saw it is not active anymore.

After some search through the Net i found that some more active guys have forked iTerm and named there project iTerm2. It is hosted on Github like the most projects I have reviewed the last time. They did a very nice job with there Lion integration and I hope they hold there speed and power in the future.

If you need a more comfortable Terminal application with features like:

  • full screen mode
  • drag and drop functionality which kicks asses
  • pos1 and end key functionality to jump to first or last letter you typed by <fn> + <left/right arrow>

you should review iTerm2.

Btw. I was thinking how cool it would be if I could copy and paste using drag and drop out of my terminal and reviewed the code to get into it and implementing it maybe by myself … but wow It was already implemented. It looks like it was implemented back in iTerm times but I never used the functionality but you should check it out it is awesome! Just holde <cmd> and for example drag a name of a file listed by ls to your finder, that’s it.

Here you can find iTerm2 on Github: https://github.com/gnachman/iTerm2

Easy way to use Tor on Mac OS X and Linux

Tor_logo

If you want to use Tor on your Mac OS X or Linux there is a new bundle you can easy use. The bundle includes all necessary tools and a preconfigured Firefox with the necessary plugin.

Up to now the Tor Browser Bundle is still beta but for me it works without problems. I could post a link here but please download it directly from the Tor website: www.torproject.org and verify the checksum to be sure you got a correct version of the software.

I tested the version on Mac and on Fedora 15. Just extract the downloaded file and run the start script or click on the symbol and everything starts without further user interaction needed. To be sure your identity is safe please read the information here: https://www.torproject.org/download/download.html.en#warning

Maybe you are in the position to support the Tor project by running a relay or a bridge to make the Tor network more powerful and secure for people who need to use this nice tool for uncensored internet access.

Some basic information about running a relay: https://www.torproject.org/docs/tor-doc-relay.html.en

Secure erase USB – Stick or Hard Disk on Mac OS X

Mac OS X brings a build in solution for secure erasing hard disks or usb devices. The option you should choose depends on what data where stored on the device you want to delete.

For example if you want to sell your old private hard disc with all your private photos your tax information etc. on it, you should have some time to delete it secure. If it’s just a usb stick with some music on it you maybe can safe some time and choose a faster option. If the device is for business use and it has high secure information stored on the it you should think about selling this device. In some cases it’s better to erase the data and destroy the device to make it not useable for anybody.

I use the Disk Utility to do this job. There are some console methods as well but they do the same thing. The erase mechanism which is built in the Disk Utility is certified by government institutions (Department of Defens) of the US and should do its job. If you need higher or different security certification you maybe can check the German BSI homepage for information about alternative tools and methods.

Disk Utiltiy Screenshot

Select the Secure Erase Options which fits best to your needs.

Secure Erase Options Screenshot

Secure Erase USB Stick Disk Utility

Update Mac OS X 10.6 to Mac OS X 10.7 alias Lion

Yesterday Mac OS X Lion was released and after I made a backup of my machine I started the install process to upgrade to Lion.

Where can you download Lion? The only way up to now is to buy it in the Apple Appstore. I wrote a tutorial based on a post I found in the internet how to burn a install DVD from the downloaded file here.

The install process takes around 30 minutes on my old Mac Book Pro. Before I started the upgrade process I tried to update all of my installed software to a Lion compatible version. For example Little Snitch need to be updated to version 2.40. The most of my installed software delivered updates the last weeks and months to be Lion compatible.

If you are doing a lot of music stuff with your mac you should wait some time with the update. Many of the well known products are not Lion ready at the moment.

The most important applications I am using are Mail, Adium, Firefox, iTerm, SubEthaEdit, 1Password and some Java based Applications like Eclipse and Netbeans.

After the first restart and login spotlight is indexing the hard disk which slows down the performance a little bit. To be sure everything works fine I started Mail and this takes some time because it updates the mailstore. In my case this takes around 3 minutes. Time to check how I can install java. In Lion java is not included anymore. But this is not a problem. I started terminal and tried what happens if i run java -version and in the next moment Lion asked me to download and install java.

Firefox, Adium, iTerm, 1Password and SubEthaEdit work perfectly. The spotlight indexing process toke around 45 minutes.

For me the update process worked like a charm. Check if all your applications are compatible and make a backup. Then you can enjoy the new features of Apples newest operating system.

SizeUp:

A tool that doesn’t work with Mac OS X 10.7 is SizeUp. I hope they will provide an update the next days or weeks. Update: Version 1.3.1 is Lion compatible and works for me after deleting all old SizeUp related files using the app delete feature from ForkLift.

Truecrypt:

The second tool which doesn’t work is Truecrypt because of the incompatibility of MacFUSE. Here you can download a compatible MacFUSE version. Use the latest TrueCrypt Version 7.0a. Thanks to Stefan Litter.

UTMS Huawei:

Another thing I was not sure if it would still be working after the update was my UMTS/3G Huawei E176 stick. When I bought it Snow Leopard just was released and it didn’t came with a working installer for Snow Leopard but I found a way to install just the driver and configure it manually. But the stick still works for me. If you need to know how to install just the driver for a huawei umts stick you can review my blog post here.