Skip to content

Instantly share code, notes, and snippets.

@colby
colby / rdio-search.sh
Created February 17, 2015 22:16
A bash script to find an HD YouTube video of the current Rdio song in Chrome.
#!/usr/bin/env bash
if ! pgrep -q Rdio
then
echo "Error: Rdio is not running"
exit 1
fi
function check {
which "$1" || echo "Missing dep: $1"; exit 1
@colby
colby / openssl.sh
Last active August 29, 2015 14:17
A simple script to upgrade OpenSSL related packages and restart services on Ubuntu/Debian
#!/bin/bash
awk=$(which awk || echo 'missing: install awk' && exit 1)
# update apt
sudo apt-get update
# get ssl related packages from simulated upgrade
sudo apt-get upgrade -s | grep ssl | grep Inst | $awk '{print $2}' | xargs -t sudo apt-get install -y
Your sin smells to high heaven.
Your words are so foolishly and ignorantly composed that I cannot believe you understand them.
You are the most insane heretics and ingrafters of heretical perversity.
What you say is a blasphemy that has made you worthy of a thousand deaths.
Behold, indeed, this little golden work of a golden teacher! It is a work most worthy of golden letters, and lest there be something about it which is not golden, it must be handed down by golden disciples, namely, by those about whom it is said, "The idols of the nations are silver and gold. They have eyes, but they see not."
You are worthy only to be mocked by the words of error.
It is presumptuous for people who are as ignorant as you are not to take up the work of a herdsman.
What bilgewater of heresies has ever been spoken so heretically as what you have said?
What do you mean when you say this? Are you dreaming in the throes of a fever or are you laboring under a madness?
Your astute minds have been completely turned into stinking mu
@colby
colby / sandman
Last active August 29, 2015 14:18
Sandman: A bash script to find all known Vagrant VMs and put them to sleeps. Zzz.
#!/usr/bin/env bash
# variables
vagrant=""
# functions
errcho() {
>&2 echo "$*"
exit 1
}
@colby
colby / battery.sh
Last active December 17, 2017 10:05
A bash script for getting the laptop battery percentage for tmux.
#!/bin/bash
#
# To include the line below into your .tmux.conf to see battery % or charging icon.
# set -g status-right "#(/Users/colbyolson/src/scripts/battery.sh) #H %H:%M"
ok_color="colour236"
warn_percent="20"
warn_color="colour208"
status=$(pmset -g batt)
@colby
colby / imgur
Created April 5, 2015 00:35
A simple shell script to upload images to Imgur.
#!/usr/bin/env bash
# variables
img="$1"
tmp=/tmp/imgur
id='3e7a4deb7ac67da'
link='https://api.imgur.com/3/upload'
# functions
errcho() {
# Vinnum Sabbathi - Last Trip From The Superclusters To Earth (Doom rock from Mexico, using real samples from NASA missions)
https://www.youtube.com/watch?v=4zq2lWK8WJk
# Gojira - Flying Whales (Metal from France)
https://www.youtube.com/watch?v=sDIkDOtAuoo
# True Widow - NUMB HAND (Doom rock from US)
https://www.youtube.com/watch?v=4YCE-_pKf1A
# Black Crown Initiate - Great Mistake (Metal from US)
iptables -P FORWARD DROP # we aren't a router
iptables -A INPUT -m state --state INVALID -j DROP # drop bad packets
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT # allow current connections
iptables -A INPUT -i lo -j ACCEPT # allow lo interface
iptables -A INPUT -s 1.2.3.4 -j ACCEPT # allow whom-ever ya want
iptables -P INPUT DROP # drop the rest
# Start of entries inserted by Spybot - Search & Destroy
127.0.0.1 www.007guard.com
127.0.0.1 007guard.com
127.0.0.1 008i.com
127.0.0.1 www.008k.com
127.0.0.1 008k.com
127.0.0.1 www.00hq.com
127.0.0.1 00hq.com
127.0.0.1 010402.com
127.0.0.1 www.032439.com
@colby
colby / -
Created August 31, 2015 18:02
$ awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -nr | head -n20
5676 git
2612 now
1937 vim
1630 ssh
1186 j
829 cd
617 curl
591 clear
370 grep