Skip to content

Instantly share code, notes, and snippets.

@diablowu
diablowu / access_points.tpl
Last active September 8, 2015 04:26 — forked from javierwilson/access_points.tpl
Generates Nagios config for Access Points
define hostgroup{
hostgroup_name access_points
alias Access Points
}
{%- for ap in items %}
define host{
use generic-switch
host_name {{ ap.name }}
alias {{ ap.name }}
@diablowu
diablowu / deploy.txt
Created July 23, 2015 06:57
weblogic deploy cli
BATCHUPDATE脚本,建立数据源
newds.script
---------------------------------------------------
# create cp
CREATE_POOL mypool url=jdbc:oracle:thin:@10.0.1.1:1521:intgtest11,driver=oracle.jdbc.OracleDriver,testConnsOnReserve=true,testTableName=dual,initialCapacity=2,maxCapacity=10,capacityIncrement=2,allowShrinking=true,props=user=user;password=passwd
# create ds
CREATE -mbean base_domain:Name=myds,Type=JDBCTxDataSource
# set CP Name
@diablowu
diablowu / scan.bat
Created July 22, 2015 07:24
scan.bat
wmic /node:%1 computersystem get model,name,username,domain /format:htable > c:\triage-%1.html
wmic /node:%1 startup list full /format:htable >> c:\triage-%1.html
wmic /node:%1 process get description,processid,parentprocessid,commandline /format:htable >> c:\triage-%1.html
wmic /node:%1 service get name,processid,startmode,state,status,pathname /format:htable >> c:\triage-%1.html
wmic /node:%1 job list full /format:htable >> c:\triage-%1.html
@diablowu
diablowu / clock.css
Created June 23, 2015 13:59
clock css3
/* clock animation */
/* WebKit */
span.sec {
-webkit-animation: rotateBB 60s infinite linear;
}
span.min {
-webkit-animation: rotateBB 3600s infinite linear;
}
@diablowu
diablowu / check_tomcat.sh
Created May 13, 2015 07:13
check tomcat server for nagios plugin
#!/bin/sh
##### Created by Pawan #####
##### Vesion 1.4 #####
# Usage helper for this script
function usage() {
local prog="${1:-check_jstat.sh}"
echo "Usage: $prog -v";
echo " Print version and exit"
echo "Usage: $prog -h";
@diablowu
diablowu / check_nginx.sh
Created May 13, 2015 06:29
nginx checking for nagios plugin
#!/bin/sh
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@diablowu
diablowu / uploadserver.js
Created April 22, 2015 06:21
fileupload server over Busboy
var http = require('http'),
inspect = require('util').inspect;
var Busboy = require('busboy');
http.createServer(function(req, res) {
if (req.method === 'POST') {
var busboy = new Busboy({ headers: req.headers });
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
console.log('File [' + fieldname + ']: filename: ' + filename + ', encoding: ' + encoding + ', mimetype: ' + mimetype);
@diablowu
diablowu / tzchina.sh
Created April 16, 2015 13:32
change timezone to China
#!/bin/bash
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sudo ntpdate cn.pool.ntp.org
@diablowu
diablowu / vlccam.sh
Created March 22, 2015 00:07
streaming mp4v codec using a video device in vlc cli
#!/bin/bash
sudo -u pi /usr/bin/vlc -d --pidfile /tmp/vlc.pid -I dummy \
v4l2:// :v4l2-dev=/dev/video0 \
:v4l2-width=320 :v4l2-height=240 :live-caching=300 \
--sout="#transcode{vcodec=mp4v,vb=300,scale=1}:http{dst=:8080/stream.ts}"
@diablowu
diablowu / sudoer
Created March 20, 2015 12:57
管理员sudoer
使用vim作为默认 visudo的编辑器
sudo env VISUAL=vim visudo
管理员用户免密码sudo
admin ALL = NOPASSWD: ALL