Skip to content

Instantly share code, notes, and snippets.

@bokutin
bokutin / vcard_to_h_donya.pl
Created May 1, 2014 20:14
連絡先.app から ストラップフォン2 へ電話帳を転送します
#!/usr/bin/env perl
use utf8;
use Modern::Perl;
use Data::Dumper;
use Docopt;
use Encode;
use IO::All;
use Lingua::JA::Kana;
ADT+GDKで一通り揃う
https://developers.google.com/glass/develop/gdk/quick-start
サンプルは Compass, Stopwatch, Timer
githubにもある
https://github.com/googleglass
Google Glassで作る近未来アプリケーション
http://www.buildinsider.net/mobile/googleglass
@bokutin
bokutin / gist:9163058
Created February 22, 2014 21:57
FreeBSD shrinkfs がわりに・・・
VMWare Fusion内のFreeBSDを縮めたいのだが、できないので、小さい仮想ディスクを足して、そっちにコピー。
# gpart create -s GPT da1
# gpart add -s 128 -t freebsd-boot da1
# gpart add -s 1G -t freebsd-swap da1
# gpart add -t freebsd-ufs da1
# gpart bootcode -b /boot/pmbr da1
# gpart bootcode -p /boot/gptboot -i 1 da1
# newfs -j /dev/da1p3
# mount /dev/da1p3 /mnt2
@bokutin
bokutin / time_ll.pl
Last active August 29, 2015 13:56
for ( ; ; ) べんち
#!/usr/bin/env perl
# 参考にさせていただきました m(_ _)m
# http://akiniwa.hatenablog.jp/entry/2013/09/28/142947
#
# perl は for ( ; ; ) が遅いですよね!
use strict;
use feature ":5.10";
use Data::Section::Simple qw(get_data_section);
@bokutin
bokutin / openvpn gui tmp dir fails.txt
Last active August 29, 2015 13:56
OpenVPN Temporary directory (--tmp-dir) fails with ...
Options error: Temporary directory (--tmp-dir) fails with 'C:\Documents and Settings\日本語\Local Settings\Temp\': No such file or directory
などとなり、 OpenVPN GUI がうんともすんとも言わない場合がある。
Windows でユーザー名を変更しても Documents and Settings\日本語 のフォルダは変わらず維持されて、変えるのは大変だと思う。
(クリーンにやるには、ほぼ再インストール?)
.ovpn の設定ファイルの方に tmp-dir を足せば、環境変数のTMPDIRなどよりそちらが優先され、手元の環境では凌げた。
C:\Program Files\OpenVPN\temp を作っておいて
@bokutin
bokutin / bench_mason.pl
Created February 2, 2014 02:27
Mason1のanonymous componentで妄想するためのベンチ
#!/usr/bin/env perl
use sanity qw(sane);
use Benchmark ":all";
use Data::Dumper;
use Data::Format::Pretty::Perl qw(format_pretty);
use Data::Section::Simple qw(get_data_section);
use File::Path qw(make_path);
use File::Spec::Functions qw(rel2abs);
use HTML::Mason;
@bokutin
bokutin / compile_time.pl
Last active January 4, 2016 15:19
少し気になったLLのコンパイル所要時間
#!/usr/bin/env perl
use strict;
use feature ":5.10";
#my @dirs = qw(
# /usr/ports/games/sl
#);
my @dirs = qw(
/usr/ports/lang/lua
@bokutin
bokutin / raid-mpt
Last active December 31, 2015 18:29
Plugin to monitor RAID status for mpt-status
#!/usr/bin/perl -w
#
# (c) 2013 Tomohiro Hosaka bokutin@bokut.in
#
# Plugin to monitor RAID status for mpt-status
#
#
# (c) 2007 Nathan Rutman nathan@clusterfs.com
@bokutin
bokutin / gist:7366846
Created November 8, 2013 05:58
Validation script that could address the reference is reused in Perl
#!/usr/bin/env perl
package AAA;
sub new { bless {} }
package main;
my $obj = AAA->new;
@bokutin
bokutin / jCarousel.js
Last active December 22, 2015 03:38 — forked from nashiki/jCarousel.js
/*
* jCarousel - jQuery Plugin
* http://d.hatena.ne.jp/kudakurage/
*
* Copyright (c) 2010 Kazuyuki Motoyama
* Licensed under the MIT license
*
* $Date: 2010-11-28
* $version: 1.3
*