Skip to content

Instantly share code, notes, and snippets.

@cryptix
cryptix / connectback.go
Created January 17, 2014 16:34
Connect-Back shell in <50 lines of Go
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"os/exec"
)
@cryptix
cryptix / smtpAuthLogin.go
Created October 4, 2013 09:27
implements the smtp.Auth interface to use AUTH with the LOGIN scheme.
// mailing helpers
type loginAuth struct {
username, password string
}
func LoginAuth(username, password string) smtp.Auth {
return &loginAuth{username, password}
}
func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) {
@cryptix
cryptix / runner.go
Created August 8, 2013 12:25
PSHDL sim runner for lilHarv
package main
// simulateC.c comes from api.pshdl.org
// http://api.pshdl.org/api/v0.1/workspace/3978D82198FB1F6B
// in this case
// #include "simulateC.h"
import "C"
import (
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
@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;
@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 / 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 / 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 / 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 / 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)