Skip to content

Instantly share code, notes, and snippets.

View aaronsaderholm's full-sized avatar

Aaron aaronsaderholm

View GitHub Profile
@aaronsaderholm
aaronsaderholm / fix_subscription_message.sh
Last active February 6, 2017 02:55
Fix Proxmox VE "No Valid Subscription" Message
#!/bin/bash
DATE_STR=$(date +%s)
cd /usr/share/pve-manager/js/
cp pvemanagerlib.{js,js.bak_$DATE_STR}
sed -i "s#data.status !== 'Active'#false#g" pvemanagerlib.js
@aaronsaderholm
aaronsaderholm / bootstrap_proxmox.sh
Last active February 6, 2017 03:48
Bootstrap Proxmox (Debian)
#!/bin/bash
DATE_STR=$(date +%s)
cd /usr/share/pve-manager/js/
cp pvemanagerlib.{js,js.bak_$DATE_STR}
sed -i "s#data.status !== 'Active'#false#g" pvemanagerlib.js
apt update
apt upgrade
@aaronsaderholm
aaronsaderholm / i3-gaps-install.sh
Last active January 1, 2021 18:52 — forked from doubtingben/gist:60a228c06a48a5b8601ea5e94e4ab22c
Install i3-gaps on Ubuntu 16.04
#!/usr/bin/env bash
# Install i3-gaps on Ubuntu 16
set -e
set -x
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-shape0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev dh-autoreconf
mkdir -p $HOME/repos
cd $HOME/repos
@aaronsaderholm
aaronsaderholm / setup-python.sh
Last active July 17, 2017 20:49
Setup python virtualenv and run pip install when requirements.txt changes
#!/bin/bash
# Creates venv if it dosen't exist and installs requirements.txt.
# Saves a checksum of requirements.txt, checks against that.
# Reruns pip install if checksum changes on subsequent runs.
# TODO:
# - Make python/ folder prefix customizable.
# - Use git version instead of crc32.
# Aaron Saderholm 7/16/17
set -e
@aaronsaderholm
aaronsaderholm / make radiohead
Last active July 19, 2017 05:47
make radiohead
# change the file name and --audio-format mp3 for mp3.
radiohead:
test -d venv || virtualenv venv
venv/bin/pip install youtube-dl
mkdir -p music
venv/bin/youtube-dl --output music/exit_music_for_a_film.ogg \
--extract-audio --audio-format vorbis \
https://youtu.be/8051Hipbmmw
@aaronsaderholm
aaronsaderholm / pull_links_from_html.py
Created July 19, 2017 14:48
Pull Links from HTML using Python/BS4
@aaronsaderholm
aaronsaderholm / rofi-xenial
Last active July 24, 2017 02:39
rofi 16.04
#!/usr/bin/env
set -e
set -x
sudo apt-get update
sudo apt install -y \
git \
pkg-config \
gcc make \
autoconf \
bison \
@aaronsaderholm
aaronsaderholm / jenikns_ci_on_osx.md
Created September 10, 2017 20:38 — forked from ostinelli/jenkins_ci_on_osx.md
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

#!/usr/bin/env bash
# Credits to https://stackoverflow.com/a/246128
# Just added here for reference.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@aaronsaderholm
aaronsaderholm / largest_table_by_mb.sql
Created February 11, 2018 01:37
Largest Table by Megabytes MySQL
-- https://dba.stackexchange.com/a/18952
SELECT DBName,CONCAT(LPAD(FORMAT(SDSize/POWER(1024,pw),3),17,' '),' ',
SUBSTR(' KMGTP',pw+1,1),'B') "DataSize",
CONCAT(LPAD(FORMAT(SXSize/POWER(1024,pw),3),17,' '),' ',
SUBSTR(' KMGTP',pw+1,1),'B') "IndexSize",
CONCAT(LPAD(FORMAT(STSize/POWER(1024,pw),3),17,' '),' ',
SUBSTR(' KMGTP',pw+1,1),'B') "Total Size"
FROM (SELECT IFNULL(DB,'All Databases') DBName,SUM(DSize) SDSize,
SUM(XSize) SXSize,SUM(TSize) STSize
FROM (SELECT table_schema DB,data_length DSize,index_length XSize,