Skip to content

Instantly share code, notes, and snippets.

View brockers's full-sized avatar

Bobby Rockers brockers

View GitHub Profile
@brockers
brockers / btsync
Created November 2, 2013 19:29 — forked from letiemble/btsync
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
@brockers
brockers / gist:7324525
Created November 5, 2013 19:17
Partitioning Configuration for Ubuntu Server 13.10 preseed.cfg
d-i partman/filter_mounted boolean false
d-i partman/unmount_active boolean false
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
@brockers
brockers / gist:7362379
Created November 7, 2013 21:45
Sample Interfaces Configuration
# The loopback network interface
auto lo eth0 wlan0
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
# Wireless AP setup
allow-hotplug wlan0
@brockers
brockers / cmaker
Last active August 29, 2015 14:01
Bash script to setup the necessary components of an Autotools/Automake C application. Think of it as 'rails new projectname' for C.
#!/bin/bash
# Global Variables
PROJECT_FOLDER="$(pwd)"
# Make sure something is actually specified
if [[ -z "$1" ]]; then echo "Please specify a command (if not sure do `basename $0` --help)"; fi
usage() {
echo "`basename $0` [OPTIONS] meta script setting up a new C program in automake."
@brockers
brockers / server.conf
Created May 17, 2014 15:09
Sampe OpenVPN Server Configuration File
# Which local IP address should OpenVPN
# listen on? (optional)
local x.x.x.x
port 443
dev tun
proto tcp-server
tls-server
ca /etc/openvpn/ca.crt
@brockers
brockers / gist:512d0cef07c3b321d082
Created August 5, 2014 17:23
bash .bashrc bookmark functions
# Bash Bookmarks
#######################################################
export MARKPATH=$HOME/.marks
function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
@brockers
brockers / .bash_profile
Created August 5, 2014 17:25
bash .bash_profile git branch in PS1
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
function git-track {
CURRENT_BRANCH=$(parse_git_branch)
git-config branch.$CURRENT_BRANCH.remote $1
git-config branch.$CURRENT_BRANCH.merge refs/heads/$CURRENT_BRANCH
}
@brockers
brockers / fedora-setup.sh
Last active March 25, 2016 17:16
Fedora 20 KDE Spin default setup
#!/bin/bash
# This is meant to be run on a newly install computer
# and can be done remotely by something like this:
#
# ssh username@ipaddress 'bash -s' < local_script.sh
#
# Enable/Start SSHD
#######################################
@brockers
brockers / find_shp_duplicate.sh
Last active August 29, 2015 14:05
Find duplicate shapefiles and other ArcGIS support files in a given project folder.
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
# Set some global variables
installLocation='./FINAL-PLACE'
logFiles='./log'
md5Cache="$logFiles/md5Cache.txt"
duplicateFile="$logFiles/dupFiles.txt"
@brockers
brockers / configuredebug
Created September 17, 2014 18:05
A bash alias to run configure with full debug messages and un-optimized for gdb
alias configuredebug='CPPFLAGS=-DDEBUG CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure'