Skip to content

Instantly share code, notes, and snippets.

@charmander
charmander / keybase.md
Created April 28, 2014 22:57
Keybase verification

Keybase proof

I hereby claim:

  • I am charmander on github.
  • I am charmander (https://keybase.io/charmander) on keybase.
  • I have a public key whose fingerprint is 306D 15DD D82E C397 96CB F9C1 219E FB31 96A8 710F

To claim this, I am signing this object:

import time
import leafblade
import io
benchmarks = []
data = {
"title": "Example",
"charset": '&quot;"><script></script><"'
}
@charmander
charmander / system-auth.patch
Created July 10, 2014 03:00
Fix for /etc/pam.d/system-auth
--- system-auth.old 2014-07-09 19:59:49.781484477 -0700
+++ system-auth 2014-07-09 19:56:17.791490038 -0700
@@ -1,6 +1,6 @@
#%PAM-1.0
-auth required pam_unix.so try_first_pass nullok
+auth required pam_unix.so try_first_pass nullok nodelay
auth optional pam_permit.so
auth required pam_env.so
@charmander
charmander / sed-find.sh
Last active August 29, 2015 14:04
Finds interesting combinations of words for use with sed.
test -z "$1" && echo "Usage: $0 <word list>" && exit 1
grep -P '^s(.)(?:(?!\1).)*\1(?:(?!\1).)*\1[gimp]*$' "$1" \
| awk '{ print length, $0 }' | sort -rn | cut -d\ -f2- \
| while read line
do
echo $line
sed -n "${line}p" "$1" | sort | diff -u "$1" - | grep -v '^[@+-]'
done 2> /dev/null
@charmander
charmander / test.js
Created August 23, 2014 19:23
Promise-compatible tests in 36 lines.
var descriptions = [];
/* tests here */
function id(x) {
return x;
}
function describe(described, description) {
descriptions.push(function () {
static char *
resolve_editor(const char *ed, size_t edlen, int nfiles, char **files, int *argc_out, char ***argv_out)
{
char *cp, **nargv, *editor, *editor_path = NULL;
int ac, i, nargc;
bool wasblank;
debug_decl(resolve_editor, SUDOERS_DEBUG_PLUGIN)
/* Note: editor becomes part of argv_out and is not freed. */
editor = sudo_emalloc(edlen + 1);
<?php
class Test extends SplBool {}
$t = new Test();
$t->x = 5;
printf "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00>\x00\x01\x00\x00\x00\xb0\x00@\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x08\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x008\x00\x02\x00@\x00\x04\x00\x03\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\xd7\x00\x00\x00\x00\x00\x00\x00\xd7\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\xd8\x00\x00\x00\x00\x00\x00\x00\xd8\x00\`\x00\x00\x00\x00\x00\xd8\x00\`\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00H\xc7\xc0X\x00\x00\x00H\xc7\xc7\xd8\x00\`\x00H\xc7\xc6\xe5\x00\`\x00\x0f\x05H\xc7\xc0<\x00\x00\x00H\xc7\xc7\x00\x00\x00\x00\x0f\x05\x00libc-2.21.so\x00libc.so.6\x00\x00.shstrtab\x00.code\x00.data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
bits 64
section .data
target db "libc-2.21.so", 0
linkpath db "libc.so.6", 0
section .code
global _start
~: time npm info tap version
1.4.0
npm info tap version 2.28s user 0.17s system 11% cpu 20.976 total