Software to make your OSX usable in my opinion

This post is mostly for friends who have recently gotten Apple laptops and are trying to use them to code. I’m an OSX novice, but do have a particular style of work and I’ve found the few tools needed to turn OSX into a usable platform for my style. They may help you too.

Last Updated: Jan 10, 2012

  • Google Chrome
  • Better Touch Tool & Better Snap Tool (please pay for it! It’s the most useful non-free app on this list, and is about $3.00!) -
    I use them to do :
    • three finger tap is a middle click (great for pasting in terminal, and closing tabs in chrome, etc.)
    • command 2 (maximize window), command 1 (left half window), command 3 (right half window) … etc the pattern
    • three finger swipe left/right in chrome is forward/back tab
    • three finger swipe up in chrome is close tab (nice!)
    • dragging windows to screen edges does the right maximize/size effect
    • option arrows moves around spaces (though now four finger gesture with Lion is pretty sweet)
    • middle click (three fingers) on ‘fit’ button actually does maximize
    • and so many more.
    • Better Snap Tool: also: function-control – move window under cursor. function-option – resize window under cursor. This alone is worth your $3.00.
    • Seriously, better touch tool MAKES OSX WORK, and you should donate by purchasing better snap tool, as the developer requested.
  • Caffeine – stop computer from dimming after 15 minutes/etc while watching movies
  • Lime Chat – Irc
  • iTerm2   (was: TotalTerminal (used to be Visor) -) I bind the slide-down visor terminal to F12, so whenever I hit f12 a nice terminal (with opacity) slides down and I do my thing. Used constantly, along with emacs.
  • iterm2 – Thanks to feedback in the comments, I’ve tried out iterm2 and like it a LOT. It’s likely to replace TotalTerminal for me. They are both Very similar (and both have a top-screen mode that can be shown using a single key. But you have to turn this on in iterm2).
  • LibraOffice – I don’t really use MS office, doing most of my work in google docs/sheets/etc or wikis, but for me LibraOffice is sufficient for those rare cases
  • Adium – Chat
  • Skype – sometimes you gotta’
  • Microsoft Remote Desktop Connection – works fine
  • Chicken of the VNC – works fine for now, though I am a rare VNC user (I prefer NX when I can)
  • Emacs – I prefer the windowed version rather than the default command line version of emacs right now. I’m still working on making them play nice together, but I use this for most of my development.
  • homebrew – I try to keep my dev machine pretty sparse, but my job requires mysql, rabbitmq, memcached, and some other things. All well ‘scripted’ by the folks on homebrew. Things I have installed through brew: git, aspell, memcached, markdown, mysql, nmap, wget, tree, readline, rabbitmq…
  • dropbox- works nicely
  • noobproof as a firewall GUI to make sure some ports I use for $WORK are not available to the outside world (along with the OSX firewall being enabled)
  • MouseLocator is pretty cool, I use it right now, though I’m not sure how long I’ll use it.
  • AppCleaner – it’s what I use to delete apps, since it’s pretty good at throwing away preferences as well
  • AppFresh – Keep those apps up to date.
  • I cannot recommend gfxCardStatus because it kept causing problems for flash on Chrome, sorry! It would have been useful. I’ll keep trying it.
  • Monolingual – Only if you’ve got space problems (you bought the 120GB SSD?) you can strip some languages from some OSX apps. I wouldn’t try this on Microsoft apps, and be sure to google before use to find any problems. If you’ve got the HD space, don’t bother.
  • Notational Velocity / nvAlt – pretty good for some types of notes. I like it. [Note: I'm not really using this anymore, though I still think it's a good application]
  • I also use iCal and, gasp, Mail.app! Both of these of course are backed by google mail and calendar. iCal works fine, no issues. Mail.app is about where gmail was a few years ago, but I find it much more convenient to have a local mail app rather than go into browser. Just a personal preference, gmail still kicks ass. I use IMAP with my many gmail accounts. Let me know if you have any questions about the setup.
  • I also use meteorologist for my weather lookup needs, and I’ve got growl installed for notifications.
  • Use use spotlight as my launcher – which means:
    • I set my dock to only show running programs (and chrome, which I do occasionally close to free mem).
    • I just use command-space – program name to launch things, I don’t use the ios launcher feature nor do I go to Applications directory
    • Although I thought I would immediately get it – I did not bother with quicksilver / Jeeves yet. That may change.
    • I now primarily use QuickSilver, and while I find it annoying for a few things, it’s better than spotlight for the rest. I mostly use it as an app launcher along with clipboard history, nothing too fancy.
  • http://macrumors.com
  • perlbrew of course to get a current perl. Don’t mess with the downlevel Apple perl
  • I sometimes use JackSMS for fun when I leave my laptop at coffee shops, but I haven’t relied on it yet. I was hoping to build a solution with Proximity to have my phone auto-control Jack.
  • ack for code search
  • Herald for Mail.app notifications of new mail. [Note: I'm note using this anymore, since I check mail relatively regularly by revealing the dock which I normally have hidden]
  • OmniGraffle for diagraming (not free)
  • DashExpander – text expander, though I don’t use it often
I’ll update if I think of more things or if I change my usage.

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

Padre DMG for OSX Lion – alpha build

With great pleasure I can finally announce that we’ve got OSX Lion builds for Padre!

You can grab the latest here: http://wildperl.com/wp-content/uploads/Padre/0.86/padre-osx-uni-0-86-0-LION.dmg

Getting reliable packages for Padre on OSX has been my goal for the past few weeks, and these have surfaced a number of OSX bugs that have not yet been adressed.

You can find a list of current defects (and open your own) here: http://padre.perlide.org/trac/wiki/osxbugs

My work was really that of glue-er, and it would have been impossible if not for the real heavy lifting done by Mark @ Cava who built the packaging scripts we use, and Cava, and also supported wxwidgets building on Lion.

We are using Cava to package on OSX at the moment (and potentially other platforms in the future).

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

wxwidgets 2.8.12 (and Alien::wxWidgets) on OSX Lion

I can finally make this a short post!

I was able to combine the advice found in this post http://wiki.wxwidgets.org/Development:_wxMac  and some messages from the gurus on the wxPerl mailing list to other Lion builders.

To build Alien::wxWidgets 2.8.12, as well as (and this was the crux) Wx::Scintilla, on OSX 10.7 (Lion), I’m using:

CFLAGS='-arch i386' CXXFLAGS='-arch i386' CPPFLAGS='-arch i386' LDFLAGS='-arch i386' OBJCFLAGS='-arch i386' OBJCXXFLAGS='-arch i386' perl Build* --wxWidgets-extraflags=" --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.6 " --wxWidgets-build='yes' --wxWidgets-source='tar.bz2' --wxWidgets-version=2.8.12

*For simplicity I use the same environment and arguments for the ./Build.PL and ./Build step

Note a few things:

  1. I am using a 32 bit perl (info below) because I am using wx 2.8.12
  2. Thus I must include all those -arch prefixes when building (see link above)
  3. I set the Min version to 10.6, though I have only been able to test on 10.7
  4. The same flags must be used for wx-things like Wx::Scintilla – in my semi-automated build I drop into a cpanm –look to build these right now, but I hope to include them into my padre-brew.pl script shortly.

 

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

WWW::Mixpanel Updated v0.02 – Date Api support

I recently released WWW::Mixpanel v0.02, with added support for the Mixpanel Data API. We’ve been using Mixpanel for a few weeks and have been happy with the interface and the ease of integration. Hope this perl module helps others get started with the service.

WWW::Mixpanel can be reached on CPAN or github.

NAME
    WWW::Mixpanel

VERSION
    version 0.02

SYNOPSIS
      use WWW::Mixpanel;
      my $mp = WWW::Mixpanel->new( '1827378adad782983249287292a', 1 );
      $mp->track('login', distinct_id => 'username', mp_source => 'twitter');

    or if you also want to access the data api

      my $mp = WWW::Mixpanel->new(<API TOKEN>,1,<API KEY>,<API SECRET>);
      $mp->track('login', distinct_id => 'username', mp_source => 'twitter');
      my $enames = $mp->data( 'events/names', type => 'unique' );
      my $fdates = $mp->data( 'funnels/dates',
                     funnel => [qw/funnel1 funnel2/],
                     unit   => 'week' );

DESCRIPTION
    The WWW::Mixpanel module is a young implementation of the
    <http://mixpanel.com> API which provides realtime online analytics.
    <http://mixpanel.com> receives events from your application's perl code,
    javascript, email open and click tracking, and many more sources, and
    provides visualization and publishing of analytics.

    Currently, this module mirrors the event tracking API
    (<http://mixpanel.com/api/docs/specification>), and will be extended to
    include the powerful data access and platform parts of the api. FEATURE
    REQUESTS are always welcome, as are patches.

    This module is designed to croak on failure, please use something like
    Try::Tiny.

METHODS
  new( $token, [$use_ssl] )
    Returns a new instance of this class. You must supply the API token for
    your mixpanel project. HTTP is used to connect unless you provide a true
    value for use_ssl.

  track('<event name>', [time => timestamp, param => val, ...])
    Send an event to the API with the given event name, which is a required
    parameter. If you do not include a time parameter, the value of time()
    is set for you automatically. Other parameters are optional, and are
    included as-is as parameters in the api.

    This method returns 1 or croaks with a message.

    Per the Mixpanel API, a 1 return indicates the event reached the
    mixpanel.com API and was properly formatted. 1 does not indicate the
    event was actually written to your project, in cases such as bad API
    token. This is a limitation of the service.

    You are strongly encouraged to use something like "Try::Tiny" to wrap
    calls to this API.

    Today, there is no way to set URL parameters such as ip=1, callback,
    img, redirect. You can supply ip as a parameter similar to distinct_id,
    to track users.

  data('<path/path>', param => val, param => val ...)
    Obtain data from mixpanel.com using the Data API
    <http://mixpanel.com/api/docs/guides/api/v2>. The first parameter to the
    method identifies the path off the api root.

    For example to access the "events/top" functionality, found at
    <http://mixpanel.com/api/2.0/events/top/>, you would pass the string
    "events/top" to the data method.

    Some parameters of the data api are of array type, for example
    "events/retention" parameter "event". In every case where a parameter is
    of array type, you may supply the parameter as either an ARRAYREF or a
    single string.

    Unless specified as a parameter, the default return format is json. This
    method will then return the result of the api call as a decoded perl
    object.

    If you specify format => 'csv', this method will return the csv return
    string unchanged.

    This method will croak on errors, including malformed parameters,
    indicated by bad return codes from the api. It croaks with the text of
    the api reply directly, often a json string indicating which parameter
    was malformed.

    *To see all API methods at work, look into the module tests.*

TODO
    /track to accept array of events
        Track will soon be able to accept many events, and will bulk-send
        them to mixpanel in one call if possible.

    /platform support
        The Platform API will be supported. Let me know if this is a feature
        you'd like to use.

FEATURE REQUESTS
    Please send feature requests to me via rt or github. Patches are always
    welcome.

BUGS
    Do your thing on CPAN.

AFFILIATION
    I am not affiliated with mixpanel, I just use and like the service.

AUTHOR
    Tom Eliaz

COPYRIGHT AND LICENSE
    This software is copyright (c) 2011 by Tom Eliaz.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

JSON::Any and the problems of metapackage dependency

Edit: Have a look at the comments to this post.

Recently, I released WWW::Mixpanel, which requires JSON encoding and decoding. Without significant thought, I decided to change my usage of JSON to JSON::Any, figuring that little bit of flexibility may be useful to someone.

Unfortunately, I found out the hard way that JSON::Any and dependencies don’t play nice. Looking at the JSON::Any metafile I saw that it doesn’t require any of it’s possible implementations to install before it installs properly. This means that on a number of test systems which didn’t have any JSON package installed, my dependency on JSON::Any meant there still wasn’t a JSON package available. I’ve been spoiled a bit by the great metapackage handling of debian.

Chatting in#distzilla, the feedback seemed to be that JSON::Any wasn’t useful anymore, and that there wasn’t really competition for JSON packages.

It was an easy decision for me to switch WWW::Mixpanel v0.02 to depend on JSON (and not JSON::Any), but it made me realize that I’ve got a bit of work to do looking into metapackages in perl (if such a thing is being supported), and also reminded me how great cpantesters is.

 

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

scponly, debian, and collecting backups on remote server

I recently spent some time pushing backups from our production machine to a backup-collection machine. I wanted the backup push automated and I wanted servers to be able to easily push backups to my backup-collection machine (which also has some other roles).

I decided to use scponly with a chroot jail, that way I can collect all backups under a single tree in my collection machine, and I can give each pusher a different, and limited view of their own files through the jail. See Problems with this solution at the bottom to see what I’ll be doing next time I get to iterate on this.

Here were my steps, and other considered options at the end:

Setting up scponly on debian

For debian users in squeeze there are two flavors of scponly, the normal and the scponly-full package. If you want to also allow rsync backups (which I did) you should choose the scponly-full, which copies a few more binaries into the chroot jail. Otherwise stick with scponly.

apt-get install scponly-full
-- enable scponlyc if you didn't during initial install
dpkg-reconfigure -plow scponly-full
cd /usr/share/doc/scponly-full/setup_chroot
gunzip setup_chroot.sh.gz
chmod +x setup_chroot.sh
./setup_chroot.sh
-- the rest of the post assumes you pick the default username and location
-- If you stopped here, and tried to scp, you'd run into problems with Unknown User ID being returned
-- whenever you tried to scp. This is because you're missing some libraries that still need to be copied.
-- Below is the hammer I used to solve that problem, details from here, thanks nuno.
cp /lib/libnss_files* /home/scponly/lib
cd /home/scponly/
mv lib64/* lib && rmdir lib64 && ln -s lib lib64
-- At this point you can use SCP with password if you have that set up. I use keys so I also did the following.
mkdir .ssh
touch .ssh/authorized_keys
chown -R root:scponly .ssh
chmod 750 .ssh
chmod 640 .ssh/authorized_keys
cat >> .ssh/authorized_keys 
    <key>

At this point you should be able to execute:

scp localfile scponly@server:incoming

without using passwords.

Using rsync with scponly

There is a widely posted problem with scponly and rsync, since rsync is trying to pass -e and scponly has an issue with the getopts call. I found here that a workaround is to change the rsync version (or perhaps grab a newer version of the package). So for example this is the minimal rsync command template:

rsync -e 'ssh -p <non-standard-ssh-port>' --protocol=29 <local-files> scponly@server:incoming

Note that I pass a non-standard port to rsync by quoting the ssh command, I drop the protocol with –protocol , and I am sure to specify incoming (or whatever directory you set up in the chroot setup).

scponly debugging

You can change the scponly debugging level, which will have it return debug output to your remote command. This helped me confirm I was seeing the same parameter parsing problem as others. Default is 0.

cat > /etc/scponly/debuglevel
2

Other options

I looked into using sftp-internal directly in the sshd, but I wasn’t satisfied with the sftp cli and I had scponly working by then. If I hadn’t gotten scponly to work, then I probably would have done something more elegant, perhaps described in these other resources:

http://www.howtoforge.com/chrooted_ssh_howto_debian
http://ubuntuforums.org/showpost.php?p=9799756&postcount=5

Problems with this solution

One of the major problems with this solution is that I’ve got to track any security updates manually to my chroot. In the Other options section there are ssh-jail mechanisms that avoid this issue.

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

WWW::Mixpanel v0.01 Released

Recently, I posted to CPAN my perl module WWW::Mixpanel that interfaces with mixpanel.com‘s event tracking API. Mixpanel is an event based realtime analytics service, and at Company we’re using it to get a general idea of who’s doing what, or failing to do what.

They have a very nice funnel creation mechanism that lets us quickly ask questions like: How many people who had login failures were able to successfully log in later.
The platform is still evolving, but integration was very easy, and I hope that other folks in Perl land have it even easier with the new WWW::Mixpanel module.

NAME
    WWW::Mixpanel

VERSION
    version 0.01

SYNOPSIS
      use WWW::Mixpanel;
      my $mp = WWW::Mixpanel->new( '1827378adad782983249287292a', 1 );
      $mp->track('login', distinct_id => 'username', mp_source => 'twitter');

DESCRIPTION
    The WWW::Mixpanel module is a young implementation of the
    <http://mixpanel.com> API which provides realtime online analytics.
    <http://mixpanel.com> receives events from your application's perl code,
    javascript, email open and click tracking, and many more sources, and
    provides visualization and publishing of analytics.

    Currently, this module mirrors the event tracking API
    (<http://mixpanel.com/api/docs/specification>), and will be extended to
    include the powerful data access and platform parts of the api. FEATURE
    REQUESTS are always welcome, as are patches.

    This module is designed to croak on failure, please use something like
    Try::Tiny.

METHODS
  new( $token, [$use_ssl] )
    Returns a new instance of this class. You must supply the API token for
    your mixpanel project. HTTP is used to connect unless you provide a true
    value for use_ssl.

  track('<event name>', [time => timestamp, key => val, ...])
    Send an event to the API with the given event name, which is a required
    parameter. If you do not include a time parameter, the value of time()
    is set for you automatically. Other parameters are optional, and are
    included as-is as parameters in the api.

    This method returns 1 or croaks with a message.

    Per the Mixpanel API, a 1 return indicates the event reached the
    mixpanel.com API and was properly formatted. 1 does not indicate the
    event was actually written to your project, in cases such as bad API
    token. This is a limitation of the service.

    You are strongly encouraged to use something like "Try::Tiny" to wrap
    calls to this API.

    Today, there is no way to set 'URL' parameters such as ip=1, callback,
    img, redirect. You can supply ip as a parameter similar to distinct_id,
    to track users.

TODO
    /track to accept array of events
        Track will soon be able to accept many events, and will bulk-send
        them to mixpanel in one call if possible.

    Data API
        The data API lets you pull your data from mixpanel.

    /platform support
        The Platform API will be supported. Let me know if this is a feature
        you'd like to use.

FEATURE REQUESTS
    Please send feature requests to me via rt or github. Patches are always
    welcome.

BUGS
    Do your thing on CPAN.

AFFILIATION
    I am not affiliated with mixpanel, I just use and like the service.

AUTHOR
    Tom Eliaz

COPYRIGHT AND LICENSE
    This software is copyright (c) 2011 by Tom Eliaz.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

 

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon