Skip to content

Instantly share code, notes, and snippets.

View manuke's full-sized avatar

manuke manuke

View GitHub Profile
@manuke
manuke / bash
Last active February 26, 2024 18:25
bash
重複排除
/usr/bin/pgrep -f /usr/bin/emacs || echo "not duplicate emacs process"
http://qiita.com/rsooo/items/ef1d036bcc7282a66d7d
SCRIPT_DIR=$(cd $(dirname $(readlink -f $0 || echo $0));pwd -P)
cd $SCRIPT_DIR
#shell補完
@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パスワードは自動作成される
@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 / amazonlinux2
Last active June 4, 2020 08:02
amazonlinux2
linux 同一セグメント 複数ipの来たインターフェイスのIPから戻り設定
https://engineering.silk.co/post/31923247961/multiple-ip-addresses-on-amazon-ec2
https://qiita.com/fururun02/items/69d1ddac298b4ce48269
```
# tempraly
bash -c "echo '2 eth0_rt' >> /etc/iproute2/rt_tables"
ip rule add from 172.31.0.22 table eth0_rt
ip route add default via 172.31.0.1 dev eth0 table eth0_rt
@manuke
manuke / ElgetPackages
Last active May 15, 2020 00:55
emacs install&setting
cat << EOT >~/.emacs.d/ElgetPackages
(el-get-bundle auto-complete)
(el-get-bundle quickrun)
(el-get-bundle ag)
(el-get-bundle color-theme)
(el-get-bundle flymake)
(el-get-bundle highlight-symbol)
(el-get-bundle helm)
(el-get-bundle helm-ag)
@manuke
manuke / terraform.md
Last active May 8, 2020 09:14
terraform.md
https://milestone-of-se.nesuke.com/sv-advanced/appliance-server/load-balancer/
NLBは受けIPと戻りIPが違うアドレスとなる。
AWSのAWS-RunPatchBaselineはデフォルトだと、全てのpatchではない(securityもののみ?)
SSM単体でのポートフォワードが可能
@manuke
manuke / AWSChatbot.md
Created December 19, 2019 06:29
AWSChatbot

private channel

/invite @aws