Skip to content

Instantly share code, notes, and snippets.

@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
#!/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 / 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

@austinjp
austinjp / Wordpress-inside-LXC.md
Last active December 7, 2024 18:37
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!

/* Edits by Austin 2015 */
/* See https://gist.github.com/austinjp/c04785162ac6ddae3f8c */
/* ######################### Edin theme tweaks ############################# */
#colophon {
display: none !important;
}
h1.site-title {
#!/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
#!/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: