munin-node-configure rules

It occurred to me that I should be able to do whatever ubuntu does to automatically choose the right plugins when setting up munin-node. So I went looking and found munin-node-configure in all it's glory. Re-purposing a server image for mysql just a little bit easier:

Loading mentions Retweet
Comment (1)
Posted 3 months ago

Updated YC Company Hosting Stats

Previous versions are here and here (thanks cperciva). The standout change is the rise of Slicehost.
This time around the script pulled domains straight from YC's FAQ.

Slicehost LLC                            14
anyvite.com
auctomatic.com
cloudkick.com
echodio.com
foodoro.com
heyzap.com
ididwork.com
insoshi.com
mightyquiz.com
picwing.com
polleverywhere.com
posterous.com
tipjoy.com
voxli.com
SoftLayer Technologies Inc. 14
280north.com
appjet.com
bountii.com
chatterous.com
disqus.com
fliggo.com
getdropbox.com
heysan.com
scribd.com
slinkset.com
snaptalent.com
startuply.com
virtualmin.com
xobni.com
Amazon.com, Inc. 13
backtype.com
divvyshot.com
fathomdb.com
frogmetrics.com
fuzzwich.com
heroku.com
jamglue.com
socialbrowse.com
textpayme.com
thesixtyone.com
webmynd.com
zecter.com
zumodrive.com
Rackspace.com, Ltd. 4
inklingmarkets.com
omgpop.com
snipd.com
ticketstumbler.com
ThePlanet.com Internet Services, Inc. 3
adpinion.com
mixwit.com
reble.fm
GoDaddy.com, Inc. 3
playturf.net
splashup.com
wundrbar.com
ServerBeach 2
addher.com
clickpass.com
pair Networks 2
co2stats.com
snipshot.com
Peer 1 Network Inc. 1
rescuetime.com
Hurricane Electric, Inc. 1
octopart.com
iWeb Technologies Inc. 1
popcuts.com
Internap Network Services Corporation 1
loopt.com
RIPE Network Coordination Centre 1
songkick.com
Justin.tv, Inc. 1
justin.tv
Level 3 Communications, Inc. 1
airbnb.com
Global Netoptex, Inc 1
clickfacts.com
Linode 1
draftmix.com
nLayer Communications, Inc. 1
reddit.com
eNom, Incorporated 1
likebetter.com
Layered Technologies, Inc. 1
buxfer.com
BitPusher, LLC 1
wufoo.com
Weebly, Inc. 1
weebly.com
NoZone, Inc. 1
thinkature.com
Global Net Access, LLC 1
contestmachine.com

Total # of Domains 71
Total # of Providers 24

Loading mentions Retweet
Comments (0)
Posted 5 months ago

Better wildcarded subdomains for testing locally on OS X

Locally testing apps that let users create their own subdomains can be a pain. As much as I wish it were as easy as putting "*" in /etc/hosts as a wildcard, it has to be more complicated. For a long time I had a DNS server running locally that resolved everything under .dev to 127.0.0.1, but when I replaced my hard drive recently I went shopping for a better solution. I found one, proxy auto config files.

With a little help from stack overflow I came up with the following to make anything that ends in .dev route to localhost:

function FindProxyForURL(url, host) {
  if (shExpMatch(host,"*.dev")) {
    var port = url.match(/^\w{3,5}:\/\/[^:\/]*(:(\d+))?/)[2];
    var proxy = "PROXY localhost";
    if(port){proxy += ":" + port;}
    return proxy;
  }
  return "DIRECT";
}

Put the above in a file somewhere (I named mine ~/.proxy.pac) then to add it go to Network in System Prefences and add it to Proxies in advanced mode:


This will work for Safari. You can add it again in the Firefox proxies setting, but even better is to just install the System Proxy extension that will make Firefox use the system wide proxy settings. For IE testing in VMWare I just replaced "localhost" in the var proxy = "PROXY localhost"; line with the IP of my mac that VMWare shares with the IE VM. IE also seemed to deal better with a pac file accessible via an HTTP URL instead of a file path so I hosted the IE pac file on my local webserver.

Loading mentions Retweet
Filed under  //  osx  
Comments (0)
Posted 5 months ago

RSpec has profiling built in. Awesome.

--format profile:spec/profile.txt

Add the above to spec/spec.opt

Loading mentions Retweet
Comments (0)
Posted 5 months ago

Zsh Capistrano Task Completion on OS X

The Zsh task completion I found for Capistrano was a bit out of date.

The following is working for me:

_cap_does_task_list_need_generating () {
  if [ ! -f .cap_tasks ]; then 
    return 0;
  else
    accurate=$(stat -f%m .cap_tasks)
    changed=$(stat -f%m config/deploy.rb)
    return $(expr $accurate '>=' $changed)
  fi
}

_cap () {
  if [ -f config/deploy.rb ]; then
    if _cap_does_task_list_need_generating; then
      echo "\nGenerating .cap_tasks..." > /dev/stderr
      cap -vT | awk 'FB != 1 {if ($0 ~ /^$/){FB=1}else{print $2}}' > .cap_tasks
    fi
    compadd `cat .cap_tasks`
  fi
}

compdef _cap cap

Based on rake task completion.
Put it somewhere like ~/.zsh/cap_completion and add the following to ~/.zshrc or ~/.zprofile

 # enable completion if you haven't already
autoload -U compinit
compinit
 
# load capistrano completion
source ~/.zsh/cap_completion

Loading mentions Retweet
Filed under  //  capistrano   osx   zsh  
Comments (0)
Posted 8 months ago