Skip to content

Instantly share code, notes, and snippets.

View ceekz's full-sized avatar

Mitsuo Yoshida ceekz

View GitHub Profile
@ceekz
ceekz / wget_wrapper.pl
Last active October 7, 2015 03:37
Wget Wrapper for a Web Page Cache
#!/usr/bin/perl
# Wget のラッパー
# 任意の URL のページを画像込みで保存する
# $ wget_wrapper.pl Directory URL
# (Directory は URL ごとにユニークなものを指定する)
#
# .htaccess 設定例
# AddType text/html .htmlwget
# DirectoryIndex index.htmlwget index.html index.htm
@ceekz
ceekz / dbbackup.sh
Last active October 7, 2015 03:37
Backup shell script for MySQL
#!/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
@ceekz
ceekz / gist:0ad19287e32d0cb514c7
Last active August 29, 2015 14:13
up/down concordance rate
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];
@ceekz
ceekz / Mecab.cs
Created September 15, 2014 06:54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MecabWrapper
{
public class Mecab
{
@ceekz
ceekz / mrtg.cfg
Last active August 29, 2015 14:05
# 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>
/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 ;
@ceekz
ceekz / pin.cgi
Created June 20, 2014 06:36
Create an access token from a consumer key in Twitter.
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use Net::Twitter;
my $cgi = new CGI;