Skip to content

Instantly share code, notes, and snippets.

View lojikil's full-sized avatar
🌊
cantankerous and querulous, he was as the sea to the shore

Logyi, hajnalvédő lojikil

🌊
cantankerous and querulous, he was as the sea to the shore
View GitHub Profile
@gadhra
gadhra / qmail_popper.php
Created April 14, 2011 20:40
This file, written in PHP 4, parsed qmail messages piped to it via a procmail rule (if I remember correctly). The script will parse anything sent to it via stdin.
<?php
/**
* @note Qmail popper::PHP4::qmail-popper-php
* @author Stefan Antonowicz
*
* This file parses out the mails sent to qmail via stdin.
*
* @author Stefan Antonowicz
*/
@davidnunez
davidnunez / gist:1404789
Created November 29, 2011 13:20
list all installed packages in android adb shell
pm list packages -f
@rbohrer
rbohrer / gist:3167777
Created July 24, 2012 03:03
A fuzzer for Scheme compilers/interpreters that generates test programs via macros.
;; Fuzzer configuration
;; A good seed for crashing during code generation: 1343186061
(define seed (current-time)) ; current-time is Guile-specific (RNG seed)
(define max-items 10000) ; Maximum number of list elements in the output program
(define max-int (expt 2 30)) ; Largest int to appear in any math expression
(define branch-factor 100) ; Most arguments to a math expression
;; Random number generator - Numerical Recipes LCG
(define (rand-int mod)
(let ((a 1664525)
@danmidwood
danmidwood / sicpratio.clj
Created March 18, 2013 01:36
Translation of SICP make-rat, denom and numer operations to Clojure with the addition of Typed Clojure to define a "SicpRatio" type as an alias to a vector of size 2
(ns complex-clojure.core
(:require [clojure.core.typed :as t])
(:use [clojure.core.typed :only [AnyInteger]]))
(t/def-alias SicpRatio (Vector* AnyInteger AnyInteger))
(t/ann make-rat [AnyInteger AnyInteger -> SicpRatio])
(defn make-rat [numer denom] [numer denom])
(t/ann denom [SicpRatio -> AnyInteger])
@lojikil
lojikil / fnv.c
Created March 23, 2013 14:58
Fowler-Nolls-Vo hash implementations
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
uint64_t
fnv(char *key, uint32_t len)
{
uint64_t hash = 14695981039346656037;
uint32_t idx = 0;
for(; idx < len; idx++)
@creaktive
creaktive / tinyp2p-annotated.py
Last active February 13, 2019 11:18
tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html)
# tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html)
# (C) 2004, E.W. Felten
# license: http://creativecommons.org/licenses/by-nc-sa/2.0
# Annotated by Kochin Chang, Jan. 2005
# Usage:
# Server - python tinyp2p.py password server hostname portnum [otherurl]
@0xdevalias
0xdevalias / erpscan_automator.bat
Last active September 24, 2016 15:55
A quick little windows batch file to automate scanning a site with [ERPScan SAP Pentesting Tool](http://erpscan.com/products/erpscan-pentesting-tool/)
@echo off
@rem ----------------
@rem Config - Banner
@rem ----------------
set BAT_VER=0.1 (20130703)
set BANNER_DASH=--------------------------------
set BANNER_NAMEVER=Erpscan Automator v%BAT_VER%
set BANNER_BY=Created By: Glenn 'devalias' Grant (http://devalias.net)
set BANNER_UPDATES=Updates at: https://gist.github.com/alias1/6118709
set BANNER_LICENSE=License: The MIT License (MIT) - Copyright (c) 2013 Glenn 'devalias' Grant (see http://choosealicense.com/licenses/mit/ for full license text)
@yawaramin
yawaramin / ParseTags.hs
Last active September 18, 2016 14:59
Parse text tags
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Map as M
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
{- A document part is like a piece of syntax. -}
data DocPart =
Tag T.Text [T.Text] | Run T.Text
import argparse
import datetime
import urllib
import urllib2
import json
import sys
_token = 'YOUR_SLACK_API_KEY'
_files_list_url = 'https://slack.com/api/files.list'
_files_delete_url = 'https://slack.com/api/files.delete'
@lloeki
lloeki / debian-xhyve.sh
Created August 27, 2015 17:21
Running debian 8.1 in xhyve
#!/bin/bash
# unfortunately debian currently panics in xhyve
tmp=$(mktemp -d)
pushd "$tmp"
iso="$HOME"/Downloads/debian-8.1.0-amd64-netinst.iso
#iso="$HOME"/Downloads/debian-8.1.0-i386-netinst.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso