Wednesday, October 23, 2013

IBM Demos Some of My Work on Youtube.com

I just noticed that IBM published a demo of some of the work I did on the IBM Network Protection NextGen IPS - Management Dashboard.

Screen shot of Dashboard



What is this thing?

This is the management dashboard for a Next Generation Intrusion Protection Device.

The NextGen IPS device like a fancy firewall that understands the content in corporate IP traffic which allows corporate management to monitor and control traffic by user (or contrived) groups, application type and more.

Here are some examples of what this device can do (and what you can manage via this dashboard):
  • A manager could allow all employees to view Facebook, but not allow the Finance group to use Facebook Chat application.
  • A manager could view which applications are hogging the corporate bandwidth
  • A manager could see who's trying to send credit card or SSN information across the network

References

http://www.youtube.com/watch?v=NB6Wea3xMGg
http://www-03.ibm.com/software/products/us/en/network-ips/
http://hackmageddon.com/tag/web-application-firewall/
http://lexsheehan.blogspot.com/2013/10/mavericks-osx-109-upgrade.html

Mavericks (OSX 10.9) Upgrade

I just upgraded one of my computers to OSX 10.9.

I'll post issues related to this upgrade that pop up as time permits...

Caution

I'd recommend your making a full backup before upgrading.

Expectations

Expect the installation to
  • take longer than advertised
  • require reinstall of your Java runtime
  • replace SecondBar functionality (if you have multiple monitors)

Install Java Runtime

If you get an error message like, "you need a java se 6 runtime" when opening your mac apps, just install a Java Runtime from: http://support.apple.com/kb/DL1572?viewlocale=en_US


Install Nokogiri

Error when installing nokogiri gem


Installing nokogiri (1.5.4)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/lex/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/lex/.rbenv/versions/1.9.3-p448/bin/ruby
	--with-zlib-dir
	--without-zlib-dir
	--with-zlib-include
	--without-zlib-include=${zlib-dir}/include
	--with-zlib-lib
	--without-zlib-lib=${zlib-dir}/lib
	--with-iconv-dir
	--without-iconv-dir
	--with-iconv-include
	--without-iconv-include=${iconv-dir}/include
	--with-iconv-lib
	--without-iconv-lib=${iconv-dir}/lib
	--with-xml2-dir
	--without-xml2-dir
	--with-xml2-include
	--without-xml2-include=${xml2-dir}/include
	--with-xml2-lib
	--without-xml2-lib=${xml2-dir}/lib
	--with-xslt-dir
	--without-xslt-dir
	--with-xslt-include
	--without-xslt-include=${xslt-dir}/include
	--with-xslt-lib
	--without-xslt-lib=${xslt-dir}/lib
	--with-libxslt-config
	--without-libxslt-config
	--with-pkg-config
	--without-pkg-config
	--with-libxml-2.0-config
	--without-libxml-2.0-config
	--with-libiconv-config
	--without-libiconv-config


Gem files will remain installed in /Users/lex/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.4 for inspection.
Results logged to /Users/lex/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.4/ext/nokogiri/gem_make.out

An error occurred while installing nokogiri (1.5.4), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.4'` succeeds before bundling.
You can try upgrading homebrew ...

$ brew update
$ brew upgrade
...and you may feel good your progress, and try to reinstall nokogiri and it's dependencies...

brew install libxml2 libxslt
brew link libxml2 libxslt
gem install nokogiri
But you'll probably get the following message: Warning: No developer tools installed. You should install the Command Line Tools. Run `xcode-select --install` to install them. But you'll probably still have probably still get the following error:

clang: error: invalid arch name '-arch -D_REENTRANT=1'
error: command 'clang' failed with exit status 1
Finally, when you install nokogiri with xcode dependencies using the following you may profit:

$ gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2

Update Gemfile

Be sure to reference the proper version of nokogiri in your Gemfile.

gem 'nokogiri', '~> 1.6'


New Features

Here are a few new features to checkout
  • Upgrade existing apps (Calendar, Finder, Mail/gmail archiving, Notifications)
  • New apps (iBooks, Maps, iCloud Keychain)
  • Power Saving Functionality (Timer Coalescing, Compressed Memory, App Nap)
See the full list here: https://developer.apple.com/osx/whats-new/

Activity Monitor

I'm a fan of the new graphics in the new Activity Monitor's Network graphic...


...largely, because Apple uses the same design that I originally implemented in the IBM Network Protection NextGen IPS (NextGen) - Management Dashboard.

It's easy to see spikes in traffic and the load coming across the wire.

IBM NextGen dashboard traffic widget

The current IBM NextGen dashboard traffic widget implementation is more like what Apple used in pre-10.9 Activity Montior Network graphs:


For a short demo of the BM Network Protection NextGen IPS (NextGen) - Management Dashboard see http://www.youtube.com/watch?v=NB6Wea3xMGg

Fine Grained Control of Which Apps Get Accessibility Features

Unlike previous versions of OS X, which used a universal checkbox in an “all or nothing” approach, the new functionality in Mavericks allows users to individually choose which apps can gain control of the system.

If you use an application like CheatSheets or SizeUp, just add the app in the OSX System Preferences > Security & Privacy > Privacy > Accessibility dialog.

Thoughts

I ran into the nokogiri problem mentioned above, which is not bad and was easy to fix.

Given that this is a FREE upgrade and the tendency of Apple to not support legacy systems for long, upgrading is a no brainer.

References

http://lexsheehan.blogspot.com/2013/10/ibm-demos-some-of-my-work-on-youtubecom.html
http://www.tekrevue.com/2013/06/25/how-to-enable-access-for-assistive-devices-in-os-x-mavericks/
http://www.macrumors.com/roundup/os-x/

Thursday, October 17, 2013

Convert Spaces to Tabs in one whack

Working with CoffeeScript is a pleasure.

It is easy to create beautiful CoffeeScript code since blocks are determined by indentation.

However, that can be a two edged sword.

If you mix your SPACES with TABs, which can be easy to do in a team development environment, you are in for a world of hurt.

Fortunately, there are techniques for dealing with this TAB/SPACE issue.

Here are a few things I configure in my IDE for working with CoffeeScript files:
  • Use TAB characters instead of SPACES
  • 3 characters per TAB
  • Show Whitespaces

For non CoffeeScript files

For all other file types (not CoffeeScript) I use SPACES
  • Use SPACES for TABs
  • 3 characters (spaces) per TAB
  • Do not show Whitespaces

The reason for using SPACEs, e.g., for Ruby files, is because when copy/pasting from IDE to console you'll often get errors when using TABs.

Bash script used by find command

When I have a number of files that have spaces in them, here's how a convert the lot of them from SPACES to TABs:

unexpand_cmd


FILENAME=$1
CURRENT_PROCESS_NAME=$$
TMP_FILENAME="/tmp/$(basename $0).$CURRENT_PROCESS_NAME.tmp"
if [ -z $FILENAME ]; then
 echo "Usage:  unexpand_cmd "
 exit 1
fi
unexpand -t 3 $FILENAME > $TMP_FILENAME && cat $TMP_FILENAME > $FILENAME && rm $TMP_FILENAME

Word of caution

This assumes that the source files use units of 3 spaces for indentation.

If your source files use other units, you should replace the "3" with what ever unit your files use.

Set the execute bit


$ chmod +x ./unexpand_cmd

p.s. You'll want to save this file in a directory that's on your path.
p.s.s. Since this modifies your source files, please make a full backup before running this.

Run find command and execute unexpand_cmd on each


$ find app/assets/javascripts -name "*js.coffee" -type f -exec unexpand_cmd {} \;

Notes

When you see "Soft Tabs" in your IDE preferences, that means "Use 3 spaces instead of 1 tab character", assuming you have set your tab to 3 spaces.

Tuesday, October 15, 2013

Install Textmate Bundle for CoffeeScript

Here's all you need to do to get the CoffeeScript bundle installed for TextMate (version 1.5.11)

Example


$ cd /Applications/TextMate.app/Contents/SharedSupport/Bundle
$ git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScriptBundle.tmbundle