Skip to content

Instantly share code, notes, and snippets.

View stigkj's full-sized avatar

Stig Kleppe-Jørgensen stigkj

View GitHub Profile
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y python-software-properties
RUN add-apt-repository ppa:webupd8team/java -y
RUN apt-get update
@stigkj
stigkj / gw.sh
Created October 1, 2013 20:06 — forked from dougborg/gw.sh
#!/bin/bash
# Find the system gradle executable to fall back on.
GRADLE=$(which gradle)
# Default names for things
GRADLEW='gradlew'
BUILD_GRADLE='build.gradle'
GRADLEW_FOUND=false
BUILD_GRADLE_FOUND=false
#!/bin/sh
#
# PROVIDE: btsync
# REQUIRE: LOGIN DAEMON NETWORKING
# KEYWORD: shutdown
#
# To enable BTSync, add this line to your /etc/rc.conf:
#
# btsync_enable="YES"
#
#!/bin/bash
# --- Change domain password ver 0.1
# --- Ideas and comments: nuno@freelancesamurai.com
# --- Looks for the existance of smbpasswd, if it doesnt't exist (aka OS X Lion)
# --- it will connect to a linux host and run the command from there.
# --- The credentials for the linux box will be hardcoded into this script and
# --- the linux host in question should have a restricted shell for security sake.
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
tell application "Google Chrome"
activate
tell application "System Events"
tell process "Google Chrome"
#!/bin/bash
#/ jc -- jconsole via ssh proxy
#/
#/ Usage: jc [options] HOST JMX_PORT [PROXY_PORT=JMX_PORT] [JMX_HOST=HOST]
#/
#/ Starts a SOCKS proxy via ssh to connect to a
#/ JVM running on a remote and protected machine.
#/
#/ Arguments:
@stigkj
stigkj / convert-url-to-pdf.sh
Last active December 14, 2015 06:59
Converts a document on the web to PDF by using Google Document viewer.
#!/bin/sh
# by Jason A. Donenfeld
# www.zx2c4.com
if [ $# -ne 2 ]; then
echo "Usage: $0 url output-pdf-file"
exit 1
fi
# Setting up dnsmasq for Local Web Development Testing on any Device
Please note, these instructions are for OS X Lion.
First, you need to get the IP address of your machine on your local network. In OS X, the easiest place to find this is in System Preferences > Network. If you're using DHCP on your local network, you will want to make sure your computer requests the same IP address when it renews it's IP address lease. I recommend configuring the DCHP Reservation settings on your router to accomplish this. Otherwise, you can specify a manual address in your network settings:
1. Go to *System Preferences > Network*
1. Click *Advanced...*
@stigkj
stigkj / brew-more.rb
Created January 24, 2013 15:07 — forked from lwe/brew-more.rb
# Small utility which uses the homepage and nokogori to get a description from the formula's homepage.
#
# As written in the homebrew wiki:
# > Homebrew doesn’t have a description field because the homepage is always up to date,
# > and Homebrew is not. Thus it’s less maintenance for us. To satisfy the description
# > we’re going to invent a new packaging microformat and persuade everyone to publish
# > it on their homepage.
#
# Too bad no packaging microformat has yet been invented, but brew-more just first looks for a
# `<meta name="description">` tag, then for an `a#project_summary_link` tag (which is used in
#
# adds 'brew refresh' as an external command, which essentially does
# 'brew update' followed by 'brew outdated'
#
require 'update'
def outdated
outdated_brews.each do |keg, name, version|
if $stdout.tty? and not ARGV.flag? '--quiet'
versions = keg.cd{ Dir['*'] }.join(', ')