View pin.cgi
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/perl | |
use strict; | |
use warnings; | |
use CGI; | |
use Net::Twitter; | |
my $cgi = new CGI; |
View mrtg.cfg
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
# indexmaker --columns=1 /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html | |
WorkDir: /var/www/mrtg | |
Target[eth0]: \eth0:private@localhost: | |
SetEnv[eth0]: MRTG_INT_IP="localhost" MRTG_INT_DESCR="eth0" | |
MaxBytes[eth0]: 125000000 | |
Options[eth0]: growright, bits | |
Title[eth0]: eth0 | |
PageTop[eth0]: <h1>eth0</h1> |
View cidfmap.local
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
/IPAGothic << /FileType /TrueType /Path (/usr/share/fonts/ipa-gothic/ipag.ttf) /CSI [(Japan1) 6] >> ; | |
/IPAMincho << /FileType /TrueType /Path (/usr/share/fonts/ipa-mincho/ipam.ttf) /CSI [(Japan1) 6] >> ; | |
/IPAPGothic << /FileType /TrueType /Path (/usr/share/fonts/ipa-pgothic/ipagp.ttf) /CSI [(Japan1) 6] >> ; | |
/IPAPMincho << /FileType /TrueType /Path (/usr/share/fonts/ipa-pmincho/ipamp.ttf) /CSI [(Japan1) 6] >> ; | |
/#82l#82r#20#83S#83V#83b#83N /IPAGothic ; | |
/#82l#82r#83S#83V#83b#83N /IPAGothic ; | |
/@#82l#82r#83S#83V#83b#83N /IPAGothic ; | |
/DFHSGothic-W5 /IPAGothic ; | |
/DFPHSGothic-W5 /IPAGothic ; |
View Mecab.cs
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.InteropServices; | |
namespace MecabWrapper | |
{ | |
public class Mecab | |
{ |
View gist:0ad19287e32d0cb514c7
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
sub udcr { | |
my ($X, $Y) = @_; | |
if (scalar(@{$X}) < 2 || scalar(@{$X}) != scalar(@{$Y})) { | |
return; | |
} | |
my $j = 0; | |
for (my $i = 1; $i < scalar(@{$X}); $i++) { | |
my $_x = $X->[$i] - $X->[$i - 1]; |
View wget_wrapper.pl
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/perl | |
# Wget のラッパー | |
# 任意の URL のページを画像込みで保存する | |
# $ wget_wrapper.pl Directory URL | |
# (Directory は URL ごとにユニークなものを指定する) | |
# | |
# .htaccess 設定例 | |
# AddType text/html .htmlwget | |
# DirectoryIndex index.htmlwget index.html index.htm |
View dbbackup.sh
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 | |
keepday=14 | |
dir=/home/dbbackup | |
file=dump.sql | |
now_date=`date +%Y%m%d` | |
old_date=`date "-d$keepday days ago" +%Y%m%d` | |
cd $dir |
View gist:3099041
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
# サーバに割り当てた任意の IP アドレスを利用する | |
# (本コードではランダムに選択) | |
use LWP::UserAgent (@LWP::Protocol::http::EXTRA_SOCK_OPTS); | |
# ランダムに IP を選択 | |
{ | |
my @IP = qw( | |
203.0.113.1 | |
203.0.113.2 |
View gist:4506257
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
use List::Util; | |
sub add_cloud_font_size { | |
my ($font_size_min, $font_size_max, $val_col, @lists) = @_; | |
if (scalar(@lists) == 0) { | |
return; | |
} | |
my $val_min = log(List::Util::min(map { $_->{$val_col} } @lists) + 1); | |
my $val_max = log(List::Util::max(map { $_->{$val_col} } @lists) + 1); |
View sign_test.pl
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
# Reference: | |
# http://aoki2.si.gunma-u.ac.jp/lecture/Average/sign-test.html | |
# http://kusuri-jouhou.com/statistics/fugou.html | |
use strict; | |
use warnings; | |
use List::Util; | |
my @sign = qw(1 0 1 1 -1 1 1 -1 1 1); |
OlderNewer