This file contains hidden or 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 | |
ARGS=$1; shift | |
MYSQL="mysql -uroot " | |
LIST_CONN_CMD=$(echo 'show all slaves status\G' | ${MYSQL} | grep 'Connection_name' | awk '{print $2}') | |
function show_seconds_behind_master () { | |
conn=$1; shift; | |
SECONDS=$(echo "show slave '${conn}' status\G" | ${MYSQL} | grep Seconds_Behind_Master | awk '{print $2}') |
This file contains hidden or 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
//転置インデックスを作成 | |
$comp_list_reverse = array(); | |
foreach ($comp_list as $key => $value) { | |
$hashed = md5($value); | |
$comp_list_reverse[$hashed] = $key; | |
} | |
$keyword_name_list_reverse = array(); | |
foreach ($keyword_name_list as $key => $value) { | |
$hashed = md5($value); | |
$keyword_name_list_reverse[$hashed] = $key; |
This file contains hidden or 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
<?php | |
define('UPDATE_WEBSITE_SH', '/path/to/update-website.sh'); | |
if (!(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/GitHub Hookshot/i', $_SERVER['HTTP_USER_AGENT']))) { | |
die(); | |
} | |
if (!file_exists(UPDATE_WEBSITE_SH)) { | |
die(); | |
} | |
if ( !isset($_POST['payload']) ) { |
This file contains hidden or 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
set ignorecase | |
set smartcase | |
set backspace=indent,eol,start | |
set startofline | |
set ruler | |
set confirm | |
set visualbell | |
set t_vb= | |
set mouse=a | |
set notimeout ttimeout ttimeoutlen=200 |
This file contains hidden or 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 calcDateFromDuration() { | |
var today = parseInt(new Date()/1000) | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheets = ["2F-12-18-1", "2F-12-18-2"] | |
for (var sheet_idx in sheets) { | |
//Browser.msgBox(sheet_idx); | |
var sheet = ss.getSheetByName(sheets[sheet_idx]) | |
var range = sheet.getRange("I2:I60") | |
var values = range.getValues() |
This file contains hidden or 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/env python | |
import sys | |
tmp = {} | |
for line in sys.stdin: | |
line = line.strip() | |
if line not in tmp: | |
tmp[line] = 0 | |
else: | |
tmp[line] += 1 |
This file contains hidden or 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
## apache 1.3.42 + mod_fastcgi + php-fpm(5.4) | |
LoadModule fastcgi_module libexec/mod_fastcgi.so | |
AddModule mod_fastcgi.c | |
## FastCGI | |
Alias /php5.fcgi /usr/bin/php-cgi | |
FastCGIConfig -initial-env -autoUpdate -idle-timeout 120 -killInterval 3600 -maxClassProcesses 3 -maxProcesses 15 | |
FastCGIExternalServer /usr/bin/php-cgi -socket /tmp/php-fpm.sock -pass-header Authorization | |
Action application/x-httpd-php /php5.fcgi | |
AddType application/x-httpd-php .php .php5 |
This file contains hidden or 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
[main] | |
cachedir=/var/cache/yum | |
debuglevel=2 | |
logfile=/var/log/yum.log | |
pkgpolicy=newest | |
distroverpkg=redhat-release | |
installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported | |
tolerant=1 | |
exactarch=1 | |
[base] |
This file contains hidden or 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/env python3 | |
# -*- encoding: utf8 -*- | |
from ipwhois import IPWhois | |
from IPy import IP | |
fobj = open("iplist.txt", 'r') | |
counter = {} | |
for line in fobj: | |
line = line.rstrip() |
This file contains hidden or 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
# Generated by iptables-save v1.4.7 on Thu Nov 21 12:27:09 2013 | |
*filter | |
:INPUT ACCEPT [1078:159417] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [753:164197] | |
:acctboth - [0:0] | |
:cP-Firewall-1-INPUT - [0:0] | |
-A INPUT -j cP-Firewall-1-INPUT | |
-A INPUT -j acctboth | |
-A FORWARD -j cP-Firewall-1-INPUT |
NewerOlder