Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
WIN_ARG=""
until [[ "$1" != *"="* ]]; do
WIN_ARG="$WIN_ARG SET $1 &&"
shift
done
WIN_ARG="$WIN_ARG $@"
@aseering
aseering / ionice
Last active August 10, 2016 13:07
'ionice' stub
#!/bin/dash
##########
#
# 'ionice' wrapper script
#
# Use this stub if you're running in an environment where 'ionice' is
# not supported and not strictly required, but it's
# used as a convenience by some script that you need to run.
#
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
#!/bin/bash
echo "$@" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|'
#define _GNU_SOURCE
#include <sys/types.h>
#include <dlfcn.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
static int (*real_open)(const char *pathname, int flags, int mode);
/* static ssize_t (*real_write)(int fd, const void *buf, size_t count); */
@aseering
aseering / ntlmdecoder.py
Last active July 25, 2024 03:45
NTLM auth-string decoder
#!/usr/bin/env python
## Decodes NTLM "Authenticate" HTTP-Header blobs.
## Reads the raw blob from stdin; prints out the contained metadata.
## Supports (auto-detects) Type 1, Type 2, and Type 3 messages.
## Based on the excellent protocol description from:
## <http://davenport.sourceforge.net/ntlm.html>
## with additional detail subsequently added from the official protocol spec:
## <http://msdn.microsoft.com/en-us/library/cc236621.aspx>
##
@aseering
aseering / spymemcached_jython.py
Created November 24, 2012 02:48
Django spymemcached Jython cache backend.
"""
A memcached library for Jython. Wraps spymemcached.jar.
Very lightly tested; use at your own risk!
Depends on spymemcached (<http://code.google.com/p/spymemcached/>).
No fancy features, but it shouldn't be hard to extend.
"""
from java.net import InetSocketAddress
from net.spy.memcached import MemcachedClient, BinaryConnectionFactory