Skip to content

Instantly share code, notes, and snippets.

View elliotlarson's full-sized avatar

Elliot Larson elliotlarson

View GitHub Profile
Foo foo foo
@elliotlarson
elliotlarson / awk_zip_plus4.md
Created March 8, 2016 05:48
awk command for working with zero fill values

Lets say you have a zipcode file paramount.csv:

90242,5121
90280,8140
90280,8168
90280,8178
90280,8238
90723,1
90723,2
@elliotlarson
elliotlarson / ibeacon-scan.bash
Last active March 2, 2023 02:07
iBeacon Scanning Bash Script
#!/bin/bash
# iBeacon Scanner
# refactored script from Radius Networks referenced in this StackOverflow answer:
# http://stackoverflow.com/questions/21733228/can-raspberrypi-with-ble-dongle-detect-ibeacons?lq=1
# Process:
# 1. start hcitool lescan
# 2. begin reading from hcidump
# 3. packets span multiple lines from dump, so assemble packets from multiline stdin
# 4. for each packet, process into uuid, major, minor, power, and RSSI
@elliotlarson
elliotlarson / color-go-test.bash
Last active August 3, 2018 23:11
Colorizing Golang Test Output
#!/bin/bash
# Colorizing Go test output:
# This is meant to be used in place of `go test`. Provided this script is in
# your PATH, calling `color-go-test` will call through to `go test` and then
# colorize and reformat the output.
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
@elliotlarson
elliotlarson / pedantically_commented_playbook.yml
Created July 7, 2016 02:35 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@elliotlarson
elliotlarson / firebase.admin.repl.js
Last active April 21, 2021 13:44
Simple Node.js Firebase repl
#!/usr/bin/env node
// Using the firebase-admin approach where database security rules do not apply.
// Here you are authenticating with a private key. The key JSON file is available via
// the Firebase web UI: project settings > service accounts > generate new private key.
var admin = require("firebase-admin");
admin.initializeApp({
credential: admin.credential.cert(".adminServiceAccountKey.json"),
@elliotlarson
elliotlarson / create-app-user.html
Created November 17, 2016 23:51
Utility web page for creating a Firebase application user via Google provider authentication
<!--
You need to run this in a webserver environment over HTTP for it to work.
Start a basic server with:
```bash
$ http-server
```
Then navigate to: http://localhost:8080/create-app-user.html
@elliotlarson
elliotlarson / favicon-creator.sh
Created January 8, 2017 20:34
Create favicon from PNG
convert my-image.png -define icon:auto-resize=128,64,48,32,16 favicon.ico
@elliotlarson
elliotlarson / vscode-conf.json
Last active June 15, 2017 22:02
Visual Studio Code Setup
{
"window.zoomLevel": 1,
"vim.useCtrlKeys": true,
"editor.tabSize": 2,
"editor.fontSize": 11,
"editor.renderLineHighlight": false,
"vsicons.dontShowNewVersionMessage": true,
"workbench.activityBar.visible": false,
"typescript.check.workspaceVersion": false,
@elliotlarson
elliotlarson / sierra-config.md
Last active February 25, 2018 16:53
Configuration Of Mac OS Sierra

Clean Install of Mac OS Sierra

Create install USB drive

Download Sierra (or current Mac OS) via the AppStore App. Cancel out of the installer window when it loads up after it downloads.

The installer app will be in the Applications directory.

After inserting the USB stick, run the following command on the terminal. Note this expects the USB drive to be named Untitled: