Skip to content

Instantly share code, notes, and snippets.

@cryptix
cryptix / 4chanDD.js
Created May 23, 2011 16:00
4chan dumper node.js style
var fs = require('fs'),
util = require('util'),
path = require('path'),
http=require('http'),
url=require('url'),
jsdom = require('jsdom');
var boardUrl=process.argv.length>2 ? process.argv[2] : 'http://boards.4chan.org/w/res/1230239',
threadNum = path.basename(boardUrl);
//console.dir(u);
@cryptix
cryptix / hybrid.sh
Created July 3, 2011 21:57
sending stuff from company to device with hybrid crypto and signing
#!/usr/bin/env bash
cPriv=Company.private.pem # lives at Company HQ
cPub=Company.public.pem # live inside the device
dPriv=Device.private.pem # lives inside the device
dPub=Device.public.pem # lives at Company HQ
function encANDsend {
blob=$1
@cryptix
cryptix / petitionWatch.sh
Created March 14, 2012 14:28
monitor epetitions from the german bundestag. currently acta
signed=0;
while [ $signed -lt 50000 ];
do sleep 5;
signed=$(curl "https://epetitionen.bundestag.de/index.php?action=petition;sa=details;petition=22697" 2>/dev/null \
| grep pet_det_td_4 \
| cut -d '"' -f3 \
| cut -d ' ' -f1 \
| tr -d '>' \
)
left=$(echo "50000 - $signed" | bc)
@cryptix
cryptix / terMenu.sh
Created November 14, 2012 15:27
uses dmenu to go directly to a ssh host, spawn a command without a shell or open a shell directly in a working directory of another.
#!/bin/sh
term=urxvtc
CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run
(
IFS=:
if test "`ls -dt $PATH "$CACHE" 2> /dev/null | sed 1q`" != "$CACHE"; then
mkdir -p "`dirname "$CACHE"`" && lsx $PATH | sort -u > "$CACHE"
fi
@cryptix
cryptix / chat.go
Created February 2, 2013 19:17
simple chat example in go. uses channels to match partners and goroutines for concurency
package main
import (
"fmt"
"io"
"log"
"net"
)
const listenAddr = "localhost:4000"
@cryptix
cryptix / webChat.go
Created February 2, 2013 20:26
chat in the browser
package main
import (
"code.google.com/p/go.net/websocket"
"fmt"
"html/template"
"io"
"log"
"net/http"
)
@cryptix
cryptix / ProxyChecker.go
Created March 25, 2013 18:28
Read proxies from Text file. Check working by making a HTTP Get request
package main
import (
"bufio"
"fmt"
"github.com/hailiang/gosocks"
"io"
"net"
"os"
"runtime"
@cryptix
cryptix / productionAndResources.js
Last active December 19, 2015 06:09
ogame snippets
var prod = $(".summary")
.text()
.split('\n')
.map(function(e) { return parseInt(e) })
.filter(function(e) { return !isNaN(e) } )
.slice(0,3);
window.prompt("curr production:",prod.join('\t'));
var res = ["metal", "crystal", "deuterium"].map(function(e) {
var str = $('#resources_' + e).text().replace('.','');
@cryptix
cryptix / simpleFir.pshdl
Created August 4, 2013 11:18
PSHDL 4-tap Fir Filter
// simple 4 tap fir
// coeff's are power of two
package de.tuhh.hbubert.noiseCancel;
module simpleFir {
param uint Width = 8;
@clock in bit clk;
@reset in bit rst;
ERROR 2013/08/04 14:01:28 build.go:79: # github.com/cryptix/goSimPlot/app/models
duplicate symbol _frame3de in:
$WORK/github.com/cryptix/goSimPlot/app/models/_obj/SimpleFir.cgo2.o
$WORK/github.com/cryptix/goSimPlot/app/models/_obj/SimpleFir.sim.o
duplicate symbol _de_tuhh_hbubert_noiseCancel_simpleFir_rst in:
$WORK/github.com/cryptix/goSimPlot/app/models/_obj/SimpleFir.cgo2.o
$WORK/github.com/cryptix/goSimPlot/app/models/_obj/SimpleFir.sim.o
duplicate symbol _Pred_de_tuhh_hbubert_noiseCancel_simpleFir_rst in:
$WORK/github.com/cryptix/goSimPlot/app/models/_obj/SimpleFir.cgo2.o
$WORK/github.com/cryptix/goSimPlot/app/models/_obj/SimpleFir.sim.o