Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@dwallraff
dwallraff / bash_generate_random_string.sh
Last active September 7, 2016 21:03 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@dwallraff
dwallraff / OpsMgr export & Alias
Last active August 29, 2015 14:27 — forked from krujos/OpsMgr export & Alias
Export and alias to have bosh command "just work"
export BUNDLE_GEMFILE=/home/tempest-web/tempest/web/bosh.Gemfile
alias bosh='bundle exec bosh'
@dwallraff
dwallraff / IRC client in pure bash
Created March 29, 2016 22:22 — forked from anonymous/IRC client in pure bash 4
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@dwallraff
dwallraff / iptables_rules.sh
Created December 5, 2016 19:30 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@dwallraff
dwallraff / .cfignore
Created May 25, 2018 13:26 — forked from andypiper/.cfignore
Run a reveal.js presentation on Cloud Foundry
# we can safely ignore all of this content
# use the nginx buildpack
# cf push --buildpack https://github.com/cloudfoundry-community/nginx-buildpack.git
.git
.gitignore
.sass-cache
.travis.yml
LICENSE
README.md
Gruntfile.js
@dwallraff
dwallraff / fix_github_https_repo.sh
Created September 21, 2018 05:20 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
# Forked from the original to do the opposite: Switch ssh repo urls to https
# Original here: https://gist.github.com/m14t/3056747
# Thanks to @m14t
#origin or upstream
REMOTE=${1-origin}
REPO_URL=`git remote -v | grep -m1 "^$REMOTE" | sed -Ene's#.*([email protected]:[^[:space:]]*).*#\1#p'`
@dwallraff
dwallraff / minikube-bootstrap.sh
Created March 12, 2020 02:02 — forked from minrk/minikube-bootstrap.sh
bootstrap single node kubernetes with minikube (no vm)
set -x
wget -O /usr/local/bin/rmate https://raw.github.com/aurora/rmate/master/rmate
chmod a+x /usr/local/bin/rmate
apt -y update
apt -y dist-upgrade
apt -y install docker.io
which minikube || (curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && mv minikube /usr/local/bin/)
@dwallraff
dwallraff / videos.html
Last active March 12, 2022 05:15 — forked from simonhaenisch/video-player.html
Play local video files in the browser (HTML5 video player) with playlist, speed control and keyboard shortcuts for pause (spacebar) and 5 second jump (left/right arrow). Created to watch Wes Bos tutorials offline. Playback speed defaults to 2x.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Local HTML5 Video Player</title>
</head>
<body>
<style>
* { box-sizing: border-box; }