Skip to content

Instantly share code, notes, and snippets.

View artifactsauce's full-sized avatar

Kenji Akiyama artifactsauce

View GitHub Profile
@artifactsauce
artifactsauce / install.sh
Created December 18, 2012 05:07
Install zabbix version 2.0 package from EPEL to CentOS 6.
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
@artifactsauce
artifactsauce / functions_logger.sh
Last active June 4, 2022 00:53
Bash function file for logger.
# 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() {
@artifactsauce
artifactsauce / install_perl.sh
Created May 2, 2012 03:38
Install multiple version of perl into system region with perlbrew
#!/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`
@artifactsauce
artifactsauce / backup_homedir.sh
Created November 2, 2011 01:02
Backup script for Mac OS X home directory by rsync
#!/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 ;;
@artifactsauce
artifactsauce / parallel_forkmanager.pl
Created October 20, 2011 07:02
Perl Parallel::ForkManager
#!/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 } );
@artifactsauce
artifactsauce / list_installed_pm.pl
Created November 18, 2010 04:17
List installed perl modules
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use ExtUtils::Installed;
use List::Util;
my %options = ();
GetOptions(