Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@jcf
jcf / [geoff autorelease].m
Created October 17, 2008 11:09
Helping Geoff with a Cocoa complaint
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int number = 3;
NSString * reason = [[NSString alloc] autorelease];
switch (number)
{
case 2:
NSLog(@"Number => 2");
@jcf
jcf / apache-include-ssl.conf
Created November 28, 2008 03:55
SSL configuration file for Passenger and Apache 2.2 on OS X
# OMFG! I want to f*ck Github's brains out!!
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/private/var/run/ssl_scache(512000)"
@jcf
jcf / snippet.sh
Created December 10, 2008 00:23 — forked from anonymous/snippet.sh
Open important Rails directories with TextMate's mate link
function rmate {
if [[ $# -eq 1 ]]; then
mate "${1}/app" "${1}/config" "${1}/lib" "${1}/public" "${1}/spec" "${1}/stories"
else
mate "app" "config" "lib" "public" "spec" "stories"
fi
}
#!/usr/bin/env ruby -wKU
require "rubygems"
require "hpricot"
class Crawler
def initialize(site_uri='theonlyjames.com',
wget_path='/usr/local/bin/wget')
@site_uri = site_uri
@wget_path = wget_path
sanity_check
@jcf
jcf / Download and install git from source
Created December 19, 2008 09:58
Download and install git from source (you can just copy and paste it all in to Terminal)
VERSION='1.6.0.6'
wget http://www.kernel.org/pub/software/scm/git/git-$VERSION.tar.gz
tar xzvf git-$VERSION.tar.gz
cd git-$VERSION
make configure
./configure --prefix=/usr/local
NO_MSGFMT=yes make prefix=/usr/local all
sudo make install
@jcf
jcf / ARDAgent_version.sh
Created December 20, 2008 18:08
Get the ARDAgent version via version.plist
cat /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/version.plist | awk '/CFBundleVersion/{getline;gsub(/[<string>|<\/string>]/,\"\");gsub(/^[ \t]+|[ \t]+$/,\"\");print}'
@jcf
jcf / block.sh
Created December 20, 2008 18:11
Port blocking with ipfw
sudo ipfw add 100 deny udp from any to any 2222
@jcf
jcf / com.mysql.mysqld_safe.plist
Created December 29, 2008 00:32
My Launchd plist for starting MySQL
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.mysql.mysld_safe</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
@jcf
jcf / osx_used_uids.rb
Created December 29, 2008 01:30
Prints a list of used UIDs via dscl
#!/usr/bin/env ruby -wKU
users = %x(dscl . -list /Users).split("\n")
uids = []
users.each do |user|
uids += [%x(dscl . -read /Users/#{user} uid).split[-1].to_i]
end
puts uids.sort
@jcf
jcf / Create Secure User (PostgreSQL).sh
Created December 29, 2008 01:44
Create an OS X user for secure PostgreSQL configuration
dscl . -create /Users/_pgsql
dscl . -append /Users/_pgsql RecordName pgsql
dscl . -create /Users/_pgsql UniqueID 80
dscl . -create /Users/_pgsql RealName 'PostgreSQL Server'
dscl . -create /Users/_pgsql UserShell /usr/bin/false
dscl . -create /Groups/_pgsql
dscl . -create /Groups/_pgsql PrimaryGroupID 80
dscl . -append /Groups/_pgsql RecordName pgsql
dscl . -create /Groups/_pgsql RealName 'PostgreSQL Users'