Skip to content

Instantly share code, notes, and snippets.

@lparry
lparry / portforward.sh
Created October 12, 2011 06:26
Unicorn portforwarding script
#!/bin/sh
sudo ipfw add fwd 127.0.0.1,8080 ip from any to any dst-port 80 dst-ip 127.0.0.1,80
@lparry
lparry / InstallAirVideoServerDebian.sh
Created October 13, 2011 11:20
Install the AirVideoServer on a Debian server
INSTALL_DIR="/home/maicki"
FFMPEG_DIR="$INSTALL_DIR/ffmpeg"
PROPERTIE_FILE="$INSTALL_DIR/test.properties"
MEDIA="Movies:/home/maicki/Movies"
AIR_VIDEO_LINK="http://inmethod.com/air-video/download/linux/alpha4/AirVideoServerLinux.jar"
mkdir $INSTALL_DIR
cd $INSTALL_DIR
sh-3.2$ time ( curl -s http://graphicriver.local/javascripts/jquery-1.7.0.min.js > /dev/null )
real 0m5.009s
user 0m0.004s
sys 0m0.003s
sh-3.2$ time ( curl -s http://localhost/javascripts/jquery-1.7.0.min.js > /dev/null )
real 0m0.008s
user 0m0.004s
sys 0m0.002s
@lparry
lparry / 0-readme.md
Created February 22, 2012 04:12 — forked from mickm/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@lparry
lparry / 1.9.3-p194-railsexpress
Created April 26, 2012 03:17
1.9.3-p194-railsexpress
build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p125/railsexpress/02-railsbench-gc.patch | patch -p1
curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p125/railsexpress/03-display-more-detailed-stack-trace.patch | patch -p1
curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p125/railsexpress/04-fork-support-for-gc-logging.patch | patch -p1
curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p125/railsexpress/05-track-live-dataset-size.patch | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
@lparry
lparry / 1.9.3-p385-github
Created February 23, 2013 03:21
ruby-build definition for Github's 1.9.3 fork
build_package_autoconf_then_standard() {
local package_name="$1"
if [ "${MAKEOPTS+defined}" ]; then
MAKE_OPTS="$MAKEOPTS"
elif [ -z "${MAKE_OPTS+defined}" ]; then
MAKE_OPTS="-j 2"
fi
# Support YAML_CONFIGURE_OPTS, RUBY_CONFIGURE_OPTS, etc.

Keybase proof

I hereby claim:

  • I am lparry on github.
  • I am lparry (https://keybase.io/lparry) on keybase.
  • I have a public key whose fingerprint is 2E45 E89C B285 3D22 27BB F767 5791 D617 01B7 266D

To claim this, I am signing this object:

@lparry
lparry / iterm2-rerun-last-command.py
Last active April 13, 2023 01:31
Iterm2 python api script for reruning the last command in a special tab, to be bound to a global shortcut
#!/usr/bin/env python3.7
import iterm2
# This iterm 2 script can be bound to a global shortcut so you can rerun the
# previous command in a special tab without switching focus
async def main(connection):
app = await iterm2.async_get_app(connection)
session_id = await app.async_get_variable("user.rspec")