Skip to content

Instantly share code, notes, and snippets.

View oldpatricka's full-sized avatar

Patrick Armstrong oldpatricka

View GitHub Profile
@andrewlkho
andrewlkho / README.md
Last active March 30, 2023 01:22
Implementing HTTPS on NFSN (nearlyfreespeech.net) hosting using Let's Encrypt

These instructions are for implementing HTTPS on a NFSN-hosted static site using a certificate from Let's Encrypt. The certificate is generated manually on a separate computer.

Start off by installing the letsencrypt client. This requires sudo privileges and will install a bunch of packages:

% curl -O https://dl.eff.org/certbot-auto
% chmod +x ./certbot-auto
% ./certbot-auto

Generate the certificate. This will require you to publish some challenge responses on NFSN. I find it easiest to use tmux with letsencrypt running in one window and an SSH session to NFSN in another:

@oldpatricka
oldpatricka / dummy-pre-commit.sh
Last active February 6, 2017 14:35
Pre-commit hook to check for fixes or todos
#!/bin/sh
. git-sh-setup # for die
git-diff-index -p -M --cached HEAD -- | grep '^+' |
egrep 'TODO|FIXME|PDA' && die Blocking commit because string TODO/FIXME/PDA detected in patch
:
#!/bin/bash
# chkconfig: 345 99 01
# description: tcollector agent daemon
#
# processname: tcollector.py
# Get TSD_HOST from a file that can be set in ctx
TSD_HOST="nimbus-opentsdb.no-ip.info"
#!/usr/bin/env python
import os
import sys
import base64
import boto
from boto.ec2.regioninfo import RegionInfo
import urllib2
def pgm_help():
Index: src/Linux/Makefile
===================================================================
--- src/Linux/Makefile (revision 317)
+++ src/Linux/Makefile (working copy)
@@ -15,10 +15,6 @@
ifeq ($(JSON),)
JSON=yes
endif
-ifeq ($(JSON),yes)
- CFLAGS+=-DHSF_JSON
@oldpatricka
oldpatricka / mail-ec2-report.bash
Created January 20, 2012 18:50
A script to remind you if you've left instances running
#!/bin/bash
#
# mail-ec2-report.bash - A script to remind you if you've left instances running
# You must set this:
EMAIL="foo@example.com" # email address (or list of email addresses) to send message to
# You may want to set these:
#REGIONS="" # By default, generates a report for every region
#MAIL="mail" # Mail program to use. Maybe try: https://github.com/oldpatricka/maul
#!/usr/bin/env python
import os
import sys
import json
import string
import base64
import argparse
import threading
import logging
import textwrap
@ox
ox / C.rb
Created March 6, 2011 23:09
A simple time clocker for your next project.
#!/usr/bin/ruby
# Version (0.78)
# Created by Artem Titoulenko (artem.titoulenko@gmail.com)
# clock in application. I'm tired of counting.
# C.rb -- Time keeping script.
# Call with no params to clock in/out
# Params:
# ? : are you clocked in? check
# log : peek at the work log