Skip to content

Instantly share code, notes, and snippets.

View adrianwebb's full-sized avatar

Adrian Webb adrianwebb

  • Washington, DC
View GitHub Profile
@adrianwebb
adrianwebb / spotify_key_repo
Last active February 17, 2022 11:28
Spotify premium key
#!/bin/bash
# From Friday, August 03, 2012
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
@adrianwebb
adrianwebb / ssl_cert_generation_template
Last active November 8, 2024 07:35
Bash script to generate SSL key, passwordless pem, csr, and crt files
#!/bin/bash
function generate_ssl_cert {
cert_name=$1
(
openssl genrsa -des3 -out ${cert_name}.key 1024
openssl rsa -in ${cert_name}.key -out ${cert_name}.pem
openssl req -new -key ${cert_name}.pem -out ${cert_name}.csr
openssl x509 -req -days 365 -in ${cert_name}.csr -signkey ${cert_name}.pem -out ${cert_name}.crt
@adrianwebb
adrianwebb / git_initialization_template
Last active August 29, 2015 13:58
Git existing repo initialization
# Source: http://stackoverflow.com/questions/5377960/whats-the-best-practice-to-git-clone-into-an-existing-folder
git init
git remote add origin $repo_url
git fetch origin
git checkout -b $branch --track origin/$branch
git reset origin/$branch
@adrianwebb
adrianwebb / news_feeds
Last active August 29, 2015 14:05
News feeds I follow through Feedly
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<text/>
</head>
<body>
<outline isOpen="false" id="1717402843" text="Environment">
<outline title="Weather - Google News" useCustomFetchInterval="true" version="RSS" useNotification="true" maxArticleAge="60" description="Google News" htmlUrl="http://news.google.com/news?pz=1&amp;ned=us&amp;hl=en" xmlUrl="https://news.google.com/news/feeds?pz=1&amp;cf=all&amp;ned=us&amp;hl=en&amp;csid=b41a655d9b7f7fa0&amp;output=rss" fetchInterval="15" loadLinkedWebsite="true" type="rss" id="765362081" archiveMode="keepAllArticles" maxArticleNumber="1000" text="Weather - Google News"/>
</outline>
<outline isOpen="false" id="1965544465" text="Education">
@adrianwebb
adrianwebb / rsync_command_template
Last active August 29, 2015 14:14
Remote rsync command template
rsync -avz --exclude "{DIR}" -e "ssh -i {PRIV_KEY} -p {PORT}" {LOCAL_DIR}/ {USER}@{IP}:{REMOTE_DIR}/
@adrianwebb
adrianwebb / clean_vagrant_gems
Last active August 29, 2015 14:20
Clean and update Vagrant gems for current user.
#!/bin/bash
vagrant_home_dir="$HOME/.vagrant.d"
/usr/bin/env ruby <<-EORUBY
require 'json'
require 'fileutils'
puts 'Loading current Vagrant plugin data'
plugin_data = JSON.parse(File.read("$vagrant_home_dir/plugins.json"))
@adrianwebb
adrianwebb / switch_vagrant_gems
Last active August 29, 2015 14:20
Symbolic links Vagrant gems with current directory gems repositories for development.
#!/bin/bash
current_dir=`pwd`
gem_dir="$current_dir/gems"
gem_files=()
index=1
echo "Gathering gem repositories from $gem_dir"
for file in "$gem_dir"/*
@adrianwebb
adrianwebb / oscad_raspberry_pi_connector_side
Last active August 29, 2015 14:20
OpenSCAD 3D printed part for connecting stacked Raspberry Pi systems (side)
//
// Global properties (mm)
//
part_height = 3;
ring_outer_diameter = 13;
ring_inner_diameter = 7;
connector_bridge_length = 38;
@adrianwebb
adrianwebb / oscad_raspberry_pi_connector_rear
Created May 10, 2015 18:45
OpenSCAD 3D printed part for connecting stacked Raspberry Pi systems (rear)
//
// Global properties (mm)
//
part_height = 3;
ring_outer_diameter = 13;
ring_inner_diameter = 7;
connector_bridge_length = 89;
@adrianwebb
adrianwebb / check_repos
Created May 17, 2015 18:13
Check all Git repositories on and under current directory for uncommitted changes.
#!/bin/bash
curr_dir=`pwd`
for dir in $(find $curr_dir -type d)
do
if [ -d "${dir}/.git" ]
then
echo "Checking Git repo: ${dir}"
cd $dir