Skip to content

Instantly share code, notes, and snippets.

View AndrewKvalheim's full-sized avatar

Andrew AndrewKvalheim

View GitHub Profile
@AndrewKvalheim
AndrewKvalheim / mastodon-notes.md
Last active February 9, 2024 18:30
Notes on running a personal Mastodon instance

Personal Mastodon instance

Effective total cost: $3–5/mo

Setup

Decide on an EC2 instance type:

  1. At AWS Console → EC2 → Instance Types, filter for ≥1 GB RAM and sort by price.
  • t4g.micro is lowest.
@AndrewKvalheim
AndrewKvalheim / ecm-classika-pid.dot
Created April 29, 2020 22:44
Diagram of ECM Classika PID
graph {
nodesep = 0.2; ranksep = 0.2;
water [shape=plain, group=a];
reservoir [shape=oval, group=a];
split_a [shape=point, group=a];
filter_a [shape=box, label="filter", group=a];
pump [shape=box, group=a];
one_way [shape=diamond, group=a, label="one way", margin=0];
split_b [shape=point, group=a];

Static site generators

Frameworks

Healthy community Zero runtime PostCSS Sitemap API Omit file extensions
[Eleventy] ✔ [#272]
[Eleventy] + [Parcel] ❌ [L180]
[Gatsby.js] ❌ [#962]
[Gridsome] ❌ [#1000]
@AndrewKvalheim
AndrewKvalheim / select-redundant-nodes.js
Last active January 29, 2020 19:18
JOSM script to select redundant nodes in buildings
// Given a selection of buildings, select redundant (i.e. collinear, non-tagged,
// non-glued) nodes.
//
// Dependencies:
//
// - [JOSM Scripting Plugin](https://gubaer.github.io/josm-scripting-plugin/)
//
// Usage:
//
// 1. Select some buildings for analysis, e.g. via Search → `new building`.
@AndrewKvalheim
AndrewKvalheim / use-epost-without-proprietary-software.user.js
Created September 23, 2015 22:05
Use epost™ without proprietary software.
// ==UserScript==
// @name Use epost™ without proprietary software.
// @namespace https://Andrew.Kvalhe.im/
// @version 0.1.0
// @description Override the "Adobe Reader Required" message in Canada Post's epost™ service.
// @match https://express.epost.ca/edms/en/pdfPlugin.html*
// @grant none
// ==/UserScript==
window.overRide();

How to upgrade end-of-life Ubuntu 13.04

Ubuntu 13.04 has reached [end-of-life (EOL)][eol], so software updates to it are no longer available. It will continue to check for software updates, however, and fail with error messages such as:

Failed to download repository information.

and:

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring/main/source/Sources  404  Not Found
/ Documentation: http://www.sitemaps.org/protocol.html
doctype xml
urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'
- pages.each do |page|
url
loc = page.absolute_url
lastmod = page.mtime.iso8601
changefreq = page.data.changefreq || 'weekly'
@AndrewKvalheim
AndrewKvalheim / .gitattributes_global
Last active August 29, 2015 14:10
Git diff driver for Anki decks
*.apkg diff=apkg

Keybase proof

I hereby claim:

  • I am AndrewKvalheim on GitHub.
  • I am andrewkvalheim on Keybase.
  • I have a public key whose fingerprint is 3BE8 FAF9 6A55 8283 9915 0084 9254 D459 4094 9194.

To claim this, I am signing this object:

@AndrewKvalheim
AndrewKvalheim / all-unlock-options.patch
Last active December 16, 2015 15:39
Allow less-secure screen unlocks if the encryption password isn't synchronized.
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index f67213c..e015024 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -246,7 +246,8 @@ public class ChooseLockGeneric extends PreferenceActivity {
int encryptionStatus = mDPM.getStorageEncryptionStatus();
boolean encrypted = (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE)
|| (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVATING);
- if (encrypted) {
+ LockPatternUtils lockPatternUtils = new LockPatternUtils(getActivity());