Developing on OS X – Part 1

This multipart series will take you through how to setup a Python development environment on OS X Yosemite & El Capitan.  We will setup Python…and the various helpers I use for Django development.  We’ll also install a few other applications I make use of in my day-to-day coding activities.  For this first part, we’ll go through settings up the various helper applications we’ll end up using for our Python setup

Enabling Writing to NTFS

Install Homebrew and Homebrew Cask

For anyone new to OS X, homebrew is a package manager, and it enables you to install command-line applications and libraries that would require manual compilation.  While Homebrew Cask extends Homebrew.

To install homebrew, run this command on your terminal:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

To get Homebrew Cask run this command on your terminal:

brew tap caskroom/cask

We’re now ready to install osxfuse…El Capitan users will want to install the 3.x.x version (3.1.0 or higher would be best) to avoid System integrity Protection issues https://github.com/osxfuse/osxfuse/releases.  For Yosemite, brew will suffice

brew cask install osxfuse

The final step to give you write-access to NTFS will be to install ntfs3g.

brew install homebrew/fuse/ntfs-3g

If using El Capitan, System Integrity Protection’s fs role will first need to be disabled.  This is needed to enable writing to /sbin

  • reboot and hold CMD+R to go into recovery mode
  • Run this on a terminal: $ csrutil disable
  • reboot normally

Create a symlink to mount NTFS

sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.original
sudo ln -s /usr/local/sbin/mount_ntfs /sbin/mount_ntfs

Remember to re-enable System Integrity Protection (and re-lock the system directories) if you’d previously disabled it (same steps as before), only run $ csrutil enable

After that you should now be able to read and write to your NTFS drives.

Xcode

Xcode is an integrated development environment (IDE) containing a suite of software development tools developed by Apple for developing software for OS X and iOS.  While you don’t need the entire suite, you’ll want to install the command line tools.  Run this command then follow the instructions:

xcode-select --install

Terminal

I always like having a good terminal at my disposal…iterm2 is my custom terminal of choice on OS X.  To get iTerm2, download and install it as a normal OS X pkg file

Version Control

It’s always recommended to have a VCS in place when you’re writing your code….this way you can always revert to a previously working version of your code if you break something along the line.  It’s a matter of personal preference which VCS you use, but I like git.  And for anyone new to VCS, this handy guide explains it all.

To install git:

brew install git

 

Next step is to configure git for your setup.  If you haven’t configured your SSH keys, that would be the first thing.  If you get stuck, this Github link will help


ssh-keygen -t rsa -C "<your-email-address>"
git config --global user.name "<your-name>"
git config --global user.email "<your-email-address>"

 

After this add your key to your Github account (same process for Bitbucket or any other code hosting site where you can upload your SSH keys).

PRO TIPS:

  • You can never be too careful with your code so it’s always a good idea to enable two-factor authentication whenever possible.
  • For Android users, if you change phones frequently, instead of the Google Authenticator app, you can check out Authy…it’s slightly better since it has a clud backup feature, and if you’re a Chrome user, you can even register your browser as an MFA device

That’s it for the basics…in the next blog post we’ll get down and dirty with getting Python running

Advertisements

Notepadqq – great Notepad++ alternative on Ubuntu

I’ve recently had to switch by dev setup from Windows+VMWare to working from Ubuntu since I needed to use Vagrant+Ansible, and that dev setup never plays well with Windows.  This meant having to go through a new setup and look for alternatives to most of my favourite Windows tools.  One of these was Notepad++ I could of course use Wine and emulate Windows, but I felt there was an existing package that can run on Ubuntu without going through Wine.  After a brief search on Google, I came across Notepadqq.  It’s an opensource (free as in speech) editor for the Linus desktop that has a Notepad++ look and feel.

Screenshot from 2014-11-11 13:09:32

Some of the features include:

  • Syntax highlighting for about 100 different languages.
  • Code folding
  • Colour schemes
  • File monitoring
  • Multiple selection
  • Search text using the power of regular expressions
  • Organize documents side by side
  • Real-time highlighting to find near identifiers in no time.

To install the latest version (0.39.0 at the time of writing), you need to follow these steps:

Install Notepadqq 0.39.0 on Ubuntu 14.04 & Ubuntu 14.10
sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq

Install Notepadqq 0.39.0 on Debian OS (change version number as per the desired one)
sudo apt-get install gdebi

For 32bit OS
wget "https://launchpad.net/~notepadqq-team/+archive/ubuntu/notepadqq/+files/notepadqq_0.39.0-1%7Etrusty1_i386.deb" -O notepadqq_0.39.0_i386.deb
sudo gdebi notepadqq_0.39.0_i386.deb

For 64bit OS
wget "https://launchpad.net/~notepadqq-team/+archive/ubuntu/notepadqq/+files/notepadqq_0.39.0-1%7Etrusty1_i386.deb" -O notepadqq_0.39.0_amd64.deb
sudo gdebi notepadqq_0.39.0_amd64.deb

After that, you should have your text editor ready for use 🙂