Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am justfalter on github.
  • I am falter (https://keybase.io/falter) on keybase.
  • I have a public key whose fingerprint is 6261 EBCC 85FB DFB3 1211 4434 04AF 52AC D43A B1C2

To claim this, I am signing this object:

View gist:8c5c3710ea5b64aa4e0d

While Raspbian is my go-to distro for Raspberry Pi, the image includes a huge number of packages that I don't use.

So, to slim-down my Raspbian image, I run the following:

  apt-get purge --auto-remove ^xserver ^x11 ^libx11 libxau6 libxdmcp6 ^libxcb penguinspuzzle hicolor-icon-theme menu-xdg ^epiphany ^gstreamer ^gvfs xdg-utils ^zenity ^gnome ^gconf ^libgnome ^gsettings desktop-file-utils wolfram-engine
  apt-get autoremove --purge

This will remove the X11 stuff, GNOME, Wolfram, and a handful of other things. The number of packages installed dropped from ~900 to less than ~400. My installation goes from ~2.5gig down to 1.2gig.

View gist:adc4f0d61f34a43a8bc5
require 'hashie'
require 'pp'
class A < Hashie::Dash
include Hashie::Extensions::IndifferentAccess
property :some_array
property :some_hash
property :some_object
end
View install_cifv1_centos6_with_selinux.md
  1. Install dependencies
    sudo yum install sudo rng-tools postgresql-server httpd httpd-devel mod_ssl gcc make expat expat-devel mod_perl mod_perl-devel perl-Digest-SHA perl-Digest-SHA libxml2 libxml2-devel perl-XML-LibXML uuid-perl perl-DBD-Pg bind bind-utils perl-JSON rsync perl-Unicode-String perl-Config-Simple perl-Module-Pluggable perl-MIME-Lite perl-CPAN perl-Class-Accessor perl-YAML perl-XML-Parser uuid uuid-devel uuid-perl perl-Net-DNS perl-DateTime-Format-DateParse perl-IO-Socket-INET6 openssl-devel perl-Module-Install wget perl-Net-SSLeay perl-Class-Trigger perl-Date-Manip libuuid-devel
    
    wget http://dl.fedoraproject.org/pub/epel/6/x86_64/libapreq2-2.13-1.el6.x86_64.rpm
    wget http://dl.fedoraproject.org/pub/epel/6/x86_64/libapreq2-devel-2.13-1.el6.x86_64.rpm
    wget http://dl.fedoraproject.org/pub/epel/6/x86_64/perl-libapreq2-2.13-1.el6.x86_64.rpm
    sudo rpm -i libapreq2-2.13-1.el6.x86_64.rpm libapreq2-devel-2.13-1.el6.x86_64.rpm perl-libapreq2-2.13-1.el6.x86_64.rpm
    
View gist:6328587

When I have to develop on Linux platforms, I'll typically mount the filesystem remotely, and and write all my code from my Mac. I'll then ssh into the remote host to build and execute my code.

I'll use the same channel for managing my source code, running git locally rather than on the remote host. This is because 9 times out of 10, I'll have accidentally made several commits as 'root' on the remote host because I've forgotten to configure git in the first place.

A simple way I avoid this is by adding the following to my .bashrc or /etc/bash.bashrc on the remote host:

alias git="echo \"DONT'T USE GIT HERE, DUMBASS\""

I giggle every time this message pops up, and then immediately switch to the proper terminal. If I really have to run git on the remote host, I can just call /usr/bin/git, directly.

View how_to_install_qcachegrind_on_osx.txt
SUMMARY
I like to use kcachegrind for doing profiling on my ruby code. Most of my development
is done on OSX, and while you can install kcachegrind via macports, it takes forever
because it has to build KDE, as well. Much to my surprise, the fine folks who
wrote kcachegrind also made a QT version, qcachegrind. I was able to build this on
OSX without too much effort, only having to install QT and GraphViz. Yippie!
I'm running OSX 10.6.7, with Xcode 4. My default gcc/g++ version is 4.2. I'm sure
it will build just fine on earlier versions of Xcode, but I haven't tested it.