Skip to content

Instantly share code, notes, and snippets.

@koheyamada
koheyamada / コマンド
Last active February 15, 2016 02:56
利用しているRedmineのバージョンを確認する。 ref: http://qiita.com/kooohei/items/ffa1a0cdadd03bd8a6d5
$ cat lib/redmine/version.rb
require 'rexml/document'
module Redmine
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
TINY = 0
@koheyamada
koheyamada / DB作成
Last active March 8, 2016 02:39
vnstatで手軽にtrafiicをモニタリング ref: http://qiita.com/kooohei/items/d4b29be4541cec5018c6
$ vnstat -u -i eth0
Error: Unable to read database "/var/lib/vnstat/eth0".
Info: -> A new database has been created.
@koheyamada
koheyamada / オプション-c
Last active February 22, 2016 06:58
lsofを使ってプロセスが利用しているポートを確認する。 ref: http://qiita.com/kooohei/items/9e3859e3d1d854c3d163
# lsof -c nginx
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 27576 root cwd DIR 202,1 4096 272412 /etc/nginx/conf.d
nginx 27576 root rtd DIR 202,1 4096 2 /
nginx 27576 root txt REG 202,1 964976 18099 /usr/sbin/nginx
nginx 27576 root DEL REG 0,4 3025922 /dev/zero
nginx 27576 root mem REG 202,1 22096 272808 /usr/lib64/perl5/vendor_perl/auto/nginx/nginx.so
nginx 27576 root mem REG 202,1 62864 3764 /lib64/libnss_files-2.17.so
nginx 27576 root mem REG 202,1 10856 6562 /usr/lib64/libXau.so.6.0.0
nginx 27576 root mem REG 202,1 126288 3886 /usr/lib64/libselinux.so.1
$ docker -D info
DEBU[0000] Trusting certs with subjects: [010
U
kohei]
Containers: 2
Images: 10
Server Version: 1.9.0
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
@koheyamada
koheyamada / -lオプション
Last active April 7, 2016 13:01
auditについてインストールと簡単な利用方法のメモ。 ref: http://qiita.com/kooohei/items/a802af9073dbeec6823e
$ sudo auditctl -l
LIST_RULES: exit,always arch=3221225534 (0xc000003e) watch=/etc/resolv.conf syscall=open
@koheyamada
koheyamada / コマンド
Last active March 24, 2016 01:36
aws-cliのバージョンをアップグレードする。Mac OS ref: http://qiita.com/kooohei/items/d14d248ea2c9bd8f173e
$ aws --version
aws-cli/1.10.6 Python/2.7.10 Darwin/15.3.0 botocore/1.3.28
@koheyamada
koheyamada / DockerHubへpush
Last active March 28, 2016 03:49
Dockerコンテナのリポジトリ管理 DockerHubへログイン、イメージの取得〜更新、コミットまで。 ref: http://qiita.com/kooohei/items/1e007fe650c6aa7eaac4
$ docker push kohei/httpd:ver1.0
The push refers to a repository [docker.io/kohei/httpd] (len: 1)
02607c25ed22: Pushed
4cf71c080937: Image already exists
e87afdecef01: Image already exists
13bab7291cec: Image already exists
d3bf674be7aa: Image already exists
ver1.0: digest: sha256:fb10c3626b1fc732c314efc132a29f7ee37c52176547a076c72553a97eaee949 size: 9116
@koheyamada
koheyamada / GetCallerIdentity
Last active April 11, 2016 05:00
AWS CLIでAWS Account IDを取得する。 ref: http://qiita.com/kooohei/items/2a8a09e5f36bac614879
$ aws sts get-caller-identity
{
"Account": "123456789012",
"UserId": "AIDA*****************",
"Arn": "arn:aws:iam::123456789012:user/kohei"
}
@koheyamada
koheyamada / .s3cfg作成
Last active April 19, 2016 03:57
s3cmdをインストールしてIDCFクラウドのオブジェクトストレージにバケットを作成する。 ref: http://qiita.com/kooohei/items/e1b35793675d52edfec0
$ s3cmd --configure
Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.
Access key and Secret key are your identifiers for Amazon S3
Access Key: ********************
Secret Key: ****************************************
Encryption password is used to protect your files from reading
@koheyamada
koheyamada / WhitelistHeaders
Created April 14, 2016 08:53
CloudFrontを導入してもUser-agentの値は書き換えられないようにする方法。 ref: http://qiita.com/kooohei/items/4dcdb506745a6a1eef66
CloudFront-Is-Desktop-Viewer
CloudFront-Is-Mobile-Viewer
CloudFront-Is-SmartTV-Viewer
CloudFront-Is-Tablet-Viewer