Skip to content

Instantly share code, notes, and snippets.

@yseto
yseto / gist:3938690
Created October 23, 2012 13:19
skype log account sqlite file to html
#!/usr/bin/env perl
use DBIx::Simple;
use strict;
use warnings;
use utf8;
#
#C:\Users\Username\AppData\Roaming\Skype\Skype Account Name\main.db
#
my $html = <<HTML;
@yseto
yseto / chugoku-np.pl
Last active December 11, 2015 01:18
中国新聞のRSSを生成するスクリプト あんたぁ、中国新聞読みたいんじゃろう。じゃけどRSSがないけえ、生成するんよ。 記事を取得してRSSの中身に出すようにしました。
#!/usr/bin/env perl
#
# Copyright 2013 yseto
# Released under the MIT License - Please reuse change and share
#
use strict;
use warnings;
use utf8;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use LWP::UserAgent;
use DBIx::Custom;
use DBIx::Connector;
use Encode;
my $connector =
@yseto
yseto / gist:5205200
Created March 20, 2013 14:44
風が吹けば桶屋が儲からないようにするためのスクリプト
#!/usr/bin/env perl
use strict;
use warnings;
use 5.12.1;
use utf8;
use Email::Sender::Simple qw(sendmail);
use Email::Simple;
use Email::Simple::Creator;
use Data::Recursive::Encode;
use Encode;
@yseto
yseto / gist:5480299
Created April 29, 2013 08:09
timidityからm4aを作成する。
#!/bin/bash
if [ -f $1 ]; then
rm tmp.aac
OUTPUT=`basename $1 .mid`
timidity -Ow -o - $1 | avconv -i - -acodec aac -strict experimental -ab 128k tmp.aac
MP4Box -add tmp.aac $OUTPUT.m4a
rm tmp.aac
ls -l $OUTPUT.m4a
fi
@yseto
yseto / 0-geoip.patch
Last active October 5, 2015 01:36
h2o+mruby-geoip
diff --git CMakeLists.txt CMakeLists.txt
index 2f76264..7e6d920 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -346,6 +346,7 @@ IF (WITH_MRUBY)
TARGET_LINK_LIBRARIES(h2o
"${CMAKE_BINARY_DIR}/mruby/host/lib/libmruby.a"
"${CMAKE_BINARY_DIR}/mruby/host/mrbgems/mruby-onig-regexp/Onigmo-Onigmo-5.15.0/.libs/libonig.a"
+ "GeoIP"
"m")
class CountryDeniedViaGeoIP
@@geoip = nil
def call(env)
if @@geoip == nil
@@geoip = GeoIP.new("/usr/share/GeoIP/GeoIPCity.dat")
end
@@geoip.record_by_addr env["REMOTE_ADDR"]
ret = [399, {}, []]
if @@geoip.country_code != "JP"
ret = [403, {'content-type' => 'text/plain'}, [ "forbidden" ]]
#!/bin/bash
USER=
SERVERNAME=
SSHPORT=
HOST=$USER@$SERVERNAME
TUNNELPORT=
IDENTIFY=