Skip to content

Instantly share code, notes, and snippets.

View alexjj's full-sized avatar

Alex Johnstone alexjj

View GitHub Profile
@peterkeen
peterkeen / automatic.txt
Created April 8, 2015 16:23
Examples from Program Your Finances: Envelope Budgeting
= /Income:Salary/ and expr date >= [2015/04/01] && date < [2015/06/01]
* Assets:Funds:Water $50.00
* Liabilities:Funds:Water $-50.00
= /Income:Salary/ and expr date >= [2015/06/01]
* Assets:Funds:Water $55.00
* Liabilities:Funds:Water $-55.00
= /Expenses:Water/
* Liabilities:Funds:Water 1.0
apt-get install zlib1g-dev
apt-get install g++
export VENV=$VIRTUAL_ENV
mkdir $VENV/packages && cd $VENV/packages
XAPIAN_VERSION=1.2.20
curl -O http://oligarchy.co.uk/xapian/$XAPIAN_VERSION/xapian-core-$XAPIAN_VERSION.tar.xz
curl -O http://oligarchy.co.uk/xapian/$XAPIAN_VERSION/xapian-bindings-$XAPIAN_VERSION.tar.xz
@travisdahlke
travisdahlke / ledger2beancount.py
Created November 7, 2014 18:57
Ledger to Beancount
#!/usr/bin/python
import ledger
import sys
import re
def account_name(post):
account = post.account.fullname().replace(" ","").replace("(","").replace(")","").replace("'","")
return re.sub(r'\:(\d)',r':X\1', account)
@StefanWallin
StefanWallin / README.md
Last active January 15, 2022 06:22 — forked from konklone/ssl.rules
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).

Ikiwiki Tasklist

I love org-mode, don't get me wrong, but as I do more work inside of [ikiwiki], I think I'd like to have an org-agenda like functionality inside of an ikiwiki. I've cobbled together the following script with that goal in mind.

This is probably the best script I've written so far: it has nifty arguments and (some) error checking (see the help text for more), and best of all it works like a dream. The only thing to configure is the

@jacobblock
jacobblock / FreeNAS.md
Last active October 22, 2023 13:01
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

Backing up a GPG private key to a QR code

Use at your own risk! As with any backup method, test out your backup by restoring from it before you trust it.

  1. Install qrcode to generate the QR code:

     pip install qrcode
    
  2. Export the key, piping the output to qr, and save this to a png file:

@swarminglogic
swarminglogic / watchfile.sh
Last active March 4, 2024 14:44
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
function getBackgroundColor(rangeSpecification) {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
return sheet.getRange(rangeSpecification).getBackground();
}
function getForegroundColor(rangeSpecification) {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
return sheet.getRange(rangeSpecification).getFontColor();
}
@konklone
konklone / ssl.rules
Last active May 19, 2024 18:02
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {