Skip to content

Instantly share code, notes, and snippets.

View pnathan's full-sized avatar
⚒️
worker

Paul Nathan pnathan

⚒️
worker
View GitHub Profile
#!/bin/bash -e
# code to cook a insecure raspbian apache server.
echo -e "\e[1;32m"
# Ridiculous leet script text. Probably mandatory for this kind of
# thing. I summon arbitrary memories of being a teenage geek to
# bolster and approve this message.
cat <<'EOF'
@pnathan
pnathan / action-lib.rs
Created October 11, 2015 17:53
A pre-1.0 command runner in Rust
/*
action module.
The action module is a simplification of running processes. In
particular, it takes a bash-executable string and runs it under -xe
context.
*/
use std::io::File;
use std::io::process::Command;
use std::str::from_utf8_lossy;
@pnathan
pnathan / keep-containers-running.sh
Created October 16, 2015 03:29
keep-those-containers-running
#!/bin/bash
# downloads docker container.
running_id=$(docker ps | grep "$1" | cut -f1 -d' ')
docker pull "$1" | grep 'up to date'
if [[ "$?" -eq "1" ]]; then
docker kill $running_id
fi
@pnathan
pnathan / supershell.elisp
Created January 15, 2016 17:51
supah-shell
(defvar shell-count 0)
(defun supershell ()
(interactive)
(shell (concat "*shell" (number-to-string shell-count) "*"))
(setq shell-count (+ shell-count 1)))
@pnathan
pnathan / notes-on-docker-error.md
Last active May 25, 2016 05:34
Notes on docker error May 13 2016

Likely immediate culprit was a typical gentoo upgrade a week or so ago. I don't use docker on this machine much, and it's been stable for the past few versions. I've had an unpleasant time before with upgrades.

Versions:

 $ docker --version
Docker version 1.11.0, build 4dc5990
@pnathan
pnathan / syntax.ml
Created June 14, 2016 07:29
ocaml syntax error
let table_to_json table =
let open Ezjsonm in
let row_to_triple row =
json_of_triple { row.(0) ; row.(1) ; row.(2) } in
list (Array.to_list (Array.map row_to_triple table))
@pnathan
pnathan / pnathan.lisp
Created April 9, 2017 06:32
pnathan.com
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; pnathan.com
;;;;
(ql:quickload '(:cl-who
:alexandria
:cl-fad
:cl-ppcre
:cl-markdown

Keybase proof

I hereby claim:

  • I am pnathan on github.
  • I am pnathan (https://keybase.io/pnathan) on keybase.
  • I have a public key whose fingerprint is AE27 90E8 CAF3 0681 D91F 582F 4BC4 2EFF CC33 817C

To claim this, I am signing this object:

@pnathan
pnathan / forager.lisp
Created September 26, 2017 07:16
forager.lisp
(yason:parse
(flexi-streams:octets-to-string
(drakma:http-request "https://mastodon.social/oauth/token"
:method :post
:parameters
`(("client_id" . ,*client-key*)
("client_secret" . ,*client-secret*)
("grant_type" . "authorization_code")
("code" . ,*token*)
("scope" . "read")
@pnathan
pnathan / flexijects.lisp
Created November 21, 2017 09:01
pure CL prototype-based objects
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; flexijects. An object system for CL.
;;;;
;;;; Uses closures and lists.
;;;;
;;;; CC0 - Paul Nathan, 2015.
;;;;
;;;;
(defparameter *known-classes* nil