This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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,} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"os" | |
) | |
const ( | |
LogFileName string = "/tmp/go-debug.log" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ago=30;date -v-${ago}d > /dev/null 2>&1 && DATE=`date -v-${ago}d +%Y-%m-%d` || DATE=`date --date="-${ago} days" +%Y-%m-%d`; aws ec2 describe-instances --filter Name=instance-state-name,Values=stopped --query "Reservations[].Instances[?LaunchTime<='$DATE'][].{InstanceId: InstanceId,PrivateIpAddress: PrivateIpAddress,LaunchTime: LaunchTime}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/awslabs/aws-sdk-go/aws" | |
"github.com/awslabs/aws-sdk-go/aws/credentials" | |
"github.com/awslabs/aws-sdk-go/service/ec2" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:AuthorizeSecurityGroupEgress", | |
"ec2:AuthorizeSecurityGroupIngress", | |
"ec2:RevokeSecurityGroupEgress", | |
"ec2:RevokeSecurityGroupIngress" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" function sample | |
function TestFunction(a,b,c) | |
echo a:a | |
echo a:b | |
echo a:c | |
endfunction | |
" 引数の設定 | |
com -nargs=+ TestFunc call TestFunction(<f-args>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" insert map | |
imap <C-t> Helloworld!!<CR> | |
" normal map | |
nmap <C-f> :echo expand('%:p')<CR> | |
" visual map | |
vmap <C-e> :s/xxxx/homes/g<CR> | |
" commandline map | |
cmap <C-a> <Home> | |
cmap <C-e> <End> | |
cmap <C-f> <Right> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hoge | |
moge | |
fuga | |
bar | |
test | |
this is a pen | |
hoge = [Hoge] | |
moge = [Moge] |
NewerOlder