Skip to content

Instantly share code, notes, and snippets.

View soh-i's full-sized avatar

Soh Ishiguro soh-i

View GitHub Profile
@soh-i
soh-i / gist:3022641
Last active October 6, 2015 16:38
ちょっと監視してた
#!/usr/bin/env perl
use strict;
use warnings;
my $name = {};
my @cmd = `last`;
for (reverse @cmd) {
next if $_ =~ /wtmp|^\s+/;
my ($user, undef, $from, $w, $m, $d, $t) = split /\s+/;
@soh-i
soh-i / gist:3023536
Created June 30, 2012 11:57
get UniProt ID from kegg orthology web page.
#!/usr/bin/env perl -w
use strict;
my $fh;
open $fh, '<', $ARGV[0];
while (my $line = <$fh> ) {
if ( $line =~ /www\.uniprot\.org\/uniprot\/(\w+)/){
print $1, "\n";
}
@soh-i
soh-i / gist:3023539
Last active October 6, 2015 16:48
Yeastgenome.orgから頑張ってUniprotIDに変換して配列とる
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::Simple;
my $file = './list';
open my $fh, '<', $file or die "$!";
open my $out, ">>", "get_seq.fa" or die "$!";
while (my $id=<$fh>) {
@soh-i
soh-i / gist:3023548
Created June 30, 2012 12:01
ヒストグラム書く
{ i=$1;
var[i]++
}
END{ for (i in var) {
print i, var[i] }
}
@soh-i
soh-i / gist:3026323
Created July 1, 2012 00:59
perltidy
(defun perltidy-region ()
"Run perltidy on the current region."
(interactive)
(save-excursion
(shell-command-on-region (point) (mark)"perltidy -q" nil t)))
(defun perltidy-defun()
"Run perltidy on the current defun."
(interactive)
(save-excursion (mark-defun)
(perltidy-region)))
tell application "System Events"
tell current location of network preferences
set VPNservice to service "VPN" -- name of the VPN service
if exists VPNservice then connect VPNservice
end tell
end tell
if ( -x `which zsh` ) then
exec zsh
else if ( -x `which tcsh` ) then
exec tcsh
endif
bindkey -e
# pager
export LESS='--LONG-PROMPT'
#allow tab completion in the middle of a word
setopt COMPLETE_IN_WORD
#keep background processes at full speed
setopt NOBGNICE
# Core size
limit coredumpsize 0
# restart running processes on exit
@soh-i
soh-i / gist:3048587
Created July 4, 2012 17:53
リン酸化部位とかUniProtのフラットファイルからとる
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
open my $fh, '<', $ARGV[0] or die;
local $/ = undef;
@soh-i
soh-i / gist:3052665
Created July 5, 2012 09:45
Newick形式を与え、生物種名で色分けされた系統樹をiTolで書く
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::Simple;
if ( scalar @ARGV != 1) {
die "Usage: perl $0 input.newick\n";
}