Skip to content

Instantly share code, notes, and snippets.

View karlwilbur's full-sized avatar
🏠
Working from home

Karl Wilbur karlwilbur

🏠
Working from home
View GitHub Profile
@karlwilbur
karlwilbur / trezor-upgrade
Created March 10, 2021 20:46
Install Trezor (or update/upgrade) on Ubuntu; Trezor `.desktop` file
#!/bin/bash
# /opt/trezor/trezor-upgrade
#
# Shell script to upgrade/update Trezor Suite desktop application.
#
DOWNLOAD_PAGE_HTML="`curl -s https://suite.trezor.io/`"
SATOSHILABS_KEY="`echo ${DOWNLOAD_PAGE_HTML} | grep -oP 'satoshilabs-[^ ]*?-signing-key.asc' - | head -n1`"
CURRENT_VERSION="`echo ${DOWNLOAD_PAGE_HTML} | grep -oP 'Trezor-Suite-[^ ]*?AppImage' - | head -n1`"
@karlwilbur
karlwilbur / YouTube-ad-skipper.js
Created December 1, 2020 19:49
YouTube Ad Skipper Bookmarklet
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3Bwindow.%24%3D%24%3BsetInterval("window.%24('.ytp-ad-skip-button') %26%26 window.%24('.ytp-ad-skip-button').click()"%2C 1000)%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.11.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
@karlwilbur
karlwilbur / keybase.md
Created October 4, 2020 15:41
Keybase Identity Proof

Keybase proof

I hereby claim:

  • I am karlwilbur on github.
  • I am karlwilbur (https://keybase.io/karlwilbur) on keybase.
  • I have a public key ASC_tRwwaNwNO05hh_kvs5LVHtVRTBSSFib3kF8JGynO9Qo

To claim this, I am signing this object:

@karlwilbur
karlwilbur / .aliases
Last active July 27, 2020 16:14
Using CLI, open in GitKraken the repository for the current directory [via Bash or Zsh alias].
alias release-the-kraken='eval "gitkraken --new-window -p \"`pwd`\" -l /dev/null >/dev/null 2>&1 &" &'
@karlwilbur
karlwilbur / movie-list.perl
Created December 11, 2019 16:28
A stupid simple dynamic web app written in perl
#!/usr/bin/perl
#use warnings;
use strict;
use CGI qw(:standard);
use DBI;
#=============================
# Database connection
my $host = "localhost";
@karlwilbur
karlwilbur / 20081231235959-example_migration.php
Last active December 18, 2019 15:50
Simple PHP DB Migration script with example migrations
<?php
# db/migrations/20081231235959-example_migration.php
/**
* Example migration. This is just here to serve as a kind of template for creating
* new migrations.
*
* The filename convention is: YYYYMMDDHHIISS-some_class_name.php
*
* The name of the class defined within the migration file should match the what
@karlwilbur
karlwilbur / .sh_nvm
Last active October 8, 2019 02:28
Karl's `zsh` Setup
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[ -s "$HOME/.avn/bin/avn.sh" ] && source "$HOME/.avn/bin/avn.sh" # load avn
@karlwilbur
karlwilbur / barrier.config
Last active June 8, 2021 15:54
Karl's K&R Desktop+ Barrier (Synergy) Configuration
# `~/.barrier.conf`
#
# Configuration for [Barrier](https://github.com/debauchee/barrier) server
#
# Physical arrangement, with machine names as used by Barrier (Synergy).
# +---------------+---------------+
# | | |
# | kandr-imac | kandr-nuc |
# | | |
@karlwilbur
karlwilbur / Vagrantfile
Last active July 20, 2019 21:32
Vagrant - Set Guest ENV vars
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANT_API_VERSION='2'
$set_environment_variables = <<SCRIPT
cat > '/etc/profile.d/envvars.sh' <<EOV
# AWS environment variables.
export SOME_VAR=things
export OTHER_VAR='other stuff'
@karlwilbur
karlwilbur / apache-404-php.conf
Last active May 25, 2019 21:46
Fail2Ban: Custom configuration files
# Fail2Ban configuration file
# /etc/fail2ban/filter.d/apache-404-php.conf
#
# Author: Karl Wilbur
#
# Description:
# filter for blocking IPs that generate 'File does not exist'
# entries in Apache's error log, from attempts to access non-existent
# PHP files.
#