aws cloudformation create-stack --stack-name hogehoge --template-body file://conf.json --region ap-northeast-1 --parameters file://param.json
View README.md
View djangoeb.js
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "AWS CloudFormation Template: This template installs a single-instance with dev environment for elastic beanstalk as well as Jenkins server. This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.", | |
"Parameters" : { | |
"EC2Tag" : { | |
"Description" : "EC2 tag name", | |
"Type" : "String" | |
}, |
View script-books.sh
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/sh | |
#Lernu esperanton :-) | |
wget -nc http://www.oreilly.com/programming/free/files/microservices-for-java-developers.pdf | |
wget -nc http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.pdf | |
wget -nc http://www.oreilly.com/programming/free/files/object-oriented-vs-functional-programming.pdf | |
wget -nc http://www.oreilly.com/programming/free/files/java-the-legend.pdf | |
wget -nc http://www.oreilly.com/programming/free/files/a-whirlwind-tour-of-python.pdf | |
wget -nc http://www.oreilly.com/programming/free/files/hadoop-with-python.pdf | |
wget -nc http://www.oreilly.com/programming/free/files/how-to-make-mistakes-in-python.pdf |
View nginx_parser.py
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
from dateutil import parser | |
import datetime | |
# Tail from actual nginx access.log | |
from sys import stdin | |
lines = [ | |
'93.180.71.3 - - [17/May/2015:08:05:32 +0000] "GET /downloads/product_1 HTTP/1.1" 502 0 "-" "Debian APT-HTTP/1.3 (0.8.16~exp12ubuntu10.21)', | |
'93.180.71.3 - - [17/May/2015:08:05:23 +0000] "GET /downloads/product_1 HTTP/1.1" 304 0 "-" "Debian APT-HTTP/1.3 (0.8.16~exp12ubuntu10.21)', | |
'80.91.33.133 - - [17/May/2015:08:05:24 +0000] "GET /downloads/product_1 HTTP/1.1" 502 0 "-" "Debian APT-HTTP/1.3 (0.8.16~exp12ubuntu10.17)', | |
'217.168.17.5 - - [17/May/2015:08:05:34 +0000] "GET /downloads/product_1 HTTP/1.1" 200 490 "-" "Debian APT-HTTP/1.3 (0.8.10.3)', |
View open_hours.py
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
""" | |
Edge cases: | |
1. Empty hours hours = {} | |
2. Some days not having open/close hours or both {"close":{"day":0,"time":""},"open":{"day":0,"time":""}}, | |
3. Some stores might not have hours. | |
4. Some stores might have close hours and not open hours. | |
example: | |
isOpen('store_1') // open | |
isOpen('store_2') // closed |
View setup-kubernetes-ubuntu-16.md
Master: Dependencies
apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
View gist:c811d9f09caf7655d48f9556005fab5a
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
killall ssh-agent; eval `ssh-agent` |
View sshclient.go
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 ( | |
"bufio" | |
"io/ioutil" | |
"os/signal" | |
//"syscall" | |
"fmt" | |
"log" | |
"os" |
View glog
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/sh | |
git --no-pager log -n 20 --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative |
OlderNewer