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
class resize: | |
def __init__(self, input_image): | |
self.input_image = input_image | |
self.output_image = StringIO() | |
def resize_image(self, width=400, height=300, aspecto_width=4, aspect_height=3): | |
""" | |
resize image | |
:param self | |
:param width default=200px |
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
upstream some_app_server { | |
server 127.0.0.1:9393; | |
} | |
server { | |
listen 80; | |
server_name my-upload-endpoint.com ; | |
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
## vm 起動 | |
vagrant up | |
## vm 停止 | |
vagrant halt | |
## vm 休止 | |
vagrant suspend | |
## vm 削除 |
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
##### add apt key | |
## get ther key | |
http://nginx.org/keys/nginx_signing.key | |
## create key file | |
vi nginx_signing.key | |
## paste key content | |
↓ | |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v1.4.11 (FreeBSD) |
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 django import template | |
import re | |
register = template.Library() | |
@register.simple_tag | |
def youtube_embed(video): | |
YOUTUBE_REGEX = r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})' | |
def _get_id(video): |
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
Glyphicons | |
http://glyphicons.com/ | |
・基本的なCSSが入っているが、サイトに合わせてカスタマイズしないといけない。 | |
lessがついている | |
・用途に応じて選べるようにフォントファイルが分かれている | |
(レギュラー・ハーフ・ソーシャル・ファイルタイプ・・・) | |
・基本的なフォントセットは無料で使えるが、 | |
数が限られるので使うなら有料版を買っておいたほうがいい。 | |
一度買っておけば、未来永劫に渡り追加フォントのダウンロードがタダでできるらしい。 | |
・バイナリをダウンロードできるので自分でカスタムアイコンが作れる(.ai, .psd) |
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
##### repo ファイルを作成 | |
vi /etc/yum.repos.d/10gen.repo | |
## 以下を記述 | |
## 64bitOSの場合 | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 | |
enabled=1 | |
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
### bucket policy | |
{ | |
"Version": "2008-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadForGetBucketObjects", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, |
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
CentOS 5.8 | |
ある程度Linux環境に慣れている人を想定していますので、 | |
コマンドベースの説明中心です。 | |
##### Python のインストール | |
## yum でmakeに必要なツール類をインストールしておく | |
yum -y groupinstall 'Development Tools' | |
yum -y install openssl-devel* ncurses-devel* zlib*.x86_64 | |
yum -y install bzip2 bzip2-devel bzip2-libs | |
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
#============================================================================== | |
## | |
## ntp setup (Ubuntu) | |
## | |
#============================================================================== | |
##### install for ntp | |
apt-get install ntp | |
##### disallow UTC | |
vi /etc/default/rcS |
OlderNewer