Skip to content

Instantly share code, notes, and snippets.

@bhyde
bhyde / gist:9515331
Last active August 29, 2015 13:57
cl-launch doesn't read it's init file until you beg?
bash-3.2$ cl-launch --version
cl-launch 3.22.1
Supported implementations:
sbcl, cmucl (lisp), clisp, ecl, ccl (openmcl), abcl,
xcl, gcl (gclcvs), allegro (alisp), lispworks, scl
Local defaults for generated scripts:
will search in this order these supported implementations:
sbcl clisp ccl ecl cmucl gclcvs lispworks allegro gcl abcl scl
@bhyde
bhyde / Readme.org
Last active August 29, 2015 13:57
asparagus

P is a peer 2 peer scheme based on WebRTC.

The fun thing here is a network status widget defined in mon.js. It displays the list of peers and their isOpen status.

drc.html and drc.js attempt to be the simplest peers possible.

I don’t understand:

  1. Why I get to connect message for each peer I fire up.
@bhyde
bhyde / gist:52647332e89074bb9977
Created June 27, 2014 15:55
Teach emacs to indent cl-flet and cl-macrolet.
;;; gosh.el --- control our enthusiasm
;; -*- mode: emacs-lisp; lexical-binding: t; -*-
;; Local Variables:
;; lisp-indent-function: common-lisp-indent-function
;; eval: (put 'cl-flet 'common-lisp-indent-function (get 'flet 'common-lisp-indent-function))
;; eval: (put 'cl-macrolet 'common-lisp-indent-function (get 'flet 'common-lisp-indent-function))
;; End:
@bhyde
bhyde / establish-routing-to-boot2docker-container-network
Last active November 2, 2019 18:59
Boot2docker - teach the mac how to connect to the containers by adjusting it's routing.
#!/bin/bash
# Script to instruct the Mac how to route packets to the
# software defined network where containers created via boot2docker
# reside. This lets you casually directly to ports (ssh, http, etc. etc.)
# on those containers.
function ERROR(){ echo "ERROR: $*" ; }
function FAIL(){ echo "FAILING: $*" ; exit 1; }
if [[ 'running' != $(boot2docker status) ]]
then FAIL "boot2docker's VM not running" ; fi
IP_OF_DOCKER_HOST=$(boot2docker ip 2> /dev/null)
@bhyde
bhyde / quickload_system_test
Created July 8, 2014 17:18
Assuming you have a working docker setup 'quickload_system_test foo' will (ql:load "foo") in a container and leave a of that in runs/foo/foo.log
#!/bin/bash
cd $(dirname $0)
set -o nounset -o errexit
function LOG(){ echo "LOG: $*" ; }
function ERROR(){ echo "ERROR: $*" ; }
function cleanup(){ echo '' ; }
trap "cleanup; ERROR in $0; exit 1" ERR
if [[ 0 == $# ]] ; then ERROR "missing system name arg."; exit 1; fi
QL_SYSTEM="$1"
DIR="runs/$QL_SYSTEM"
#!/bin/bash
# get-docker-socket-from-remote <name> <user>@<host>
# Create a unix socket at /tmp/<name>-docker.sock which, when
# used will ssh to <user>@<host> and connect to the docker
# socket at <host>:///var/run/docker.sock
# Note:
# 1. This forks a subjob that manages the local socket.
# Rmember to kill that when your finished
@bhyde
bhyde / start-droplet-setup-ssh
Created July 30, 2014 21:44
Create droplet using tugboat, and wait for it. Wait till we can ssh_keyscan can get it's host key. Update my known_hosts. Plus, a paranoid check that ssh is working reliability.
#!/bin/bash
# Usage: start-droplet-setup-ssh <name> london docker
NAME="$1"
REGION="$2"
IMAGE="$3"
function LOG() { echo "LOG: $*" ; }
function ERROR() { echo "ERROR: $*" ; exit 1 ;}
@bhyde
bhyde / bad_indent.sh
Created November 18, 2014 18:31
A clever scheme to indent shell output, which doesn't work :(
#!/bin/bash
function indent(){
exec 6>&1
exec > >(sed 's/^/ /')
}
function end_indent(){
exec 1>&6 6>&-
}
@bhyde
bhyde / transcript
Last active August 29, 2015 14:10
pylint install failure, syntax errors?! under pyenv//2.6.9
$ pyenv versions
system
2.6.9
* 2.7.8 (set by /home/bhyde/.../.python-version)
$ ls ~/.pyenv/versions/
2.6.9 2.7.8
$ rm -rf ~/.pyenv/versions/2.6.9
$ pyenv install 2.6.9
Downloading Python-2.6.9.tgz...
-> https://yyuu.github.io/pythons/7277b1285d8a82f374ef6ebaac85b003266f7939b3f2a24a3af52f9523ac94db
;;; package --- autoname remote shell buffers
;;; Commentary:
;; Adjustments to comint's shell mode.
;;; Code:
;; This is based on my-shell in http://www.emacswiki.org/emacs/ShellMode