Skip to content

Instantly share code, notes, and snippets.

@hollychen503
hollychen503 / client.go
Created January 25, 2019 03:14 — forked from hakobe/client.go
golang unix domain socket
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@hollychen503
hollychen503 / Makefile
Created January 17, 2019 09:08 — forked from turtlemonvh/Makefile
Golang Project Makefile Template
# Borrowed from:
# https://github.com/silven/go-example/blob/master/Makefile
# https://vic.demuzere.be/articles/golang-makefile-crosscompile/
BINARY = superdo
VET_REPORT = vet.report
TEST_REPORT = tests.xml
GOARCH = amd64
VERSION?=?
@hollychen503
hollychen503 / httpclient.go
Created January 15, 2019 15:12 — forked from dmichael/httpclient.go
Light wrapper for the Go http client adding (essential) timeouts for both connect and readwrite.
package httpclient
import (
"net"
"net/http"
"time"
)
type Config struct {
ConnectTimeout time.Duration
@hollychen503
hollychen503 / gist:7a080edcc9011f15faf89498a4450a2d
Created November 10, 2018 12:10 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@hollychen503
hollychen503 / git_retag
Created October 10, 2018 06:42 — forked from lucijafrkovic/git_retag
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d V_1_0_1
3. push tag deletion to remote
git push origin :refs/tags/V_1_0_1
4. tag local branch again
@hollychen503
hollychen503 / serve.go
Created July 24, 2018 08:47 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz
@hollychen503
hollychen503 / go-ssh-reverse-tunnel.go
Created July 23, 2018 10:30 — forked from codref/go-ssh-reverse-tunnel.go
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
@hollychen503
hollychen503 / shadowsocks-server.service
Created July 14, 2018 04:52 — forked from guyskk/shadowsocks-server.service
shadowsocks server systemd service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss-config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target
@hollychen503
hollychen503 / chrome-headless.robot
Created July 4, 2018 11:48 — forked from nottyo/chrome-headless.robot
Selenium2Library with Chrome Headless Mode
*** Settings ***
Library Selenium2Library
*** Variables ***
${url} https://medium.com/@nottyo/
@{chrome_arguments} --disable-infobars --headless --disable-gpu
${page_text} Test Automation Engineer. Let’s make awesome tests
${timeout} 10s
*** Test Cases ***