This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import base64 | |
import urllib | |
import hashlib | |
import hmac | |
import httplib | |
import urlparse |
This file contains hidden or 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 | |
set -x | |
set -e | |
VERSION=6.2 | |
cd /etc/yum.repos.d | |
cp CentOS-Base.repo{,.orig} | |
sed -i "s/\$releasever/${VERSION}/" CentOS-Base.repo |
This file contains hidden or 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
1 マス目に入る数字 | |
1: 50.973% | |
2: 25.739% | |
3: 12.432% | |
4: 6.030% | |
5: 2.806% | |
6: 1.173% | |
7: 0.504% | |
8: 0.212% | |
9: 0.087% |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
argparse の挙動が Python 2.x と Python 3.x で異なる件について | |
本家のチケット: http://bugs.python.org/issue16308 | |
''' | |
import argparse |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.define :node1, primary: true do |node1| | |
node1.vm.box = "centos7" | |
node1.vm.box_url = "https://github.com/holms/vagrant-centos7-box/releases/download/7.1.1503.001/CentOS-7.1.1503-x86_64-netboot.box" | |
node1.vm.network "private_network", ip: "192.168.33.11" | |
node1.vm.provider "virtualbox" do |vb| |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.define :node1, primary: true do |node1| | |
node1.vm.box = "centos7" | |
node1.vm.box_url = "https://github.com/holms/vagrant-centos7-box/releases/download/7.1.1503.001/CentOS-7.1.1503-x86_64-netboot.box" | |
node1.vm.network "private_network", ip: "192.168.33.11" | |
node1.vm.provider "virtualbox" do |vb| |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import importlib | |
import click | |
class ImportableType(click.ParamType): | |
''' Python のインポート可能なパスを受け取るための型 ''' |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
SECOND = {'microsecond': 0} | |
MINUTE = dict({'second': 0}, **SECOND) | |
HOUR = dict({'minute': 0}, **MINUTE) | |
DAY = dict({'hour': 0}, **HOUR) | |
MONTH = dict({'day': 0}, **DAY) |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import calendar | |
from datetime import datetime | |
from datetime import timedelta | |
_FIELD_NAMES = [ | |
'years', | |
'monthes', |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
import threading | |
import time | |
def spawn(function, *args, **kwargs): | |
thread = threading.Thread(target=function, args=args, kwargs=kwargs) |
OlderNewer