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/env perl | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use ExtUtils::Installed; | |
use List::Util; | |
my %options = (); | |
GetOptions( |
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/env perl | |
use strict; | |
use warnings; | |
use IPC::Shareable; | |
use Parallel::ForkManager; | |
my $process_num = 4; | |
my $handle = tie( my %result, 'IPC::Shareable', undef, { destroy => 1 } ); |
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/sh | |
CMDNAME=`basename $0` | |
while getopts n OPT | |
do | |
case $OPT in | |
"n" ) DRY_RUN="--dry-run" ;; | |
* ) echo "Usage: $CMDNAME [-n]" 1>&2 | |
exit 1 ;; |
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 | |
PERL_VERSION="5.14.2" | |
if [[ `whoami` != "root" ]]; then | |
echo "[ERROR] Must be done as root." | |
exit 1 | |
fi | |
echo "[INFO] Change environment variable HOME." `date` |
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
# functions | |
declare -i OK=0 | |
declare -i FAIL=1 | |
[ -n "$LOG_LEVEL" ] || declare -i LOG_LEVEL=3 | |
[ -n "$DATE_FORMAT" ] || DATE_FORMAT="%x %T" | |
[ -n "$LOG_FILE" ] || LOG_FILE="progress.log" | |
logger_fatal() { |
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
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm | |
/usr/bin/yum install -y zabbix20-server-mysql zabbix20-web-mysql mysql-server | |
/sbin/chkconfig zabbix-server on | |
/sbin/chkconfig mysqld on | |
MYSQL_ROOT_PASSWORD='ADMNPASS' | |
MYSQL_ZBBX_PASSWORD='ZBBXPASS' | |
/usr/bin/mysqladmin -u root create zabbix --default-character-set=utf8 | |
echo "GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY '${MYSQL_ZBBX_PASSWORD}';FLUSH PRIVILEGES;" | mysql -u root |
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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 4.0.0.beta', github: 'rails/rails' | |
gem 'sqlite3' | |
# Gems used only for assets and not required | |
# in production environments by default. | |
group :assets do |
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/env perl | |
package MooSample; | |
use Moo; | |
use MooX::Types::MooseLike::Base qw(:all); | |
has 'val_int' => ( | |
is => 'ro', | |
isa => Int, |
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 | |
set -e | |
[ -n $LOG_LEVEL ] || declare -i LOG_LEVEL=3 | |
[ -n $DATE_FORMAT ] || DATE_FORMAT="%x %T" | |
[ -n $BUILD_DIR ] || BUILD_DIR="/var/tmp/build" | |
[ -n $PERL_VERSION ] || PERL_VERSION="5.16.3" | |
function logger_fatal() { | |
[ $LOG_LEVEL -ge 0 ] || return 1 |
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/env perl | |
use Plack::Builder; | |
use Plack::App::File; | |
use My::WebApp; | |
my $app1 = Plack::App::File->new(root => "vendor/root")->to_app; | |
my $app2 = My::WebApp->psgi_app; | |
builder { |
OlderNewer