Skip to content

Instantly share code, notes, and snippets.

View parkghost's full-sized avatar

Brandon Chen parkghost

View GitHub Profile
@parkghost
parkghost / profilingtool.go
Last active January 3, 2023 10:47
a toolkit to help profiling go programmes
package main
import (
"fmt"
"log"
"os"
"runtime"
"runtime/debug"
"runtime/pprof"
"strconv"
@parkghost
parkghost / dirurldecode.go
Last active August 29, 2015 14:00
urldecode filenames
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
"path/filepath"
@parkghost
parkghost / main.go
Created June 6, 2014 17:04
http bandwidth throttling
package main
import (
"log"
"net"
"net/http"
"time"
)
var port = ":8080"
@parkghost
parkghost / ab+.sh
Created December 14, 2014 10:24
ab+.sh
#!/bin/bash
# ab+
#
# os and network tuning
# ulimit -n 100000
# sudo echo "2048 64512" > /proc/sys/net/ipv4/ip_local_port_range
# sudo echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
# sudo echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
# sudo echo "10" > /proc/sys/net/ipv4/tcp_fin_timeout
# sudo echo "65535" > /proc/sys/net/core/somaxconn