Skip to content

Instantly share code, notes, and snippets.

View paulproteus's full-sized avatar

Asheesh Laroia paulproteus

View GitHub Profile
#!/bin/bash
set -euo pipefail
YOURMIRROR=mirror.mit.edu
DISTRO_VERSION=jessie
ARCH=amd64
pushd "$(mktemp -d /tmp/$(date -I).debian-installer-downloads.XXXXXXXXX)"
echo -n "Doing downloads in "
pwd
@paulproteus
paulproteus / donuts.md
Created September 23, 2015 17:10
key beige

Keybase proof

I hereby claim:

  • I am paulproteus on github.
  • I am asheesh (https://keybase.io/asheesh) on keybase.
  • I have a public key whose fingerprint is 9722 5E58 9D6B 9E01 533C 485E EC4B 033C 7009 6AD1

To claim this, I am signing this object:

<script>
/* On Sandstorm, synchronize URL with Sandstorm address bar */
window.parent.postMessage({'setPath': location.pathname + location.hash}, '*');
</script>
all: libintl.so hello
libintl.so:
gcc -c -Wall -Werror -fpic nothing.c
gcc -fpic -shared -o libintl.so nothing.c
hello:
LD_LIBRARY_PATH=. g++ -lintl hello.cxx
hello2:
@paulproteus
paulproteus / nginx-default
Created April 17, 2015 20:27
Sandstorm + nginx, just http (no https)
# This is an example nginx config used to serve your Sandstorm server without SSL/TLS.
#
# Definitions like these should go in the "http" block of your nginx config.
# Configuration for Sandstorm shell.
server {
listen 80;
server_name localhost; # no need to customize this line
location / {
(sqlobject)self@gregorian:~/projects/sqlobject$ python
Python 2.7.6 (default, Jan 11 2014, 14:34:26)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import absolute_import
>>> import main
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named main
>>> import sqlobject.main
#!/usr/bin/python
def process_filename(filename):
lines = open(filename).readlines()
return process_string(lines)
def process_string(lines):
# Find first line, rofl
output_index = None
for i, line in enumerate(lines):
@paulproteus
paulproteus / input.txt
Last active August 29, 2015 14:03
input
s
n
n
s
s
n
n
n
n
n
def to_n_and_s(i):
x = bin(i)
assert x.startswith('0b')
x = x[2:]
x = x.replace('1', 'n\\n')
x = x.replace('0', 's\\n')
x += 'c\\n'
return x
PREFIX = 'snns'
➜ n_and_s cat gen.py
def to_n_and_s(i):
x = bin(i)
assert x.startswith('0b')
x = x[2:]
x = x.replace('1', 'n\n')
x = x.replace('0', 's\n')
x += 'c\n'
return x