Skip to content

Instantly share code, notes, and snippets.

View manuke's full-sized avatar

manuke manuke

View GitHub Profile
@manuke
manuke / memo.md
Last active October 19, 2023 09:01

lambda logs

aws logs filter-log-events --log-group-name /aws/lambda/XXX --start-time `date -d '2022-06-20 06:30' '+%s%3N'` --end-time `date -d '2022-06-20 07:00' '+%s%3N'` --profile=XXX >testlog.json`

jq -r '.events[].message' testlog.json >testlog.log

grep GET testlog.log |  awk '{print $NF, $4, $7,$12}'  | sort -n | tail -1000 | awk '{print $2, $1, $3, $4}' | sort | cut -b 2-

aws lambda invoke /dev/stdout --function-name=Lambda-dev --profile=prof --region=ap-northeast-1 --cli-binary-format raw-in-base64-out  --payload '{"abc":"XXX"}' 
@manuke
manuke / m1pro install.md
Last active November 18, 2021 13:06
m1pro install.md
command line tools for xcode
brew



前の入力ソースを選択で ALT + `
ドラッグを有効にする、ドラッグロックなし
windows風のキー操作
@manuke
manuke / directconnect
Created March 29, 2021 05:57
directconnect
Direct Connect
0. 仮想プライベートゲートウェイ作成
prd_directconnect
1. 接続
orderingを承認する
2. 引き続き接続から仮想インターフェースを作成
/30のネットマスク、BGPパスワードは自動作成される
https://milestone-of-se.nesuke.com/sv-advanced/appliance-server/load-balancer/
NLBは受けIPと戻りIPが違うアドレスとなる。
AWSのAWS-RunPatchBaselineはデフォルトだと、全てのpatchではない(securityもののみ?)
SSM単体でのポートフォワードが可能
@manuke
manuke / server bmc
Last active September 18, 2020 04:04
OSSを使用したExpressサーバの運用管理
(Linux環境)
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=2ahUKEwinyuH-t93oAhWaHXAKHaGoCysQFjAAegQIARAB&url=https%3A%2F%2Fwww.support.nec.co.jp%2FDownLoad.aspx%3Ffile%3DServerManagement_on_Linux_OSS_WhitePaper_2.0.pdf%26id%3D3140103778&usg=AOvVaw3irDp6au1t8ACeX6vjNeDN
ipmitool sel list
/var/crash/以下に kernel crash dumpが出ているかもしれない。
ipmitool fru print
@manuke
manuke / AWSChatbot.md
Created December 19, 2019 06:29
AWSChatbot

private channel

/invite @aws

@manuke
manuke / mysql
Last active December 17, 2019 07:03
mysql
# デフォルトは大文字小文字の区別をしない
http://daybydaypg.com/2017/08/12/post-227/
# delete後の不要領域回収
https://aws.amazon.com/jp/premiumsupport/knowledge-center/rds-mysql-storage-optimization/
# tablechecksum
pt-table-checksum h=192.168.10.9,u=percona,p='',P=3306 --no-check-binlog-format --no-check-replication-filter --databases ch,twilio
# slaveをmasterから発見する
@manuke
manuke / log
Created September 12, 2019 02:43
log
grep ' ms' postgresql.log | gawk '{print $(NF -1);}' | sort -n
grep '"GET index.php' access_log | gawk '{print $4 " " $NF/1000000;}'
@manuke
manuke / nginx
Last active July 2, 2019 03:28
nginx
http://innossh.hatenablog.com/entry/2017/08/22/223300
https://qiita.com/weakboson/items/cc3945dad1b0bff7edc7
https://shun0750.tumblr.com/post/99232215318/nginx-lua%E3%81%A7%E7%9B%AE%E6%8C%87%E3%81%99%E3%83%AA%E3%83%83%E3%83%81%E3%81%A7%E9%AB%98%E9%80%9F%E3%81%AAweb%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC
@manuke
manuke / terraform.md
Last active May 8, 2020 09:14
terraform.md