Skip to content

Instantly share code, notes, and snippets.

View mamemomonga's full-sized avatar
🏠
Working from home

Shotaro Takahashi mamemomonga

🏠
Working from home
View GitHub Profile
@mamemomonga
mamemomonga / itunes_getinfo.pl
Created August 22, 2012 04:32
iTunesLibraryからRatingなどを一括抽出し、library.ymlに保存
#!/usr/bin/env perl
# iTunesLibraryからRatingなどを一括抽出し、library.ymlに保存。
# Windows用 Perl 5.10.1 cygwin
use 5.10.0;
use strict;
use warnings;
use utf8;
use Win32::OLE;
use Win32::OLE::Variant;
use Encode;
@mamemomonga
mamemomonga / itunes_setinfo.pl
Created August 22, 2012 04:33
library.ymlからArtist Album Name TrackNumberをキーにしてiTunesLibraryを設定する
#!/usr/bin/env perl
# library.ymlからArtist Album Name TrackNumberをキーにしてiTunesLibraryの
# Rating PlayedCount DateAdded DateAdded PlayedDate を設定する。
# Windows用 Perl 5.10.1 cygwin
use 5.10.0;
use strict;
use warnings;
use utf8;
use Win32::OLE;
use Win32::OLE::Variant;
@mamemomonga
mamemomonga / uutrans.pl
Last active December 14, 2015 09:09
uuencodeしてターミナル経由でファイルを送信する。送信元はOSX専用。
#!/usr/bin/env perl
#
# uuencodeしてターミナル経由でファイルを送信する。
# $ uutrans.pl hoge.jpg
# を実行するとクリップボードにデータがコピーされるので、送信先で
# $ perl
# を実行してペーストすると、そこにデータが保存される。
#
# 参考: http://blog.livedoor.jp/dankogai/archives/50683970.html
@mamemomonga
mamemomonga / scrnssh.pl
Last active December 14, 2015 09:09
gnu screenを使用しているときに、別のウィンドウでssh接続。
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
binmode(STDIN,':utf8');
binmode(STDOUT,':utf8');
if($#ARGV==-1) {
print "USAGE: $0 [title] [ssh command]\n";
print " $0 [ssh command])\n";
@mamemomonga
mamemomonga / random_passwords.pl
Created March 1, 2013 09:09
ランダムなパスワードを30個作る。間違えやすい文字を除外して作る。
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Math::Random::MT;
sub random_password {
my $len=shift || 10;
my $gen=Math::Random::MT->new();
@mamemomonga
mamemomonga / create_localized_dir.pl
Created July 9, 2013 02:58
OSX用 日本語ローカライズされたディレクトリを作成
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
binmode(STDIN,':utf8');
binmode(STDOUT,':utf8');
use File::Path;
# 参考
# http://msyk.net/macos/jaguar-localize/
@mamemomonga
mamemomonga / ExponentialEndlessSummer.js
Last active December 20, 2015 06:59
ExponentialEndlessSummer.js for Reblog Machine
// vim:set fenc=utf-8 ff=unix ft=javascript:
/**
* @preserve
* ExponentialEndlessSummer.js for Reblog Machine
* https://gist.github.com/mamemomonga/6090387
* from "Exponential Endless Summer 2014" by saitamanodoruji
* http://tumblr.g.hatena.ne.jp/saitamanodoruji/20140831/1409496698
*/
'use strict';
@mamemomonga
mamemomonga / hello_cygwin64perl.cmd
Last active December 21, 2015 05:18
Windows7 x64 バッチファイルからcygwin64 PerlでHello World!
@echo off
rem ---------------------------------------------------------------------------
rem Windows7 x64 バッチファイルからcygwin64 PerlでHello World!
rem Shift_JIS(cp932)で保存すること
rem ---------------------------------------------------------------------------
set OPATH=%PATH%
set PATH=C:\cygwin64\bin;%PATH%
for /F "usebackq" %%s in (`cygpath -u %0`) do SET UPATH=%%s
perl -x -S %UPATH% %*
@mamemomonga
mamemomonga / hello_activeperl.cmd
Last active December 21, 2015 05:18
Windows7 x64 バッチファイルからActive Perl(64bit)でHello World!
@echo off
rem ---------------------------------------------------------------------------
rem Windows7 x64 バッチファイルからActive Perl(64bit)でHello World!
rem Shift_JIS(cp932)で保存すること
rem ---------------------------------------------------------------------------
set OPATH=%PATH%
set PATH=C:\Perl64\bin;%PATH%
perl -x -S %0 %*
goto endofperl
@rem ';