Skip to content

Instantly share code, notes, and snippets.

Jenkins × PHP環境構築の巻
■目的
PHP環境に対応したJenkins設定を行い、
コミットされる度にサーバ上でのPHPUnitの実行 及び
カバレッジレポート出力を"全自動"で行えるようにすること。
1) PHP Pear系のインストール
sudo pear channel-discover pear.phing.info
sudo pear channel-discover pear.pdepend.org
@masayuki5160
masayuki5160 / mapper.rb
Created July 23, 2013 00:53
Hadoop streaming用のmapper アクセスログからリファラーとかきりだし。
#!/usr/bin/ruby
# アクセスログ解析用 mapper
accessLog = Hash.new
tmpLink = Array.new
tmpReferer = Array.new
#アクセスログを分割してReducerに渡す形式にする
ARGF.each do |log|
@masayuki5160
masayuki5160 / reducer.rb
Created July 23, 2013 00:55
Hadoop streaming用のreducer。 リファラーとかがshuffleされてわたされるのでカウントするだけ。 key,value -> 'リンク元', 'リンク先' でやってます。 この使い方でいいのかよくわからんけどw
#!/usr/bin/ruby
access = Hash.new
pre_referer = nil
pre_link = nil
count = 1
ARGF.each do |log|
log.chomp!
@masayuki5160
masayuki5160 / Test.java
Last active December 21, 2015 08:59
参考サイトのまんま。 JavaScriptのクリックイベントまでしてくれる。 まだよくわかってないけど参考になるソースなのでメモ。 http://blog.asial.co.jp/1180
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Test {
public static void main(String[] args) {
RemoteWebDriver driver = new FirefoxDriver();
driver.get("http://www.asial.co.jp");
@masayuki5160
masayuki5160 / gist:6314345
Created August 23, 2013 00:33
CLIからSELECTたたくときめも。 よくわすれるからw
SELECT * FROM slow_log WHERE start_time >= '2100-12-22 17:36:00' LIMIT 20 \G
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Test {
public static void main(String[] args) {
//UAの設定を行う
FirefoxProfile profile = new FirefoxProfile();
use Net::OpenSSH;
my $host = "hostname";
# ログイン認証
my $ssh = Net::OpenSSH->new(
$host,
(
user => 'username',
password => 'pass',
@masayuki5160
masayuki5160 / rowNum.sql
Created September 12, 2013 06:17
行番号をだすとき
SELECT @i:=@i+1 as rownum,`USER_ID` FROM (select @i:=0) as dummy,`USER_TBL`
use Net::OpenSSH;
use strict;
use warnings;
my $host = "hostname";
# ログイン認証
my $ssh = Net::OpenSSH->new(
$host,
(
@masayuki5160
masayuki5160 / login.sh
Created September 14, 2013 08:46
ログイン用のシェル
#!/bin/sh
USER="masayuki"
HOST="192.168.10.10"
PASS="pass"
expect -c "
set timeout 10
spawn ssh $USER@$HOST
expect \"Are you sure you want to continue connecting (yes/no)?\" {