Skip to content

Instantly share code, notes, and snippets.

View larsar's full-sized avatar

Lars Preben Sørsdahl larsar

View GitHub Profile
@bmhatfield
bmhatfield / .profile
Last active May 6, 2024 22:27
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else

So the anyconnect client prevents forward of traffic from a VM to the VPN, which means virtual machines and docker containers which rely upon NAT won't work. OpenConnect allows you to get around this as it doesn't enforce ipfw rules upon you.

OpenConnect is a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@cloud8421
cloud8421 / postgres_upgrade
Last active December 23, 2015 17:19 — forked from EdwardTippett/postgres_upgrade
Osx upgrade postgres from 9.2.4 to 9.3
Steps to install and run PostgreSQL 9.3 using Homebrew (Mac OS X)
(if you aren't using version 9.2.4, change to the correct version)
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
mv /usr/local/var/postgres /usr/local/var/postgres92
brew upgrade postgresql
initdb /usr/local/var/postgres -E utf8
pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin -B /usr/local/Cellar/postgresql/9.3.0/bin -d /usr/local/var/postgres92 -D /usr/local/var/postgres
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@glittershark
glittershark / tsvector_agg.sql
Created August 20, 2013 19:42
Postgresql aggregate function for tsvectors
CREATE OR REPLACE FUNCTION concat_tsvectors(tsv1 tsvector, tsv2 tsvector)
RETURNS tsvector AS $$
BEGIN
RETURN coalesce(tsv1, to_tsvector('default', ''))
|| coalesce(tsv2, to_tsvector('default', ''));
END;
$$ LANGUAGE plpgsql;
CREATE AGGREGATE tsvector_agg (
BASETYPE = tsvector,
@tlberglund
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@tlberglund
tlberglund / gist:3208768
Created July 30, 2012 18:08
Live Log Script
#!/bin/bash
while :
do
clear
git --no-pager log -$1 --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
sleep 1
done
@mojodna
mojodna / Procfile
Created September 29, 2011 20:22 — forked from RandomEtc/Procfile
Getting Kue working on Heroku
web: node app.js
worker: node consumer.js
@pithyless
pithyless / gist:1208841
Created September 10, 2011 21:49
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@stefanfoulis
stefanfoulis / findauthors.sh
Created April 8, 2011 12:37
How to sync svn to git
#!/usr/bin/env bash
# Run this script inside a SVN checkout of the project
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";