This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pck() { FIRST_LETTER=`echo $1 | cut -b1`; REST_LETTER=`echo $1 | cut -b2-`; PS_ARG='['$FIRST_LETTER']'$REST_LETTER; ps aux | grep $PS_ARG; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FIRST_NODE=$1 | |
SECOND_NODE=$2 | |
FILEPATH=$3 | |
SBS=$4 | |
if [ "${SBS}" == '-y' ]; | |
then | |
sudo -u spacyz ssh ${FIRST_NODE} cat ${FILEPATH} | sudo -u spacyz ssh ${SECOND_NODE} diff -y ${FILEPATH} - | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! ruby -Ku | |
# -*- mode:ruby; coding:utf-8 -*- | |
$KCODE='u' | |
require 'jcode' | |
# ToDo | |
# ---------------------------------------------------------------------- | |
# ファイルを変数に。複数に。 | |
# 入力値のバリデーション |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################################################## | |
# | |
# Script Name: | |
# makeUsersOnMacOSX.sh | |
# | |
# Project: | |
# Miscellaneous | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# = 1 ]; | |
then | |
Key_Name="$1" | |
if [ ${Key_Name} == 'key1' ]; then | |
export EC2_CERT=/path/to/your/key1/cert/key1.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/path/to/your/shell | |
if [ $# = 4 ]; | |
then | |
# 変数の設定 | |
MyUSER=$1 | |
MyPASSWORD=$2 | |
ENGINE=$3 | |
DATABASE=$4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# | |
# Script Name: | |
# backup_macosx_important_data | |
# | |
# Project: | |
# Miscellaneous | |
# | |
# Execute User: any user you want | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
Date="$1" | |
# アクセス元 IP アドレスの数 | |
cut -d ' ' -f 1 access_log-${Date} | sort | uniq -c | sort -nr > RANK/ip-rank-${Date}.txt | |
sed 's/^ *//' RANK/ip-rank-${Date}.txt | sed 's/ /,/' > CSV/ip-rank-${Date}.csv | |
# IP アドレスの名前解決 | |
sed 's/ */ /' RANK/ip-rank-${Date}.txt | cut -d ' ' -f 3 > TEMP/only-ip-address-${Date}.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
open('./tmpUu.txt') { |file| | |
file.each { |line| | |
start_idx = line.index('ids') + 4 | |
ids_len = 31 | |
end_idx = start_idx + ids_len |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
targetIp="$1" | |
Date="$2" | |
# ある IP アドレスのユーザーがどういう順序でアクセスをしているか解析 | |
grep ${targetIp} access_log-${Date} | less | cut -d ' ' -f 7 | |
exit 0 |