Skip to content

Instantly share code, notes, and snippets.

View git-command.memo
### Git command
# git pull時にマージされたローカルリポジトリを削除
$ git branch --merged | grep -vE '^\*|master$|develop$' | xargs -I % git branch -d %
# リモートブランチをローカルブランチにする
$ git ch -b adachin-develop origin/adachin-develop
# fetchやpullする際に自動的にリモートで削除されているリモートブランチを削除
$ git fetch --prune
View create-old-config_bigquery-to-mysql.sh
#!/bin/bash
#### Past log BigQuery to MySQL(Aurora) ####
set -e
help()
{
echo "
Type:
(例)このように指定してあげましょう! 201805 01 08 FILENAME
@RVIRUS0817
RVIRUS0817 / node
Last active May 22, 2018
/etc/init.d/
View node
#!/bin/bash
#chkconfig: 2345 85 15
#descpriction: node
#OS CentOS6
# source function library
. /etc/rc.d/init.d/functions
RETVAL=0
NODEPATH=/home/adachin/node
View create-old-config_s3-to-bigquery.sh
#!/bin/bash
#### Past log S3 to BigQuery ####
set -e
help()
{
echo "
Type:
(例)このように指定してあげましょう! 201805 01 08 FILENAME
View memo.sql
・dtテーブルの削除
mysql> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)
mysql> delete from daily_profile_views where dt='2018-05-30';
Query OK, 13031 rows affected (0.60 sec)
mysql> delete from daily_profile_views where dt LIKE '2018-%';
Query OK, 8843 rows affected, 1 warning (0.30 sec)
@RVIRUS0817
RVIRUS0817 / chatwork.go
Last active Apr 26, 2018
Vuls Chatwork support
View chatwork.go
// ChatWorkWriter定義。Writeメソッドを定義して、vuls report -to-chatworkを実行時に標準出力に加えてchatworkにもoutputするプログラム
package report
import (
"fmt"
"net/http"
"net/url"
"strconv"
"strings"
View check-phpoil_stopstart.sh
#!/bin/bash
PROCCESS=php
ALIVE=`pgrep -f "$PROCCESS" | wc -l`
echo "===check proccess php oil==="
pgrep -f php
echo "===check php oil ==="
if [ $ALIVE = 3 ]; then
View nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
worker_rlimit_nofile 150000;
@RVIRUS0817
RVIRUS0817 / hubot
Last active Jan 16, 2018
/etc/init.d/
View hubot
#!/bin/bash
#chkconfig: 2345 85 15
#descpriction: hubot
#OS Amazon Linux/CentOS6
# source function library
. /etc/rc.d/init.d/functions
USER=hubot
DIR=/home/hubot/hubot/
View vuls-auto.sh
#fetchnvd
echo -n $"fetchnvd: "
docker run --rm \
-v $PWD:/vuls \
-v $PWD/go-cve-dictionary-log:/var/log/vuls \
vuls/go-cve-dictionary fetchnvd -last2y
#fetchjvn
echo -n $"fetchjvn: "