Skip to content

Instantly share code, notes, and snippets.

@jes
jes / measurement.go
Created October 26, 2018 11:48
Tor measurement program
package main
import (
"fmt"
"golang.org/x/net/proxy"
"net"
"os"
"strconv"
"time"
)
'use strict';
class Markov {
constructor() {
this.maxLength = 30;
this.dict = {};
}
addSentence(text) {
// '\0' is a sentinel marking the beginning + end of sentences
#!/usr/bin/perl
use strict;
use warnings;
use bytes;
my $input = 'BYGRBLBYBLBLBYBRBLGYBYYYBLBYBYBLBYFYBLGYBGRGBGRRBGFRBLBFBLBYBYFLBLBGBYYBBLYYBGRLBYYFBYGRBYFRBLBFBGYFBYRRBGRYBGYFBGRRBLGG';
for my $b (0 .. 5) {
@jes
jes / protoproxy.go
Last active September 23, 2022 11:53
Run SSH and HTTP on the same port
package main
import (
"fmt"
"net"
"os"
"strings"
)
func main() {
@jes
jes / xorimg
Created February 17, 2018 21:11
#!/usr/bin/perl
use strict;
use warnings;
use GD;
my $filename1 = shift or die "usage: xorimg ONE.PNG TWO.PNG > OUTPUT.PNG\n";
my $filename2 = shift or die "usage: xorimg ONE.PNG TWO.PNG > OUTPUT.PNG\n";
/* magcube solver
* James Stanley 2018
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* uncomment this if you want to find new cube sets instead of using the set I settled on, ... */
/*
Speedo converter by jes
How to re-program the board:
Orient the board so the programming header is at top left and the LED is at bottom left.
Pins are as follows, from top:
1. Reset
2. 0 (RX)
3. 1 (TX)
4. +5V
@jes
jes / generate-stencil.pl
Last active February 28, 2021 01:44
Convert a black-and-white PNG into an STL stencil
#!/usr/bin/perl
# XXX: This program is super unfinished. It works for my use case, but you will certainly
# have to modify the constants in order to use it for your use case. Make sure the input
# image is black-and-white. Note that the output triangle mesh is super unoptimised.
#
# This is very MVP.
use strict;
use warnings;

Keybase proof

I hereby claim:

  • I am jes on github.
  • I am jamesstanley (https://keybase.io/jamesstanley) on keybase.
  • I have a public key whose fingerprint is DFA2 CEB9 3F23 7CC5 1F35 3CDE 58AB 852A 0A2C C137

To claim this, I am signing this object:

#!/bin/sh
while read domain
do
(addr=`dig +short $domain | head -n1`; /bin/echo -e "$domain\t$addr") &
done
wait