View bird.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log syslog all; | |
router id **MY_IP**; | |
protocol bgp vultr { | |
local as 395409; | |
source address **MY_IP**; | |
import none; | |
export all; | |
graceful restart on; |
View http.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A very basic HTTP server | |
require "http/server" | |
server = HTTP::Server.new(8080) do |context| | |
context.response.content_type = "text/plain" | |
context.response.print "Hello world" | |
end | |
puts "Listening on http://0.0.0.0:8080" | |
server.listen |
View internet_radio_stream_aliases.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Install mplayer command line (via Brew, Macports, or APT) | |
# 2. Add the following aliases to ~/.profile | |
# 3. Type `source ~/.profile` | |
# 3. Type `news` or `current` to listen in your terminal | |
alias news="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" # MPR News | |
alias current="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/the_current.pls" # The Current | |
alias classical="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/classical.pls" # Classical MPR | |
alias localcurrent="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/local.pls" # Local Current | |
alias heartland="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/radio_heartland.pls" # MPR Radio Heartland |
View config.ru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# puma -p 31337 -q | |
require 'net/http' | |
run Proc.new { |env| | |
uri = URI('http://127.0.0.1:80/') | |
response = nil | |
Net::HTTP.start(uri.host, uri.port) do |http| |
View curl commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -kvv --tlsv1.2 https://sni.nakamura.io:4567/ | |
* Trying 127.0.0.1... | |
* Connected to sni.nakamura.io (127.0.0.1) port 4567 (#0) | |
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH | |
* TLSv1.2 (OUT), TLS handshake, Client hello (1): | |
* TLSv1.2 (IN), TLS handshake, Server hello (2): | |
* TLSv1.2 (IN), TLS handshake, Certificate (11): | |
* TLSv1.2 (IN), TLS handshake, Server key exchange (12): | |
* TLSv1.2 (IN), TLS handshake, Server finished (14): | |
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16): |
View ipfs-refs-daemon.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First, install ncat: http://nmap.org/ncat/ | |
# Usually comes with the 'nmap' package on distributions. | |
ncat -k -v -l -p 5555 -c 'ipfs refs local | gzip' | |
# To retrieve on the client machine: | |
# nc 127.0.0.1 5555 | gunzip | ipfs pin add -r |
View paypal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Everything else was worse... | |
# https://developer.paypal.com/docs/api/ | |
require 'rest_client' | |
require 'addressable/uri' | |
require 'thread' | |
class Paypal | |
OAUTH2_IS_INCREDIBLY_SHITTY_COMEDY_TIME_PADDING = 10 | |
SANDBOX_URI = Addressable::URI.parse 'https://api.sandbox.paypal.com/v1' | |
LIVE_URI = Addressable::URI.parse 'https://api.paypal.com/v1' |
View boring.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rmagick' | |
require 'pry' | |
$filtered_sites = [] | |
def web_site_too_blank?(path) | |
img = Magick::Image.read(path).first | |
pix = img.scale(1, 1) | |
average_color = pix.pixel_color(0,0) |
View gist:d7457a46a03d7408da31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Procedure is for Ubuntu 14.04 LTS. | |
# Using these guides: | |
# http://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/ | |
# https://turboflash.wordpress.com/2009/06/23/curl-adding-installing-trusting-new-self-signed-certificate/ | |
# https://jamielinux.com/articles/2013/08/act-as-your-own-certificate-authority/ | |
# Generate the root (GIVE IT A PASSWORD IF YOU'RE NOT AUTOMATING SIGNING!): | |
openssl genrsa -aes256 -out ca.key 2048 | |
openssl req -new -x509 -days 7300 -key ca.key -sha256 -extensions v3_ca -out ca.crt |
View gist:3af997f6f58d4d58f728
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example xorg.conf.d snippet that assigns the touchpad driver | |
# to all touchpads. See xorg.conf.d(5) for more information on | |
# InputClass. | |
# DO NOT EDIT THIS FILE, your distribution will likely overwrite | |
# it when updating. Copy (and rename) this file into | |
# /etc/X11/xorg.conf.d first. | |
# Additional options may be added in the form of | |
# Option "OptionName" "value" | |
# | |
Section "InputClass" |