Skip to content

Instantly share code, notes, and snippets.

Avatar

Wesley Baugh bwbaugh

View GitHub Profile
@bwbaugh
bwbaugh / ec2-ubuntu-16.04-swap.md
Last active Sep 27, 2019
EC2 swap file instructions. Gathered from several online articles / blogs / stackexchange.
View ec2-ubuntu-16.04-swap.md

Can check if you're using swap with sudo swapon --show and free -h.

EBS volume

Useful for t2.micro and other instances with no access to instance store. Use this if you prefer not to mess with the root volume.

  1. Create the EBS volume e.g., 1 GB.
@bwbaugh
bwbaugh / unifi-raspberry_pi-instructions.sh
Created Aug 20, 2016
Installing Ubiquiti UniFi Controller 5 on Raspberry Pi.
View unifi-raspberry_pi-instructions.sh
# Mirror of the instructions available here:
# http://www.lowefamily.com.au/2016/06/02/installing-ubiquiti-unifi-controller-5-on-raspberry-pi/
#
# These commands CANNOT be run in a script.
# They're just for reference.
# Install on Raspbian Jessie, or upgrade from Wheezy.
# Make sure all packages are upgraded (update && upgrade).
@bwbaugh
bwbaugh / user-data-stack.sh
Created Mar 15, 2016
EC2 user data script to install Haskell stack on Amazon Linux in order to build executables for AWS Lambda.
View user-data-stack.sh
#!/bin/bash
yum update -y
curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/centos/7/fpco.repo | tee /etc/yum.repos.d/fpco.repo
yum -y install stack
sudo -H -u ec2-user -- stack setup
# TODO(2016-04-14): Maybe download files and run `stack build`.
# NOTE: This script is mostly just for fun // a learning exercise. It's
# probably better to use something like Travis CI that can cache the
# ~/.stack/ directory to make build times reasonable. Though the
# whole point of this is to run on Amazon Linux for building static
@bwbaugh
bwbaugh / expressions_equal_target.hs
Last active Jan 24, 2016
Find expressions that match target value
View expressions_equal_target.hs
{-
The origin of this puzzle if from #codingame chat. Ideas for the high
level approach come from TheNinja.
Write a program that outputs all possibilities to put + or - or nothing
between the numbers 1,2,...,9 (in this order) such that the result is
equal to stdin. For an example: 1 + 2 + 3 - 4 + 5 + 6 + 78 + 9 = 100.
Usage:
@bwbaugh
bwbaugh / sumfibparity.hs
Last active Nov 12, 2015
Visualize the parity of the sum of digits from numbers of the Fibonacci sequence. https://oeis.org/A004090
View sumfibparity.hs
import Data.Char (digitToInt)
import System.IO
main :: IO ()
main = do
hSetBuffering stdout NoBuffering
putStrLn $ concatMap toFancy $ sumOfDigits fib
toFancy :: Integer -> String
toFancy x
@bwbaugh
bwbaugh / raspberrypi-guide.md
Last active Aug 29, 2015
Setting up a raspberry pi.
View raspberrypi-guide.md

Quick Start for Raspberry Pi

Initial setup

Basic setup involves:

  • Install dotfiles.
  • Change the hostname.
@bwbaugh
bwbaugh / logstash-guide.md
Last active Nov 26, 2020
Installing logstash server and client
View logstash-guide.md

Installing logstash

Server install

Install

Install the Java prerequisite:

@bwbaugh
bwbaugh / ubuntu-ec2-guide.md
Last active Mar 13, 2020
Guide to customize an Ubuntu EC2 instance.
View ubuntu-ec2-guide.md

Quick Start for Ubuntu EC2

Initial setup

Basic setup involves:

  • Install dotfiles.
  • Change the hostname.
@bwbaugh
bwbaugh / wunderlist_extract_titles.sh
Created Jun 2, 2015
Extract all of the task titles from a specific Wunderlist list.
View wunderlist_extract_titles.sh
<wunderlist-2015062-17-18-11.json jq '.data.tasks | .[] | select(.list_id == 143399535) | select(.completed == false) | .title' --raw-output
@bwbaugh
bwbaugh / dnsmasq.conf
Last active Jun 8, 2018
Changing the DNS server on a RT-AC66U / RT-N66U
View dnsmasq.conf
# Add these, though they didn't seem to take effect for me.
server=8.8.8.8
server=8.8.4.4