Skip to content

Instantly share code, notes, and snippets.

@diablowu
diablowu / jvmstats.sh
Last active November 16, 2015 07:38
probe
#!/bin/bash
. ~/.bashrc
echo "jvm statics"
netstat -atnp|grep java|grep LISTEN|awk '{print $4" "$7}'|sed 's#0\.0\.0\.0:##g'|sed 's#/java##g'|while read pport
do
pid=`echo $pport|awk '{print $2}'`
port=`echo $pport|awk '{print $1}'`
@diablowu
diablowu / centos_mirror.sh
Created November 16, 2015 07:39
centos mirror
#!/bin/bash
mirror_site="rsync://mirrors.yun-idc.com/centos/"
local_path="/app/mirrors/data/centos/"
excludes_path="/app/mirrors/conf/excludes.d/centos.list"
pid_file="/app/mirrors/var/run/centos.pid"
@diablowu
diablowu / install.sh
Created November 16, 2015 07:44
pdf2tiff
#!/bin/bash
target=$1
tarball="ghostscript-9.15-linux-x86_64"
if [ -d "$target" ];
then
echo "the path $target is exist, can't install the file into it."
exit 0
@diablowu
diablowu / pdf2jpg.sh
Created November 16, 2015 07:53
pdf2jpg
#!/bin/bash
echo "start convert pdf to jpeg"
#command line
sdir=$(dirname $0)
gs_cli=$sdir'/gs'
convert_cli='/usr/bin/convert'
id_cli='/usr/bin/identify'
@diablowu
diablowu / ds.jsp
Created December 10, 2015 02:21
DBCP ds status
<%@page trimDirectiveWhitespaces="true" %>
<%@page import="java.io.*"%>
<%@page import="javax.naming.InitialContext" %>
<%@page import="javax.naming.NamingException" %>
<%@page import="javax.sql.DataSource" %>
<%@page import="java.nio.charset.Charset"%>
<%@page import="org.apache.tomcat.dbcp.dbcp.BasicDataSource" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
@diablowu
diablowu / docker-registryv1-config.yml
Created December 24, 2015 09:08
docker-registryv1-config.yml
# All other flavors inherit the `common' config snippet
common: &common
issue: '"docker-registry server"'
# Default log level is info
loglevel: _env:LOGLEVEL:info
# Enable debugging (additional informations in the output of the _ping endpoint)
debug: _env:DEBUG:true
# By default, the registry acts standalone (eg: doesn't query the index)
standalone: _env:STANDALONE:true
# The default endpoint to use (if NOT standalone) is index.docker.io
@diablowu
diablowu / docker-mirrorv1-config.yml
Created December 24, 2015 09:09
docker-mirrorv1-config.yml
# All other flavors inherit the `common' config snippet
common: &common
issue: '"docker-registry server"'
# Default log level is info
loglevel: _env:LOGLEVEL:info
# Enable debugging (additional informations in the output of the _ping endpoint)
debug: _env:DEBUG:true
# By default, the registry acts standalone (eg: doesn't query the index)
standalone: _env:STANDALONE:true
@diablowu
diablowu / ds.jsp
Created December 28, 2015 01:04
tomcat dbcp data monitor jsp
<%@page trimDirectiveWhitespaces="true" %>
<%@page import="java.io.*"%>
<%@page import="javax.naming.InitialContext" %>
<%@page import="javax.naming.NamingException" %>
<%@page import="javax.sql.DataSource" %>
<%@page import="java.nio.charset.Charset"%>
<%@page import="org.apache.tomcat.dbcp.dbcp.BasicDataSource" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
@diablowu
diablowu / nginx.conf
Created February 4, 2016 08:49 — forked from fizerkhan/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@diablowu
diablowu / catalina.sh
Created April 29, 2016 06:54
catalina.sh
export JAVA_OPTS="-Xmx1g -Xms1g -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=256M $JAVA_OPTS"
export JAVA_OPTS="-XX:+AggressiveOpts -XX:+UseBiasedLocking $JAVA_OPTS"
export JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:+UseParNewGC $JAVA_OPTS"
export JAVA_OPTS="-XX:+UseFastAccessorMethods -XX:+CMSParallelRemarkEnabled $JAVA_OPTS"