Skip to content

Instantly share code, notes, and snippets.

> Custom quix command file
>
> For the syntax of this file, see http://quixapp.com/syntax/
#kill-defaults
@ Andrew's custom commands
a http://www.amazon.co.uk/gp/search?url=search-alias%3Daps&field-keywords=%s Amazon UK
dabs http://www.dabs.com/search?q=%s Dabs
dict http://dictionary.reference.com/browse/%s Dictionary
@andrewlkho
andrewlkho / python-find.py
Created October 31, 2010 04:38
Recursively search a specified path for matching files. This is the pythonic equivalent of `find /path -name '*.html'`
import os
import os.path
import fnmatch
results = []
for root, dirs, files in os.walk("/path"):
results.extend([os.path.join(root, file) for file in files
if fnmatch.fnmatch(file, "*.html")])
@andrewlkho
andrewlkho / gist:6777065
Last active October 12, 2022 03:50
How to import a gpg secret subkey into an existing secret key
# The following example imports subkey DF6C5C29 into a secret keyring that
# already contains 55C794A2
% gpg --list-secret-keys
sec 4096R/AF72A573 2012-06-17
uid Andrew Ho <andrewho@andrewho.co.uk>
ssb 4096R/55C794A2 2012-06-17
% mkdir 55C794A2
% cd 55C794A2
@andrewlkho
andrewlkho / letter.tex
Last active December 26, 2015 11:29
Basic template for a letter in LaTeX
\documentclass[10pt]{article}
\usepackage{minibox}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@andrewlkho
andrewlkho / gist:7364227
Last active December 27, 2015 17:39
Clean up YouTube

Here is how I make the viewing experience on YouTube that little bit more pleasant (using Safari).

Firstly, I opt-in to the YouTube HTML5 trial which replaces Flash videos with H.264.

Next, I install the [A Cleaner Internet][2] Safari extension which declutters a lot of the site.

Finally, I apply a stylesheet which removes the "You need to upgrade your Adobe Flash Player" warning that appears when flash is not installed (user.css). If a video requires flash then I open it in Google Chrome using the "Open With..." part of the Develop menu.

@andrewlkho
andrewlkho / gist:7369417
Last active February 21, 2024 03:29
How to compile gpg2 on OS X Mavericks
# Depends: libgpg-error
curl -O ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.bz2
tar xjf libgpg-error-1.12.tar.bz2
cd libgpg-error-1.12
./configure --prefix=/usr/local
make
sudo make install
@andrewlkho
andrewlkho / gist:7373190
Last active March 25, 2024 03:37
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@andrewlkho
andrewlkho / gist:7442103
Last active December 28, 2015 04:19
Some files associated with my TaskPaper setup
<theme>
<!-- Define solarized colours -->
<color id="base03" red="0.000" green="0.169" blue="0.212" alpha="1.0" />
<color id="base02" red="0.027" green="0.212" blue="0.259" alpha="1.0" />
<color id="base01" red="0.345" green="0.431" blue="0.459" alpha="1.0" />
<color id="base00" red="0.396" green="0.482" blue="0.514" alpha="1.0" />
<color id="base0" red="0.514" green="0.580" blue="0.588" alpha="1.0" />
<color id="base1" red="0.576" green="0.631" blue="0.631" alpha="1.0" />
<color id="base2" red="0.933" green="0.910" blue="0.835" alpha="1.0" />
<color id="base3" red="0.992" green="0.965" blue="0.890" alpha="1.0" />
@andrewlkho
andrewlkho / gist:9943678
Last active August 29, 2015 13:58
An unsupported NIC: how to enable support for Intel EtherExpress 10/100 on Solaris

This was originally posted on 2007-01-05 to http://andrewho.co.uk/weblog/an-unsupported-nic

According to the HCL, my network card (an Intel EtherExpress 10/100) isn't natively supported by Solaris, and this can easily be confirmed with the handy Installation Check Tool. However, after a bit of research, I'm fairly certain that it does in fact work with the iprb driver. So, let's let Solaris know this.

Searching the ouput of prtconf -pv for 00020000 (the class-code for

@andrewlkho
andrewlkho / gist:9943844
Last active August 29, 2015 13:58
How to connect to jabber.org using centericq

This was originally posted on 2007-03-03 to http://andrewho.co.uk/weblog/centericq-and-ejabberd

I've been unable to connect to the jabber.org server using centericq, and after a bit of google-ing, I've found the reason why. It turns out that centericq sends a request for iq:agents, which is deprecated. ejabberd returns with 503 Service Unavailable, and centericq disconnects immediately. The fix for this is to simply stop centericq from sending this request. In src/hooks/jabberhook.cc comment out the following lines:

x = jutil_iqnew(JPACKET__GET, NS_AGENTS);