Skip to content

Instantly share code, notes, and snippets.

View ginokent's full-sized avatar
🏠
Working from home

ginokent ginokent

🏠
Working from home
View GitHub Profile
@ginokent
ginokent / my_filter_list.md
Last active April 28, 2019 08:08
Adblock Plus 詳細設定 chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/options.html

URL

chrome-extension://cfhdojbkjhnklbpkdaibdccddilifddb/options.html

マイ フィルターリスト

nicovideo.jp##.MarqueeContainer
@ginokent
ginokent / 7requests_per_second.sh
Created January 23, 2019 03:39
秒間7リクエスト送りたい
PARALLEL=7
TARGET=http://127.0.0.1:8080/
N=$(seq 1 ${PARALLEL:?}) && while :; do printf "${TARGET:?}\n%.s" ${N} | xargs -P"${PARALLEL:?}" -I{} curl -sS {} -o /dev/null -w "response_code:%{response_code}\ttime_total:%{time_total}\n"; done | tee /tmp/loadtest_$(date +%Y%m%d_%H%M%S).log
grep "^\[profile" ~/.aws/config | sed 's/\[profile \(.*\)\].*/\1/' | while read LINE; do aws --profile $LINE ec2 describe-instances | jq '.Reservations[].Instances[].PublicDnsName' | jq -s '{ "'$LINE'": . }'; done
// ==UserScript==
// @name notranslate
// @namespace https://gist.github.com/djeeno/50292ffaef9f6deb952a4aed8b625a67
// @version 0.1
// @description notranslate
// @author djeeno
// @match *
// @grant none
// ==/UserScript==
@ginokent
ginokent / tcpdump.sh
Last active March 18, 2019 03:37
21分(1260秒)でキャプチャを終了する
sudo tcpdump -W1 -G1260 -w "$(uname -n)_%Y%m%dT%H%M%S.pcap"
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAccountAccess",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::000000000000:root",
"arn:aws:iam::999999999999:root"
@ginokent
ginokent / GIT_SSH_COMMAND.sh
Created March 11, 2019 00:54
環境変数 GIT_SSH_COMMAND
export GIT_SSH_COMMAND="ssh -i ~/.ssh/djeeno.pem -F /dev/null"
@ginokent
ginokent / difff.sh
Last active March 16, 2019 01:01
color diff
difff() {(R=$(printf '\e[31m');G=$(printf '\e[32m');B=$(printf '\e[36m');W=$(printf '\e[1m');N=$(printf '\e[0m');diff -u "$@"|sed $(uname -s|grep -q '^Darwin'&&printf -- -E||printf -- -r) "s/(^@@.+@@|@@.+@@$)/$B\1$N/g;s/(^\+.*)$/$G\1$N/g;s/(^\-.*)$/$R\1$N/g;s/^[^\+\-]*((\+{3}|-{3}) [^ ].*)/$W\1/g;")}
@ginokent
ginokent / aws-boto3-profile.py
Last active March 14, 2019 01:40
boto3 で profile 名を指定して new client
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from boto3.session import Session
session = Session(profile_name='YOUR_AWS_PROFILE_NAME')
ec2 = session.client('ec2')
ec2.describe_instances()
@ginokent
ginokent / s3-delete-bucket.py
Last active March 14, 2019 01:46
バージョニングが有効化されている S3 バケットの削除
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import boto3
from boto3.session import Session
boto3.set_stream_logger()
session = Session(profile_name='YOUR_AWS_PROFILE_NAME')
s3 = session.resource('s3')