Skip to content

Instantly share code, notes, and snippets.

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

Minoru KAWAMOTO k12u

🏠
Working from home
View GitHub Profile
@k12u
k12u / gist:1162161
Created August 22, 2011 11:20
ログインセッションの SSH_AUTH_SOCKを 取得する (macのcrontabからssh)
$ ps -ef -E |grep ssh-a[g]ent | perl -lne 'm/SSH_AUTH_SOCK=([^ ]+)/;print $1'
/tmp/launch-aaaaaa/Listeners
@k12u
k12u / term.txt
Created August 10, 2011 05:02
mysql: 意外な挙動
mysql> show create table m\G
*************************** 1. row ***************************
Table: m
Create Table: CREATE TABLE `m` (
`id` int(11) NOT NULL,
`status` varchar(64) DEFAULT NULL,
`value` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
@k12u
k12u / list_branch
Created August 9, 2011 12:06
svn ls helper
#!/usr/bin/perl
use strict;
#use warnings;
use Getopt::Std;
my $svn_info = `svn info|grep URL`;
die "not http repository: $svn_info" unless $svn_info =~ /^URL: https?.+$/sm;
die "trunk/branches directory not found in svn info: $svn_info" unless $svn_info =~ m#^URL: https?.+/(branches|tags|trunk)#sm;
@k12u
k12u / make_branch
Created August 9, 2011 12:06
svn copy helper
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
my %opts;
Getopt::Std::getopts('b:t:', \%opts);
@k12u
k12u / switch_branch
Created August 9, 2011 12:05
svn switch helper
#!/usr/bin/perl
use strict;
#use warnings;
use Getopt::Std;
my $svn_info = `svn info|grep URL`;
die "not http repository: $svn_info" unless $svn_info =~ /^URL: https?.+$/sm;
die "trunk/branches directory not found in svn info: $svn_info" unless $svn_info =~ m#^URL: https?.+/(branches|tags|trunk)#sm;