Skip to content

Instantly share code, notes, and snippets.

View diginc's full-sized avatar
🐳

Adam B Hill diginc

🐳
View GitHub Profile
@diginc
diginc / get-java.sh
Created June 7, 2013 21:17
Based off of https://github.com/flexiondotorg/oab-java6/, but just downloads the .bin or .tar.gz for you. RUN: wget -O ./get-java.sh https://gist.github.com/diginc/5732479/raw/d23f9c35844fde9be8e1d05855ae7044a07ec771/get-java.sh; chmod +x get-java.sh;
#!/bin/bash
function usage() { echo "Allows scriptable downloading of official Java packages.";
echo -e "Options:\n -7: use latest java 7 version\n -v: specify version 6/7\n -u: specify the update version #\n -a: specify x64 or i586";
exit 1;
}
# Defaults Opts
DESTINATION="./"
JAVA_VER=6
#!/bin/bash
RELEASE=`lsb_release --codename | cut -f2`;
DLDEST="/opt/puppetlabs-release-$RELEASE.deb";
if [[ `dpkg -l | grep -c 'puppetlabs-release'` -gt 0 ]] ; then
echo "$DLDEST already installed"
else
sudo wget http://apt.puppetlabs.com/puppetlabs-release-$RELEASE.deb -O $DLDEST;
sudo dpkg -i $DLDEST;
sudo apt-get update;
sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y puppet;
@diginc
diginc / gist:8525360
Last active January 3, 2016 21:59
.tmux.conf
# .tmux.conf based off http://pragprog.com/book/bhtmux/tmux
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
# Ensure that we can send Ctrl-A to other apps
# useful for bash jump to start of line C-a C-a
bind C-a send-prefix
@diginc
diginc / gist:8526252
Last active January 3, 2016 22:09
~/bin $ cat tm-default
#!/bin/bash
TMUXNAME=${1:-"default"}
if tmux ls | grep "^$TMUXNAME:"; then
tmux attach -d -t $TMUXNAME
else
tmux new -s $TMUXNAME
fi

Intro

'2 CLI windows? Why not tmux'

Learn the basics of my tmux config (stock is not wonderful)

From : https://en.wikipedia.org/wiki/Tmux " tmux is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session. It is useful for dealing with multiple programs from a command line interface, and for separating programs from the Unix shell that started the program.[1] It provides much of the same functionality as GNU Screen, but is distributed under a BSD license."

Terms:

  • Tabs = numbered windows within a single session
@diginc
diginc / KVM-QEMU VNC over SOCKS
Last active October 18, 2023 05:47
How to connect to KVM-QEMU guests over SSH SOCKS Proxy. EXAMPLE of how to setup VNC for ALL your guests, without having to port forward/port tunnel every single 590# number
$ # EXAMPLE of how to setup VNC for ALL your guests, without having to port forward/port tunnel every single 590# number
$ cat ~/.ssh/config
# Host Machines
Host host_a.prod.domain.com
User diginc
DynamicForward 127.0.0.1:1080
# Used with VNCViewer (RealVNC) like so (FullColor fixes the immediate disconnect bug)
# `vncviewer --ProxyServer=127.0.0.1:1080 --ProxyType=socks --FullColor 127.0.0.1:5901`
@diginc
diginc / CPAN_module_installer.sh
Last active August 29, 2015 14:00
Script to install local lib CPAN modules, just tell it what to install in the MODULES variable and the rc file to setup for perl local lib environment variables so it can find the locally installed modules
#!/bin/bash
# Customize variables:
RCFILE=~/.bashrc
MODULES=(
"XML::Simple"
"DateTime::Event::Cron"
"Switch"
"LWP::Simple"
)
@diginc
diginc / fight_code_game_navigation.js
Last active August 29, 2015 14:01
[SAI] Nav System
// Custom functions list:
// Also see var Robot for variables that tie into some of these custom functions:
/*
Robot.prototype.gridSetup = function(ev) // Ran once
Robot.prototype.updateCurrentCoords = function(ev) // Ran every idle
Robot.prototype.navigation = function(ev) {
Robot.prototype.navigateCorner = function(ev) {
Robot.prototype.navigateWall = function(ev) {
@diginc
diginc / .bash_aliases
Created May 14, 2014 18:49
tmux session start / resume function
function tm {
TMUXNAME=${1:-"default"}
if tmux ls | grep "^$TMUXNAME:"; then
tmux attach -d -t $TMUXNAME
else
tmux new -s $TMUXNAME
fi
}
@diginc
diginc / my_puppet.pp
Created July 15, 2014 00:17
puppet workshop
# Requires modules: puppetlabs-apache, puppetlabs-mysql
exec { 'apt_get_update':
command => '/usr/bin/apt-get update',
}
->
Package <| |>
# Default
Exec {