Skip to content

Instantly share code, notes, and snippets.

View jim3ma's full-sized avatar
🎯
Focusing

Jim Ma jim3ma

🎯
Focusing
View GitHub Profile
@jim3ma
jim3ma / ova-gen.sh
Created March 3, 2016 04:36 — forked from rubiojr/ova-gen.sh
Convert VMDK to OVA using VirtualBox
#!/bin/sh
#
# http://jbrazile.blogspot.com.es/2012/01/scripted-vmdkova-images-wboxgrinder-and.html
#
NAME=$1
OS=$2
IMAGE=
SZMB=384
INSTDIR=/tmp/ova-gen/boxes
BUILDDIR=/tmp/ova-gen/builds
@jim3ma
jim3ma / ngrok-selfhosting-setup.md
Created March 16, 2016 01:29 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@jim3ma
jim3ma / mptcp_rpm_install.md
Created March 22, 2016 14:32 — forked from nak3/mptcp_rpm_install.md
mptcp kernel RPM package install instructions

Description

mptcp_kernel is the kernel package which built with mptcp (MultiPath TCP) function. The source code is hosted in github .

The RPM package is hosted on Fedora copr. It can be used on Fedora and CentOS (only x86_64) and their some versions..

####WARNING

This package is now still working in progress and being tested by Kenjiro Nakayama. Please don't use it in your production system. And this is not official repository and please take full responsibility for your actions.

@jim3ma
jim3ma / proxy.go
Created March 23, 2016 06:28 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@jim3ma
jim3ma / starttls_smtp_example.go
Last active March 28, 2024 20:04 — forked from chrisgillis/ssl_smtp_example.go
Golang StartTLS SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@jim3ma
jim3ma / debian-6-cross-compile-armel.sh
Created May 29, 2016 04:26
install script for armel cross compile in debian 6
#!/bin/bash
# add emdebian-archive-keyring
apt-get update
apt-get install -y emdebian-archive-keyring
# add sources for xapt and cross-compile
cat << EOF >> /etc/apt/sources.list
deb http://archive.debian.org/backports.org squeeze-backports main
deb http://www.emdebian.org/debian squeeze main
@jim3ma
jim3ma / makecert.sh
Last active June 29, 2023 02:17 — forked from spikebike/client.go
Golang TLS server and client
#!/bin/bash
# call this script with an email address (valid or not).
# like:
# ./makecert.sh joe@random.com
mkdir certs
rm certs/*
echo "make server cert"
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1"
echo "make client cert"
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1"
@jim3ma
jim3ma / golang-tls.md
Created June 15, 2016 00:49 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https

@jim3ma
jim3ma / gfw_and_cannon_traceroute.py
Created August 11, 2016 07:37
A Tool for Tracerouting the GC and GFW
#!/usr/bin/env python
import time
import threading
from scapy.all import *
import sys
import socket
maxhop = 25
@jim3ma
jim3ma / es.py
Last active November 29, 2019 13:12 — forked from arturo-c/python-to-es.py
Operate ElasticSearch with AWS sigv4 in python
import base64
import datetime
import json
import os
import time
import traceback
import urlparse
import botocore.auth
import botocore.awsrequest