Skip to content

Instantly share code, notes, and snippets.

@andrewbolster
andrewbolster / Ubuntu Touch Install
Created December 20, 2013 16:10
Simplest device flashing process ever
sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo aptitude -y install phablet-tools android-tools-adb android-tools-fastboot
phablet-flash ubuntu-system --channel devel --bootstrap
@andrewbolster
andrewbolster / .oh-my-zsh\oh-my-zsh.sh
Created January 12, 2014 21:12
My zsh config for debugging
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
/usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)
➜ _posts git:(master) ✗ file 2014-01-20-schreibdochmal_19_01_14.md
2014-01-20-schreibdochmal_19_01_14.md: exported SGML document, UTF-8 Unicode (with BOM) text, with very long lines
➜ _posts git:(master) ✗ file 2014-01-11-the-making-of-a-timelapse.md
2014-01-11-the-making-of-a-timelapse.md: ASCII text, with very long lines
awk '{if(NR==1)sub(/^\xef\xbb\xbf/,"");print}' INFILE > OUTFILE
x, *xs, y, z = map(lambda j: lambda i: j**i ,range(1, 10))
x(2),y(2),z(2)
@andrewbolster
andrewbolster / vimrc
Created October 20, 2015 09:46
My Fucked VIMrc
" Pathogen : https://github.com/tpope/vim-pathogen
execute pathogen#infect()
set nocompatible " be iMproved
filetype off " required!
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
@andrewbolster
andrewbolster / eventcamsort
Created January 11, 2014 16:42
Event Cam Management script
#!/bin/bash
BASE="/mnt/eventcam/"
COMPRESS=0
RERUN=0
UPLOAD=1
TODAY=`date +%Y%m%d`
# Move all jpgs in to per date folder for processing
for file in `find $BASE -maxdepth 1 -name '*.jpg' -type f -print`; do
newfilename=`echo $file | awk -F '-' '{print $2$3}'`
date=`echo $newfilename | cut -c 1-8`
@andrewbolster
andrewbolster / motion.conf
Created January 11, 2014 16:27
Motion Configuration file use by Farset Labs
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 3.2.11
############################################################
# Daemon
############################################################
# Start in daemon (background) mode and release terminal (default: off)
@andrewbolster
andrewbolster / import_repo.sh
Last active June 23, 2020 14:25
Git Merge Hellscape
#!/bin/bash
usage() {
cat << EOF
This script imports a git repo (accessible from https://\$origin/\$user/\$repo) and all its history as subdirectory of a destination (available locally at \$dest)
It is designed for non-production, archival processes and may destroy everything you've ever loved because you looked at it funny. You have been warned.
The structure of the destination will end up something like this:
~/src
- \$dest
- origins
#!/bin/bash
# Example script to start up tunnel with autossh.
# This script will tunnel 22 from the local host
# to 11122 on the remote host. If that post isn't
# availabile it'll increment. Also does the same
# with 8888/11188 for ipython notebook
# REQUIRED autossh
HOST=${@: -1}
REMOTE_SSH_PORT=11122
REMOTE_HTTP_PORT=11188