Skip to content

Instantly share code, notes, and snippets.

@shohi
shohi / bash-snippets.md
Created March 16, 2020 03:54
bash snippets
@shohi
shohi / simple-server.md
Last active March 16, 2020 01:20
simple servers

Simple Server

Python

# port 8000
python2 -m SimpleHTTPServer 8000

# port 8080
python3 -m http.server 8080
@shohi
shohi / go.makefile
Last active March 7, 2020 02:37
Another makefile for golang projects
# TOOD
# refer, https://juejin.im/post/5c98edb56fb9a070d75585e3
@shohi
shohi / Makefile
Created March 6, 2020 23:57
Makefile for Go Projects
GOPATH=$(shell pwd)/vendor:$(shell pwd)
GOBIN=$(shell pwd)/bin
GOFILES=$(wildcard *.go)
GONAME=$(shell basename "$(PWD)")
PID=/tmp/go-$(GONAME).pid
build:
@echo "Building $(GOFILES) to ./bin"
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES)
@shohi
shohi / about.md
Created March 6, 2020 01:16 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
# copy from https://stackoverflow.com/questions/54154112/kubernetes-granting-rbac-access-to-anonymous-users-in-kube-dns
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: anonymous-role
rules:
- apiGroups: [""]
resources: ["services/proxy"]
verbs: ["*"]
@shohi
shohi / docker_snippets.md
Created January 16, 2020 08:51
frequently used docker related scripts

1. Redis

docker run --rm -it -p 6379:6379 redis redis-server --loglevel verbose

2. Ubuntu

docker run --rm -it ubuntu:18.04 bash
@shohi
shohi / sample_test.go
Created July 17, 2019 02:02
`select for update` feature test for ignite v2.7.5 using golang client (NOT work yet)
package examples
import (
"database/sql"
"fmt"
"log"
"net"
"testing"
"time"
@shohi
shohi / tx.py
Last active July 17, 2019 02:02
`select for update` feature test for ignite 2.7.5 using python3
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@shohi
shohi / http-benchmark.md
Created December 15, 2017 02:30 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)