Skip to content

Instantly share code, notes, and snippets.

@GitSumito
GitSumito / file0.txt
Last active May 18, 2018 11:42
一歩先のDBやserverへ接続する ref: https://qiita.com/S-T/items/1ab8537ad08d0100e94d
ssh -f -N -L 13306:dbserver:3306 gatewayユーザー名@bastion
@GitSumito
GitSumito / file0.txt
Created April 12, 2018 09:43
MySQLのちゃんとしたサンプルデータ ref: https://qiita.com/S-T/items/923cf689ee5f44525457
# unzip world.sql.zip
# mysql -uroot -p < world.sql
vi README.md
@GitSumito
GitSumito / file0.txt
Created April 4, 2018 07:48
AWSセキュリティグループ設定をコマンド(aws-cli)でやる ref: https://qiita.com/S-T/items/3d4197bbed1022ccac43
VpcId="vpc-12345678"
NewGroup="application.stg.sg"
aws ec2 create-security-group --group-name ${NewGroup} --description "${NewGroup}" --vpc-id ${VpcId} --description "${NewGroup}" > create-security-group
@GitSumito
GitSumito / file0.txt
Last active March 29, 2018 06:25
dockerで稼働するredashのトラブルと対策 ref: https://qiita.com/S-T/items/bee0ae9c8c0acbd940cc
worker:
image: redash/redash:latest
command: scheduler
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
QUEUES: "queries,scheduled_queries,celery"
WORKERS_COUNT: 1
@GitSumito
GitSumito / file0.txt
Created March 22, 2018 02:08
dockerコンテナ一個一個のリソースを確認する ref: https://qiita.com/S-T/items/d5a43076a51f5814ee32
wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop
chmod +x /usr/local/bin/ctop
@GitSumito
GitSumito / file0.txt
Created February 14, 2018 05:39
source codeの追い方 -なぜlessコマンドはバイナリファイルを読めるのか- ref: https://qiita.com/S-T/items/afc356255c3c01beefaa
[root@tkd003 tmp]# which less
/usr/bin/less
@GitSumito
GitSumito / file0.txt
Last active January 26, 2018 06:17
scpでPermission deniedになるファイルを無理やり転送する ref: https://qiita.com/S-T/items/fc9f34da43d6e80ad501
$ scp TargetServer:/tmp/sample /tmp/sample
scp: /tmp/sample: Permission denied
$
@GitSumito
GitSumito / file0.txt
Last active April 30, 2020 04:48
ssh/scp多段接続〜踏み台サーバを越えて〜 ref: https://qiita.com/S-T/items/18af2bfcc4e5a72202da
scp -r -o "ProxyCommand ssh -i ~/.ssh/key ユーザー@踏み台 -W %h:%p" testdir ユーザー@送信先:/tmp/.
もしくは
scp -r -o "ProxyCommand ssh -i ~/.ssh/key ユーザー@踏み台 nc %h %p" testdir ユーザー@送信先:/tmp/.
@GitSumito
GitSumito / BITHUMB_JPY_BTC.sh
Last active February 7, 2018 01:46
ビットコインでアービトラージを稼げるのか ref: https://qiita.com/S-T/items/f454c2668c6805e690e4
#!/bin/sh
TABLE=BITHUMB_JPY_BTC
ORIGINALPRICE=`curl -s https://api.bithumb.com/public/ticker/BTC | jq -r '.data.buy_price'`
RATE=`curl -s http://api.aoikujira.com/kawase/json/krw | jq -r '.JPY'`
PRICE=`echo "scale=0 ; $ORIGINALPRICE * $RATE" | /usr/bin/bc`
echo "insert into $TABLE(price) values(${PRICE%.*});" > sql/$TABLE.sql;