Skip to content

Instantly share code, notes, and snippets.

View jpillora's full-sized avatar
👶

Jaime Pillora jpillora

👶
View GitHub Profile
@jpillora
jpillora / download-release.sh
Created March 29, 2015 08:46
Download binary release from Github
#!/bin/bash
function download {
EXEC=$1
GH="https://github.com/jpillora/$EXEC"
VERSION=`curl -sI $GH/releases/latest | grep Location | grep -m 1 -o '\d\+\.\d\+\.\d\+'`
DIR="chisel_$(echo -n $VERSION)_linux_amd64"
URL="$GH/releases/download/$VERSION/$DIR.tar.gz"
curl -sL $URL | tar zxvf -
cp $DIR/$EXEC .
rm -r $DIR
@jpillora
jpillora / README.md
Last active August 29, 2015 14:18
RethinkDB CoreOS Service
@jpillora
jpillora / utserver.conf
Last active February 21, 2019 11:55
Sample utorrent server "utserver" config file http://forum.utorrent.com/topic/73370-sample-utserverconfig-file/
##
## utserver.conf
## Configuration settings template for μTorrent for Linux.
## Taken from μTorrent Server manual for version alpha-3.3.
## ©2013 BitTorrent, Inc.
## Compiled by Rich.T.
##
##
## Command-line Arguments
@jpillora
jpillora / go-get-gitlab-ssh-nginx
Created May 10, 2015 08:38
Go get Gitlab ssh paths with nginx
location / {
## check for goget AND /namespace/project
if ($args ~* "^go-get=1") {
set $condition goget;
}
if ($uri ~ ^/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$) {
set $condition "${condition}path";
}
if ($condition = gogetpath) {
return 200 "<!DOCTYPE html><html><head><meta content='git.axon$uri git ssh://[email protected]:2200$uri.git' name='go-import'></head></html>";
#env
set -x GOPATH $HOME/go
set -x PATH $GOPATH/bin /usr/local/go/bin $PATH
#fish
set fish_greeting ""
function fish_prompt
set_color $fish_color_cwd
echo -n yournamehere
@jpillora
jpillora / simple-templating.go
Created May 16, 2015 06:10
Simple Templating in Go
package main
import (
"fmt"
"regexp"
)
func main() {
str := "my string and {{ foo }} and {{bar}}!"
str = template(str, map[string]string{"foo": "1", "bar": "2"})
@jpillora
jpillora / gitlab-docker.sh
Last active August 29, 2015 14:22
Gitlab Docker setup
#gitlab requires postgres and redis
#all 3 containers store their data in /opt
#the only variables that really need to be set
#are: GITLAB_HOST and GITLAB_ROOT_PASSWORD
mkdir -p /opt/postgresql/data
docker run --name 'postgresql-gitlab' \
-d \
-e 'DB_USER=gitlab_user' \
-e 'DB_PASS=gitlab_pass' \
@jpillora
jpillora / parse-comparator.js
Created June 13, 2015 11:12
parse collection comparator
//comparator string doesn't work, so you need to provide a sort function,
// read more http://mdn.io/sort
var Foo = Parse.Object.extend("Foo");
var Foos = Parse.Collection.extend("Foos", {
model: Foo
});
var foos = new Foos();
@jpillora
jpillora / openswan-l2tp-vpn-ubuntu.sh
Created July 21, 2015 13:14
openswan-l2tp-vpn-ubuntu.sh
#!/bin/sh
# Setup Simple IPSec/L2TP VPN server for Ubuntu and Debian
#
# Copyright (C) 2014 Phil Plückthun <[email protected]>
# Based on the work of Lin Song (Copyright 2014)
# Based on the work of Viljo Viitanen (Setup Simple PPTP VPN server for Ubuntu and Debian)
# Based on the work of Thomas Sarlandie (Copyright 2012)
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
@jpillora
jpillora / README.md
Last active August 3, 2018 21:44
Timeshot - Timesheet Screenshots

Timeshot

You can just run Timeshot in two ways:

  1. Execute timeshot.sh directly and leave your terminal window open in the foreground
  2. Load the timeshot.plist file to ensure it always runs in the background
  3. Change the WorkingDirectory to where your timeshot.sh is
  4. Copy timeshot.plist to ~/Library/LaunchAgents/timeshot.plist
  5. Execute launchctl load -w timeshot.plist
  6. Confirm its running with launchctl list | grep timeshot