Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Stupid script to render LaTeX from Authorea to PDF, RTF, ODF and HTML.
# I can't get Authorea to reliably render things, so
# it looks like I'll have to do it myself. I was really
# hoping to avoid learning LaTeX et al, so this is
# an Ugly Hack.
# The commands pdflatex and bibtex are repeated as per:
#!/bin/bash
# As per http://steady.org/2013/06/19/exporting-evernote-notes-to-plain-text-files-part-1/
# First, check how many Evernote notes you have. You need to know that number.
# Rename your .enex file to evernote.xml
# Create a tidy.conf file that looks something like this:
# output-xml: yes
# input-xml: no
/* Edits by Austin 2015 */
/* See https://gist.github.com/austinjp/c04785162ac6ddae3f8c */
/* ######################### Edin theme tweaks ############################# */
#colophon {
display: none !important;
}
h1.site-title {
@austinjp
austinjp / Wordpress-inside-LXC.md
Last active September 7, 2023 12:04
An *unprivileged* LXC container dedicated to running Wordpress

What and why

Create an unprivileged Linux container (LXC) dedicated to running Wordpress websites.

If you install Wordpress regularly on Linux you can instead simply clone this container.

The Wordpress installation is nothing fancy. It's not multi-site, it's not SSL enabled by default, or anything like that. Just a plain bog-standard Wordpress installation serving a single domain.

Warning!

@austinjp
austinjp / Wordpress-startup-errors.md
Created January 6, 2016 11:37
Errors when running Wordpress for the first time

WordPress database error: [Invalid default value for 'user_registered'] CREATE TABLE wp_users ( ID bigint(20) unsigned NOT NULL auto_increment, user_login varchar(60) NOT NULL default '', user_pass varchar(64) NOT NULL default '', user_nicename varchar(50) NOT NULL default '', user_email varchar(100) NOT NULL default '', user_url varchar(100) NOT NULL default '', user_registered datetime NOT NULL default '0000-00-00 00:00:00', user_activation_key varchar(60) NOT NULL default '', user_status int(11) NOT NULL default '0', display_name varchar(250) NOT NULL default '', PRIMARY KEY (ID), KEY user_login_key (user_login), KEY user_nicename (user_nicename) )

WordPress database error: [Invalid default value for 'comment_date'] CREATE TABLE wp_comments ( comment_ID bigint(20) unsigned NOT NULL auto_increment, comment_post_ID bigint(20) unsigned NOT NULL default '0', comment_author tinytext NOT NULL, comment_author_email varchar(100) NOT NULL default '', comment_author_url varchar(200) NOT NULL default '', comment_aut

#!/bin/bash
# If this script fails you may have carriage returns at the end of each line. Try:
# sed -i -e 's/^M//g' batch.sh
# ... where you can create the ^M character by typing control-v control-m
# Then of course:
# chmod +x batch.sh
# Relies on some pandoc filters:
# https://github.com/tomduck/pandoc-fignos
@austinjp
austinjp / gitbook-one-pager.sh
Created August 23, 2016 18:17
Creates a single page that includes every file. Outputs "onepage.md". You need to add this to your SUMMARY.md (or equivalent) for gitbook to render it.
#!/bin/bash
# Expand current directory to absolute path:
declare wd="."
declare wd=$( cd $(dirname $wd) ; pwd -P )
declare filelistfile="/tmp/onepager.txt"
# FIXME use $wd in redirect
@austinjp
austinjp / .emacs
Last active August 5, 2021 07:38
.emacs config using el-get
;; Set TLS to use version 1.2 for elpa.gnu.org.
;; TLS version 1.1 also works, but 1.3 does NOT.
;; Note this must be BEFORE package-initialize.
;; May need to do: sudo apt install gnutls-bin libgnutls28-dev
;; Some background: https://emacs.stackexchange.com/a/51772
;; Check supported TLS versions here:
;; https://www.ssllabs.com/ssltest/analyze.html?d=elpa.gnu.org&hideResults=on
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
@austinjp
austinjp / my.cnf
Created November 5, 2016 10:53
MySQL config for a box/container with minimal resources
# Based on http://pastie.org/pastes/8665237/text
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version REL5-20120208
[mysql]
# CLIENT #
port = 3306
socket = /var/run/mysqld/mysqld.sock

Keybase proof

I hereby claim:

  • I am austinjp on github.
  • I am austinjp (https://keybase.io/austinjp) on keybase.
  • I have a public key ASBy6Q1xn72bA6hOIwOOHeAulDC5dLdYmgBLLfFbaTqRQgo

To claim this, I am signing this object: