Skip to content

Instantly share code, notes, and snippets.

@snickerjp
snickerjp / nagios-ja.spec
Created January 31, 2012 04:01
Repoforge Nagios Spec mod Japanese Patch
# $Id: nagios.spec 9310 2010-11-19 07:32:09Z cmr $
# Authority: dag
# Modify: snicker_jp
# Upstream: Ethan Galstad <nagios$nagios,org>
### FIXME: TODO: Add sysv script based on template. (remove cmd-file on start-up)
%define logmsg logger -t %{name}/rpm
%define logdir %{_localstatedir}/log/nagios
Summary: Open Source host, service and network monitoring program
@snickerjp
snickerjp / nagios-ja.spec.patch
Created January 31, 2012 04:23
Repoforge Nagios Spec Japanese Patch
--- /root/tmp/nagios.spec 2012-01-31 13:20:21.000000000 +0900
+++ nagios-ja.spec 2012-01-31 14:22:46.000000000 +0900
@@ -1,5 +1,6 @@
# $Id: nagios.spec 9310 2010-11-19 07:32:09Z cmr $
# Authority: dag
+# Modify: snicker_jp
# Upstream: Ethan Galstad <nagios$nagios,org>
### FIXME: TODO: Add sysv script based on template. (remove cmd-file on start-up)
@@ -9,7 +10,7 @@
@snickerjp
snickerjp / Perlで置換
Created February 2, 2012 11:05
Perlで置換
cat /etc/nagios/nrpe.cfg.`date '+%Y%m%d'` |perl -e 'foreach(<>){ if(!/^#/ && /check_disk/){ s/check_disk -w \$ARG1\$ -c \$ARG2\$/check_disk -w \$ARG1\$ -c \$ARG2\$ -W \$ARG1\$ -K \$ARG2\$/; } print;}' > /etc/nagios/nrpe.cfg
@snickerjp
snickerjp / Oracleセッション管理
Created February 8, 2012 12:09
Management Oracle Session
select SID,SERIAL#,USERNAME,MODULE,OSUSER,PROGRAM,MACHINE from v$session where OSUSER = 'ユーザ名';
CREATE TABLE data as
select
ID,
sum(PAY_MONEY) as PAY_MONEY
from
SALES
where
ID in (
'AAAA',
'BBBB',
@snickerjp
snickerjp / OpenVZ-CE5toCE6-x86_64_kai.sh
Created February 10, 2012 12:39
OpenVZ-CE5toCE6-x86_64.sh改変
# Copyright © y-kawaz氏
# 15分でOK!ServersMan@VPSにSL6(≒CentOS6)を入れる方法
# URL:http://d.hatena.ne.jp/y-kawaz/20110722/1311275547
# Mod:snicker_jp
# 作業のジャマなので不要なプロセスを停止
/etc/init.d/ajaxterm stop
/etc/init.d/crond stop
/etc/init.d/httpd stop
/etc/init.d/saslauthd stop
@snickerjp
snickerjp / Create
Created February 14, 2012 11:37
FileSWAP on Serversman@VPS
#ルートディレクトリ内に1GBのファイル「swap」を作成
dd if=/dev/zero of=/swap bs=1G count=1
↓ 修正!メモリが少ない環境だと作れないから
dd if=/dev/zero of=/swap bs=10M count=100
@snickerjp
snickerjp / CSVandIF.sql
Created March 8, 2012 09:40
CSV出力とIF関数
select
IF(FLAG=1,'OK','NG')
from
DATA
where
ID = 001
INTO OUTFILE "/tmp/test.csv" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
@snickerjp
snickerjp / MySQL
Created April 1, 2012 12:30
Install WordPress for Ubuntu
INSERT INTO user (Host,User,Password) VALUES('localhost','wordpress',PASSWORD('xxxxx'));
CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* to wordpress@localhost;
FLUSH PRIVILEGES;
@snickerjp
snickerjp / NotFound
Created April 11, 2012 20:25
Install netExtenderClient
$ ldd netExtender
linux-vdso.so.1 => (0x00007fff1bbff000)
libssl.so.6 => not found
libcrypto.so.6 => not found
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3ad922a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3ad900d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3ad8c50000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3ad9448000)