Skip to content

Instantly share code, notes, and snippets.

Avatar

Quinn Comendant quinncomendant

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am quinncomendant on github.
  • I am qc (https://keybase.io/qc) on keybase.
  • I have a public key whose fingerprint is 15B9 1090 A3FE 9875 FA4A DCF3 753A D975 0BF1 3B86

To claim this, I am signing this object:

@quinncomendant
quinncomendant / umbrella
Last active Jan 21, 2021
[WARNING: this script no longer works with newer versions of the roaming client software, which now has a *Disable* control in its menu so use that instead.] Cisco Umbrella Roaming Client management script for Mac OS X. This makes it easy to manage the background processes of umbrella to start, stop, restart, sleep and get status.
View umbrella
#!/bin/bash
# Quinn Comendant <quinn@strangecode.com>
# https://gist.github.com/quinncomendant/3be731567e529415d5ee
# Since 25 Jan 2015
# Version 1.2.2
# q 13942 0.0 0.3 4408332 22096 ?? SN 7:32PM 0:00.27 /Applications/OpenDNS Roaming Client/RoamingClientMenubar.app/Contents/MacOS/RoamingClientMenubar
# nobody 13937 0.0 0.1 4296740 5164 ?? Ss 7:31PM 0:00.06 /usr/local/sbin/dnscrypt-proxy --user nobody --local-address=127.0.0.1:53 --plugin=libdcplugin_erc.so -d
# root 13903 0.0 0.2 4366308 13752 ?? SNs 7:31PM 0:00.25 /Library/Application Support/OpenDNS Roaming Client/dns-updater
@quinncomendant
quinncomendant / denominator cli wrapper
Created Aug 8, 2015
This is a CLI wrapper for Netflix/denominator that simplifies many of its common uses. Instead of typing `denominator -q -n yourconfigname record -z example.com add -n example.com -t A -d 1.1.1.1` now you can just run `dns example.com add A 1.1.1.1` (assuming you install this script as `dns`). Run with `-h` for documentation.
View denominator cli wrapper
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 06 Aug 2015 17:51:37
#
# Config
#
# Location of denominator binary.
@quinncomendant
quinncomendant / .htaccess for WP subdirectory installation
Last active Aug 7, 2021
This .htaccess file works with Wordpress installed under a subdirectory wp/ inside the document root.
View .htaccess for WP subdirectory installation
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Make the admin still accessible from /wp-admin
RewriteCond %{REQUEST_URI} ^/wp-admin/?(.*)
RewriteRule .* wp/wp-admin/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^/wp/?$
RewriteRule .* wp/wp-admin/ [L,R=301]
# Base is the URL path of the home directory
RewriteBase /
@quinncomendant
quinncomendant / dscovr-epic-desktop
Last active Sep 13, 2018
This is an OS X command-line script that downloads the latest DSCOVR:EPIC <http://epic.gsfc.nasa.gov/> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <http://brew.sh/> and then the jshon tool (`brew install jshon`). Then you can run the command manually, or add it to your crontab.
View dscovr-epic-desktop
#!/usr/bin/env bash
download_directory="$HOME/Desktop/_dl/epic-earth";
apiurl="http://epic.gsfc.nasa.gov/api/images.php";
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
destfile="$download_directory/$image.jpg";
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "http://epic.gsfc.nasa.gov/epic-archive/jpg/$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
@quinncomendant
quinncomendant / Factuality service.md
Last active May 26, 2016
A service that crowdsources fact checking of web pages. This text is embryonic (text copied from an email to a friend), but it's a powerful idea and needs to start somewhere. I would appreciate comments: help identify problems, offer suggestions towards its design, and how to solve adoption. Email me at quinn@strangecode.com
View Factuality service.md

The idea is to create a means for web users to rate the factuality of content on a web page. A browser extension, which allows individual phrases of text to be selected, then rated for accuracy and commented upon. The browser extension then displays a score of the page’s factuality, based on the crowdsourced ratings. Clicking the extension reveals more detail, including comments from fact-checkers and selected passages from the text with notes and external references. With the plugin running, it could then automatically add a light green or red underline to text on the page which has been rated, indicating exactly which phrases have been reviewed. Hovering the cursor over these phrases brings up a popup of notes for that statement.

But here's the exciting part: each phrase of text that is selected, rated, and commented upon (hopefully with cited references to why the phrases are factual or bullshit) will be sent to a central server with the rating metadata. With a lot of usage, a huge corpus of text phrases

View Design principles of computer systems.md

Design principles of computer systems

Design principles applicable to many areas of computer systems

  • Adopt sweeping simplifications
    So you can see what you are doing.
  • Avoid excessive generality
    If it is good for everything, it is good for nothing.
  • Avoid rarely used components
    Deterioration and corruption accumulate unnoticed—until the next use.
@quinncomendant
quinncomendant / post-receive
Last active Oct 26, 2019
Use this script as `deploy.git/hooks/post-receive` in a bare git repo (`git init --bare`) on a server to deploy application files with `git push production master`.
View post-receive
#!/usr/bin/env bash
# Config
SITEDIR="/path/to/deploy/location";
LOGFILE="$SITEDIR/log/deploy.log";
mkdir -p -m 0777 $(dirname $LOGFILE);
touch $LOGFILE;
# Use variables from STDIN.
@quinncomendant
quinncomendant / podcasts.md
Last active Oct 21, 2016
Podcast subscriptions as of July 2016. Computer-readable OPML version at bottom can be imported into a podcatcher like iTunes.
View podcasts.md
@quinncomendant
quinncomendant / denominator-zone-list.sh
Last active Sep 27, 2016
Wrapper script for denominator to prevent overrunning API limits. It works by watching the output file, and every 3 zones that are saved, it will pause for 4 seconds (so at most 45 zones/minute are retrieved).
View denominator-zone-list.sh
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 23 Sep 2016 19:31:05
#
# Functions
#