Skip to content

Instantly share code, notes, and snippets.

View kljensen's full-sized avatar
😵‍💫
0101010101

k⃝͡yl͜e j⃝͡en͜s͜en kljensen

😵‍💫
0101010101
View GitHub Profile
#!/usr/bin/env zsh
# This is a zsh shell script for uploading files to s3 in order to share
# them via email, sms, or similar. The uploaded files are purged from your
# s3 bucket after 30 days so that you don't incur storage costs. After upload
# the public URLs for your files are copied to the clipboard (if you're using
# a mac and have `pbcopy`). The only zsh-specific part of the code is the
# array append/join (I think). You can likely port this to a different shell
# with relative ease. This requires the AWS CLI, AWS credentials (`aws configure`),
# and an existing bucket (see `$BUCKET` below).
@kljensen
kljensen / pf-whitelist-google-ip-addresses
Last active April 18, 2020 11:57
download google ip addresses in order to whitelist in your firewall, e.g. pf.
#!/bin/sh
dig TXT +short _spf.google.com | \
tr ' ' '\n'| \
grep 'include:' | \
sed 's/include://' | \
xargs -Ixxx dig TXT +short xxx | \
tr ' ' '\n' | \
grep '^ip[46]:' | \
cut -c5-
# Outputs something like
@kljensen
kljensen / remove-spaces-before-citations.lua
Last active January 7, 2020 20:37
A Pandoc Lua filter that removes Spaces before Cite elements
local function remove_citation_space(para)
local table elements = {}
i = 0
local function logel(el)
i = i + 1
elements[i] = el.t
end
pandoc.walk_block(para, {Inline = logel})

I don't why c9 has such ancient node versions some times. To get something more recent, do

nvm install 8
nvm alias default 8
@kljensen
kljensen / apu2-openbsd-install-notes.md
Last active November 26, 2018 00:35
The steps I followed to install OpenBSD on a PCEngines apu2 (apu2d4)

Building the device

I followed this video

Connecting to the machine for the first time

Installed the driver serial adapter for the CP2104 USB to UART Bridge Controller device. This is the cord

SELECT
movies.title,
COUNT(*) as num_reviews
FROM
movies
JOIN
reviews
ON movies.id = reviews.movie_id
WHERE
action = 1
CREATE TABLE person (
id INTEGER PRIMARY KEY,
name TEXT,
email TEXT,
username TEXT
);
CREATE TABLE task (
id INTEGER PRIMARY KEY,
title TEXT,
CREATE TABLE task (
id INTEGER PRIMARY KEY,
name TEXT,
completed INTEGER
);
#!/bin/bash
# Call this with something like `PAGE=4 ./clone-all.sh my-org-name`
# Expects to find an environment variable and loads a .env file if
# it finds it in `cwd`.
if [ -z "$1" ]
then
echo "You must supply an organization name";
exit 1;
title: Full reddit recommended routine
exercises:
- instruction: jumping jacks
number: 60
istimed: true
- instruction: band dislocates
number: 60
istimed: true
- instruction: wrist mobility
number: 30