Skip to content

Instantly share code, notes, and snippets.

@yarwelp
yarwelp / polyglot.c
Created September 29, 2011 06:38
A polyglot written in C and bash
#include <stdio.h>
#include <stdlib.h> /*
# Copyright (c) 2011, Erik Nordstroem <contact[at]erikano[dot]net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@yarwelp
yarwelp / truth_table.js
Created November 29, 2011 07:17
Truth table (JavaScript)
/* js-truth_table
*
* file: truth_table.js
*
* Copyright (c) 2011, Erik Nordstroem <contact@erikano.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@yarwelp
yarwelp / permutations.py
Created December 4, 2011 10:37
Permutations (Python)
#!/usr/bin/env python
# file: permutations.py
# Copyright (c) 2011, Erik Nordstroem <contact@erikano.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
@yarwelp
yarwelp / upload.sh
Created March 15, 2012 04:47
Upload eBooks as attachments to CouchDB
#!/usr/bin/env bash
# usage: ./upload.sh http[s]://user:pass@host:port/database directories...
# This script creates a new document for each directory and then uploads the
# contents of each directory as attachments to said document.
# The script was made for uploading eBooks to my CouchDB so that I can retrieve
# them no matter where I am or what device I am on, but it can easily be
# adapted to other content as well.
@yarwelp
yarwelp / encrypted-git-repo.md
Created September 27, 2012 21:53
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@yarwelp
yarwelp / 01.configure
Last active December 14, 2015 00:09
homebrew: libxml++ failed to build on 10.7.5
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... macros/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports GNU make features... yes
@yarwelp
yarwelp / pwgenp.sh
Last active December 20, 2015 14:58
Generate a pronouncable password.
#!/usr/bin/env bash
#
# Copyright (c) 2013 Erik Nordstroem <contact@erikano.net>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@yarwelp
yarwelp / build-cargo-freebsd-v7.log
Created January 30, 2015 14:08
build-cargo-freebsd-v7.log
This file has been truncated, but you can view the full file.
*** mkdir /home/rust/src/cargo-freebsd/target
*** fetch rust-nightly-2014-12-12 from https://static.rust-lang.org/dist/2014-12-12/rust-nightly.tar.gz
0.1% 0.2% 0.3% 0.5% 0.7% 0.9% 1.2% # 1.6% # 1.8% # 1.9% #
@yarwelp
yarwelp / build-cargo-freebsd-v7.cont.log
Created January 30, 2015 16:07
build-cargo-freebsd-v7.cont.log
*** Clone Cargo repository
Cloning into 'cargo/head'...
*** Installed Cargo is 72 merges behind HEAD
*** Processing cargo/a0e7e7a88b23a0d372655f52769ef0d36dc34d49
*** git clone https://github.com/rust-lang/cargo.git -> cargo/a0e7e7a88b23a0d372655f52769ef0d36dc34d49
Cloning into 'cargo/a0e7e7a88b23a0d372655f52769ef0d36dc34d49'...
Submodule 'src/rust-installer' (https://github.com/rust-lang/rust-installer.git) registered for path 'src/rust-installer'
Cloning into 'src/rust-installer'...
Submodule path 'src/rust-installer': checked out 'b5ac4cd44321da10dfd70f070dbc9094ca3f92ff'
Submodule 'test/rust-installer-v1' (https://github.com/rust-lang/rust-installer) registered for path 'test/rust-installer-v1'
#!/usr/bin/env bash
# Run as www-auto, e.g. `sudo -u www-auto ./sitemap.sh'
cd /usr/local/www/net.erikano.www && touch sitemap.htm &&\
(
cat <<HTMLBegin
<!DOCTYPE html>
<html>
<head>