Skip to content

Instantly share code, notes, and snippets.

View jerluc's full-sized avatar
😵‍💫

Jeremy Lucas jerluc

😵‍💫
View GitHub Profile
@jerluc
jerluc / test_exception.py
Created June 14, 2019 00:32
Testing aiohttp web exceptions
from aiohttp import web
def test_exception(request):
text_or_reason = request.query["type"]
raise web.HTTPBadRequest(**{text_or_reason: "The request was bad!"})
if __name__ == "__main__":
app = web.Application()
@jerluc
jerluc / osd-remove.sh
Created February 16, 2014 01:12
Ceph OSD removal
# As sudo
ceph osd crush remove osd.{osd-num}
ceph auth del osd.{osd-num}
ceph osd rm {osd-num}
ceph osd crush remove {host}

Keybase proof

I hereby claim:

  • I am jerluc on github.
  • I am jerluc (https://keybase.io/jerluc) on keybase.
  • I have a public key ASCU1QCdS89cSPV4uhZl0moOuRzXt8P-WKjnjt7GnyN7Pgo

To claim this, I am signing this object:

while True:
stuff = raw_input("Write some stuff with more than 4 characters!")
if len(stuff) < 4:
print "Boo. That was too short. Try again."
pass
else:
print stuff[3:len(stuff) +1]
break
@jerluc
jerluc / contents.markdown
Last active March 9, 2016 20:57
Open content linking proposal

On linking content across varying media

A brief history of hypertext documents

Many of the technologies being built today are based on the ideas initially conceived by post-World War II scientists. In fact, it was in July of 1945, when Dr. Vannevar Bush described the ["memex" device][2], a device with an uncanny resemblance to the Internet:

A memex is a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility.

Only twenty years later in 1965, Ted Nelson, inspired by the same Dr. Bush, would conceive of the idea that content and documents should be ["hyperlinked"][3]. And finally in 1990, [Tim Berners-Lee along with some of his colleagues][4], would tie the concept of the hyperlink together with the idea of an inter-connected world to develop what we know now today as the Internet, allowing humankind to access and link information across vast distances almost instantly.

The disconnec

@jerluc
jerluc / linkedlist.c
Created March 2, 2016 19:23
A simple linked list implementation
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define LL_OK 0
#define LL_NOTOK 1
typedef struct ll_node {
void* value;
struct ll_node* next;
first_name = 'Elliott'
last_name = 'Lucas'
# What does this output?
print(first_name + last_name)
@jerluc
jerluc / makeself.run
Last active January 3, 2016 07:38
Makeself makeself
@jerluc
jerluc / update-resolv-conf
Created January 12, 2014 02:07
OpenVPN resolv.conf update script
#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
@jerluc
jerluc / build.log
Last active December 29, 2015 23:29
Pidgin build failure
 * Package: net-im/pidgin-2.10.7-r5
 * Repository: gentoo
 * Maintainer: polynomial-c@gentoo.org net-im@gentoo.org
 * USE: amd64 dbus elibc_glibc gstreamer gtk kernel_linux ncurses nls python_single_target_python2_7 python_targets_python2_7 userland_GNU xscreensaver
 * FEATURES: preserve-libs sandbox userpriv usersandbox
* dbus is enabled, no way to disable linkage with python => python is enabled
>>> Unpacking source...
>>> Unpacking pidgin-2.10.7.tar.bz2 to /var/tmp/portage/net-im/pidgin-2.10.7-r5/work
>>> Unpacking pidgin-eds-3.6.patch.bz2 to /var/tmp/portage/net-im/pidgin-2.10.7-r5/work
>>> Source unpacked in /var/tmp/portage/net-im/pidgin-2.10.7-r5/work