This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# 長さと分割数から範囲のリストを生成します | |
# | |
# 例: 長さ100を5区間に | |
# $ range.pl 100 5 | |
# 1 0 19 │ | |
# 2 20 39 │ | |
# 3 40 59 │ | |
# 4 60 79 │ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# 指定時間間隔で任意コマンドを繰り返し実行する(コマンド実行時間が次の周期にさしかかった場合はスキップする) | |
use strict; | |
use warnings; | |
use POSIX ":sys_wait_h"; | |
my $interval = shift @ARGV; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use YAML; | |
use File::Basename 'basename', 'dirname'; | |
sub usage { | |
my $script = basename $0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package A; | |
use strict; | |
use warnings; | |
#use fields(); | |
sub new { | |
my $class = shift; | |
my $self = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'echo-sd --center "PlayStation®VR発売まで" "あと$((($(gdate +%s -d '\''2016-10-13'\'') - $(gdate +%s))/(60*60*24)))日!"' | tee -a $(for f in ~/.zprofile ~/.bash_profile ~/.profile ;[ -e $f ] && echo $f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# リポジトリ一覧 | |
yum repolist all | |
# リポジトリ無効 | |
yum-config-manager --disable $REPOS | |
# 一時的にリポジトリを利用する | |
yum --enablerepo $REPOS install $PACKAGE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -oo 20 $FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkfifo response; cat response | wsta ws://echo.websocket.org | tee /dev/tty | mybotscript | tee response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 時間ごと集計 | |
seq 10 | awk '{t=$1} t0&&t!=t0{print t0,a; a=0} {a++;t0=t}' |