Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View quinncomendant's full-sized avatar

Quinn Comendant quinncomendant

View GitHub Profile
@quinncomendant
quinncomendant / spamdyke-sender-conf
Created May 6, 2017 07:37
Create a custom sender config file for spamdyke using a template
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 06 May 2017 14:45:53
#
# Functions
#
version: '2'
volumes:
dbdata:
driver: local
services:
db:
image: mysql/mysql-server:5.7
ports:
- "3306:3306"
volumes:
@quinncomendant
quinncomendant / denominator-zone-list.sh
Last active September 27, 2016 03:36
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).
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 23 Sep 2016 19:31:05
#
# Functions
#
@quinncomendant
quinncomendant / podcasts.md
Last active October 21, 2016 16:25
Podcast subscriptions as of July 2016. Computer-readable OPML version at bottom can be imported into a podcatcher like iTunes.

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 / Factuality service.md
Last active May 26, 2016 19:38
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

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

@quinncomendant
quinncomendant / dscovr-epic-desktop
Last active September 13, 2018 22:14
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.
#!/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 / .htaccess for WP subdirectory installation
Last active September 12, 2022 03:22
This .htaccess file works with Wordpress installed under a subdirectory wp/ inside the document root.
# 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 / dns.sh
Last active February 21, 2022 22:22
Manage cloud DNS services on the command line. A wrapper for DNS provider API tools (denominator, lexicon).
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 06 Aug 2015 17:51:37
#
# Config
#
set -euo pipefail;
@quinncomendant
quinncomendant / umbrella
Last active May 13, 2022 06:52
[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.
#!/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