Skip to content

Instantly share code, notes, and snippets.

@ls0f
ls0f / gist:118d1fd5523e0f3b6193360ac7557c2e
Created February 2, 2023 07:37
golang tcp conn forward, support proxy
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"net"
@ls0f
ls0f / gist:2c7101ae846f530540083cc0b3831089
Created October 21, 2022 01:33
generate a eth wallet
package main
import (
"bytes"
"flag"
"fmt"
"log"
"crypto/ecdsa"
"crypto/hmac"
package main
import (
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"sync"
)
package main
import (
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"log"
"net"
"os"
"strconv"
"time"
@ls0f
ls0f / public.py
Created February 27, 2018 06:44 — forked from dooglus/public.py
create Bitcoin public key from private key
#! /usr/bin/env python
class Point(object):
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order
def calc(self, top, bottom, other_x):
l = (top * inverse_mod(bottom)) % p
x3 = (l * l - self.x - other_x) % p
return Point(x3, (l * (self.x - x3) - self.y) % p)
@ls0f
ls0f / gist:f74f0e261c563c2e9b7fee0a61f2a811
Created August 22, 2017 01:02
socks5/http proxy over ssh
package main
import (
"bufio"
"flag"
"fmt"
g "github.com/golang/glog"
p "github.com/ls0f/proxylib"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal"
@ls0f
ls0f / install_jenkins_plugin.sh
Created August 26, 2016 08:33 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
#coding:utf-8
import re
class Parse(object):
def __init__(self):
self.i = -1
self.text = ""
self.js = None
@ls0f
ls0f / cal.py
Created June 23, 2016 08:41
cal
#coding:utf-8
'''
expr ::= term { (+|-) term }*
term ::= factor { (*|/) factor }*
factor ::= ( expr )
| NUM
@ls0f
ls0f / tail.py
Created April 19, 2016 08:46
Python tail
import os
import time
import sys
class Tail(object):
def __init__(self, file_name):
self.filename = file_name
self.pos = 0