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
# -*- coding: utf-8 -*- | |
# | |
# フィボナッチ数列 第30項を計算する関数に | |
# lru_cacheを使って関数の呼び出し回数を比較 | |
# | |
from functools import lru_cache | |
exec_counter = 0 |
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
# coding:utf-8 | |
from boto3.session import Session | |
import datetime | |
profiles = ['profile1', 'profile2'] | |
for profile in profiles: | |
session = Session(profile_name=profile) |
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 -u | |
echo "==============================================" | |
echo "Started : Create AMI for production Deploy" | |
echo "==============================================" | |
TAG_NAME='EC2_TAG_NAME_OF_INSTANCE' | |
echo "Target Instance : ${TAG_NAME}" |
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
javascript:(function() {var t = document.title;var l = location.href;prompt('chatwork link' ,'[info][title]' + t + '[/title]' + l + '[/info]');})(); |
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: '2' | |
services: | |
zabbix_db: | |
container_name: zabbix_db | |
image: mysql:5.7 | |
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci | |
volumes: | |
- zabbix_storage_db:/var/lib/mysql | |
- /etc/localtime:/etc/localtime:ro | |
ports: |
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
# -*- coding: utf-8 -*- | |
require 'feedlr' | |
Feedlr.configure do |config| | |
config.oauth_access_token = 'TOKEN' | |
end | |
client = Feedlr::Client.new | |
# p client.methods.sort - Object.methods |
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
console.clear(); | |
for(var i = 1; i <= 100; i++){ | |
console.log( | |
// confusing use of '!' | |
!(i % 15) && 'FizzBuzz' || | |
!(i % 5) && 'Buzz' || | |
!(i % 3) && 'Fizz' || | |
i | |
); | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
### プライベートIPの場合 | |
$ aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | .PrivateIpAddress + "\t" + .Tags[].Value' | |
192.0.2.1 aws1.example | |
192.0.2.2 aws2.example | |
192.0.2.3 aws3.example | |
192.0.2.4 aws4.example | |
192.0.2.5 aws5.example | |
192.0.2.6 aws6.example | |
192.0.2.7 aws7.example |
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
echo -n "Are you sure you want to exit the server? [y/n] > " | |
while : | |
do | |
read INPUT | |
case "$INPUT" in | |
"y" ) kill $SERVER_PID | |
echo "Stopped WEBRick" | |
break ;; | |
"n" ) echo "Canceled." | |
break ;; |
NewerOlder