Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

# ================================================================================
# ObjectStorageUploader.sh
# © Copyright IBM Corporation 2014.
# LICENSE: MIT (http://opensource.org/licenses/MIT)
# ================================================================================
import argparse
import os
import math
import http.client
@radekg
radekg / README.md
Last active August 29, 2015 14:07
List of contributors to a github project grouped by the company

List contributors

Output explained:

project_name contributors:
 --------------------------- 
Company name (if set on user profile)
  Member
  Member

Member

@radekg
radekg / .gitignore
Created November 28, 2014 23:11
EC2 IAM security credentials
.DS_Store
node_modules/*

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@radekg
radekg / instructions.md
Last active August 29, 2015 14:21
Raspberry Pi - Erlang

Preparing SD card.

Find Raspberry Pi on the network:

brew install nmap
sudo nmap -v -sn 10.128.30.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

where 10.128.30.0 is the network the thing is on.

Expand the filesystem with raspi-config.

@radekg
radekg / my_app.sh
Last active August 29, 2015 14:24 — forked from guillermo/my_app.sh
#!/bin/bash
# This is a unix wrapper around the erlang vm. It provides the following functionality:
#
# * Spawns in foreground
# * Handle SIGHUP and call RELOADFUNC
# * Handle SIGTERM SIGQUIT and SIGINT telling to the vm to quit
# * Dies if the vm dies (for example kernel killing because out of memory)
#
# Forks and improvements are welcome.
-module(lb).
-compile(export_all).
-include_lib("stdlib/include/qlc.hrl").
-include_lib("kernel/include/inet.hrl").
start_lb() ->
{ok, Redis} = eredis:start_link(),
eredis:q(Redis, ["FLUSHALL" | []]),
spawn_link(?MODULE, loop0, [1883,Redis]),
spawn_link(?MODULE, loop1, [1884,Redis]).
@radekg
radekg / gist:4243613
Created December 9, 2012 06:34
Backup all github repos from all organisations we are assigned to and put on S3 (node.js)
var https = require("https")
, fs = require("fs")
, spawn = require('child_process').spawn
, AWS = require('aws-sdk');
var CONFIG = {
username: "<github-username>"
, password: "<github-password>"
, backupdir: "/where/to"
, bucket: "github.backup"
@radekg
radekg / optparse.sh
Last active November 1, 2015 17:25
Poor man's option parser in bash
#!/bin/bash
function opt_parse() {
local _idx=1
local _last=""
while [ $_idx -lt $# ] || [ $_idx -eq $# ]; do
_v=${!_idx}
if [[ $_v == --* ]]; then
local _name=$(echo $_v | tr - _)
eval "__program_argument${_name}=::is-arg-set"