Skip to content

Instantly share code, notes, and snippets.

View atl's full-sized avatar

Adam Lindsay atl

View GitHub Profile
@atl
atl / ubooquity
Last active December 19, 2017 06:33
ubooquity rc.d
#!/bin/sh
# PROVIDE: ubooquity
# REQUIRE: NETWORKING
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# ubooquity_enable (bool): Set it to YES to enable mdnsd(8) on startup.
@atl
atl / launcher.ipynb
Last active December 14, 2015 15:19
This is a IPython Notebook on how to provision an IPython Cluster on the Joyent Public Cloud. It is a companion for this blog post: http://atl.me/2013/joyent-ipython-cluster . It may be viewed on the Notebook Viewer: http://nbviewer.ipython.org/5107045 .
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@atl
atl / README.md
Created March 7, 2013 09:37
IPython on Joyent provisioning scripts
@atl
atl / trac-init.sh
Last active December 11, 2015 05:49
Minimal initialization script to set up Trac in the Joyent Public Cloud
#!/usr/bin/sh
# Install trac
/opt/local/bin/pkgin -y in trac
# set up the base directory (set as default by the SMF manifest)
/opt/local/bin/mkdir /trac
/opt/local/bin/chown www:www /trac
# configure a minimal base environment
@atl
atl / README.md
Last active February 15, 2019 16:57
enable ssh-agent transparently and pervasively in Mac OS X Lion/Mountain Lion

This is a quick configuration upgrade that allows you to continue using ssh as you have, but with the added benefit of ssh-agent forwarding when logged into remote hosts, meaning no more keys on intermediate servers and the like.

Requirements

This snippet assumes that you've been using ssh, ssh keys, and authorized_keys on remote hosts.

  • .ssh/id_dsa and/or .ssh/id_rsa already exist
  • keys are authorized on the remote servers you have been using
  • you have at least a minimal working .ssh/config file
@atl
atl / google_twunter_lol.json
Created July 28, 2011 21:15 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@atl
atl / diff
Created June 16, 2011 12:53
pyechonest.artist.extract
--- a/pyechonest/artist.py Thu Jun 16 13:40:52 2011 +0100
+++ b/pyechonest/artist.py Thu Jun 16 13:51:16 2011 +0100
@@ -876,3 +876,28 @@
result = util.callm("%s/%s" % ('artist', 'similar'), kwargs)
return [Artist(**util.fix(a_dict)) for a_dict in result['response']['artists']]
+def extract(text='', start=0, results=15, buckets=None, limit=False, max_familiarity=None, min_familiarity=None,
+ max_hotttnesss=None, min_hotttnesss=None):
+ buckets = buckets or []
+ kwargs = {}
@atl
atl / instructions
Created March 24, 2011 12:49
HOWTO: compile and install redis on a no.de machine as of 2011-03-24
# First, we need a little extra effort to install GCC
pfexec pkg_add gcc44
export PATH="$PATH:/opt/local/gcc44/bin"
pkgin in binutils
# make and install
mkdir ~/sw
cd ~/sw
wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
gtar xvf redis-2.2.2.tar.gz
@atl
atl / filtered_jTweetsAnywhere.html
Created June 3, 2010 11:29
example jTweetsAnywhere usage that filters out replies and old-style retweets, hides selected hashtags, preserves carriage returns, and hides repetitions of a userpic
<html>
<!-- I'm a beginnner with JS/jQuery, so I welcome suggestions
on how to make it more idiomatic. -->
<head>
<link rel="stylesheet" type="text/css" href="jquery.jtweetsanywhere-1.0.0.css" />
<style type="text/css">
/* Since we're showing one user's stream, show the profile image the first time: */
.jta-tweet-profile-image {visibility: hidden}
.jta-tweet-list-item:first-child .jta-tweet-profile-image {visibility: visible}
</style>
#!/usr/bin/env python
"""worker.py: An implementation of an event-based asynchronous pattern.
Uses generators to allow asynchronous tasks to be coded in-line. Allows the
implementer to define what technique is used to execute asynchronously and
which generator iterations are executed asynchronously.
References:
http://code.activestate.com/recipes/576952/ [inline asynchronous code]