Skip to content

Instantly share code, notes, and snippets.

@simeji
simeji / get_repo_stars.sh
Last active February 11, 2025 19:31
Get count of Github repository stars
#!/bin/bash
USER=$1
REPO=$2
if [ -z "$USER" -o -z "$REPO" ]; then
echo '$1 : Github username, $2: Github repository name (only public repo)'
exit 1
fi
FILENAME=star_${USER}_${REPO}
package main
import (
"log"
"os"
)
const (
LogFileName string = "/tmp/go-debug.log"
)
@simeji
simeji / build.sh
Created January 4, 2017 12:52
jid build with docker
#!/bin/bash
bdir=`pwd`
find $bdir/cmd/jid/jid_* | grep -v .go | xargs -I{} -L1 -P4 rm -f {}
docker run --rm -v $bdir:/go -w /go tcnksm/gox:latest sh -c "go get -d ./... && cd cmd/jid && gox -ldflags '-w -s'"
cd $bdir/cmd/jid
find jid_* | grep -v .go |xargs -I@ -L1 -P4 zip @{.zip,}
@simeji
simeji / nc-http-server
Last active May 13, 2018 11:18
OneLiners
bash -c 'trap exit INT; while true; do ( echo "HTTP/1.0 200 Ok"; echo; echo "Hello World" ) | nc -l 8080; done'
# http://blog.livedoor.jp/sonots/archives/34703829.html