Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
prefix=/opt/vim
vimrc=https://gist.github.com/rjeczalik/6574654/raw/377037c862ad21481e48d00210708f76c62bb412/vimrc
# TODO: install deps for vundle, Command-T and YouCompleteMe (python-dev, ruby-dev, xorg-dev etc.)
# vim --version must at very minimum yield support for +python +ruby +xterm_clipboard
die() {
if [ ! -z "${*}" ]; then
@rjeczalik
rjeczalik / to-ogg
Last active December 25, 2015 12:59
converts m4a to ogg (lazy way to workaround an issue with most recent mpd from homebrew, which apparently does not like m4a)
#!/usr/bin/env bash
to-ogg() {
local src=
local dst=
{
[ ${#} == 0 ] && src=. && dst=.
} || {
[ ${#} == 1 ] &&
@rjeczalik
rjeczalik / building-static-nginx.txt
Created October 19, 2013 15:37
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@rjeczalik
rjeczalik / update-go
Last active December 26, 2015 01:09
script for keeping Go + random set of libraries up-to-date
#!/usr/bin/env bash
#########################################
# Directory structure and prerequisites #
#########################################
case "$(uname -a)" in
*Darwin*)
tool=brew
;;
@rjeczalik
rjeczalik / restart-docker
Last active December 30, 2015 23:39
script for (re)starting Docker vm with Gitlab/CI containers
#!/usr/bin/env bash
[[ -z "${DOCKER_HOME}" ]] && {
DOCKER_HOME=${HOME}/vagrant/docker
}
die() {
[[ ! -z "${*}" ]] && {
echo "error: ${*}"
}
@rjeczalik
rjeczalik / gitlab-ci-runner.plist
Created December 11, 2013 22:12
launchd job script for Gitlab-CI runner
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnableGlobbing</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>gitlab-ci-runner</string>
@rjeczalik
rjeczalik / git-pr
Created January 2, 2014 14:31
utility script for creating PR for Stash
#!/usr/bin/env bash
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
COMMIT_MESSAGE=$(git log --format=%B -n1 HEAD)
if ! echo "${BRANCH_NAME}" | perl -ne 'exit 1 unless /^(lmx|licstat)\d+$/'; then
echo "git-pr: invalid issue branch name: ${BRANCH_NAME}" 1>&2
exit 1
fi
@rjeczalik
rjeczalik / toggle-camera.bash
Created January 5, 2014 12:32
load/unload AppleCameraInterface
#!/usr/bin/env bash
toggle-camera() {
if kextstat | grep AppleCameraInterface &>/dev/null; then
for ((i=0; i<3; i++)); do
if sudo kextunload /System/Library/Extensions/AppleCameraInterface.kext &>/dev/null; then
echo "toggle-camera: AppleCameraInterface unloaded"
return 0
fi
done
@rjeczalik
rjeczalik / ccl
Created April 15, 2014 09:25
A wrapper for Code Collabolator command line client, creating reviews for every local commit.
#!/bin/bash
die_usage() {
if [ ! -z "${*}" ]; then
echo "ccl: error: ${*}" 1>&2
echo
fi
echo "usage: ccl <review id> <commit>" 1>&2
echo " ccl <commit range>" 1>&2
exit 1
@rjeczalik
rjeczalik / bash-trick-01-why-u-no-archive-dir.md
Created May 10, 2014 09:33
bash-trick-01: WHY U NO ARCHIVE DIR?

unzip-all-the-things

~/Downloads $ wget https://mega.co.nz/sdk.zip &>/dev/null
~/Downloads $ unzip sdk.zip 
Archive:  sdk.zip
  inflating: readme.txt              
  inflating: megabdb.cpp             
  inflating: megacli.cpp             
  inflating: megaclient.cpp