Skip to content

Instantly share code, notes, and snippets.

View evanjuang's full-sized avatar

Juang JiaYu evanjuang

  • Taoyuan, Taiwan
View GitHub Profile
@evanjuang
evanjuang / shell-cli-template.sh
Last active April 17, 2019 08:08
[shell - simple cli template] #shell
#!/bin/bash
usage() {
echo "Usage:"
echo " $(basename "$0") -u <username> -p <password> -a <api>"
exit
}
if [ "$#" -ne 6 ]; then
usage
@evanjuang
evanjuang / argparse_usage.py
Last active April 17, 2019 08:07
[python - argparse] #python
subcmd = parser.add_subparsers(description='command description',
title='command title',
help='command help',
dest='cmd',
metavar='command metavar',
prog='command prog')
subcmd.add_parser('cmd1', help='cmd1 help')
@evanjuang
evanjuang / WebServer.py
Last active November 17, 2020 13:01 — forked from joncardasis/WebServer.py
[python - simple web server] A simple and quick HTTP web server in Python #python
"""
Author: Jonathan Cardasis
"""
import socket
import signal # Allow socket destruction on Ctrl+C
import sys
import time
import threading
@evanjuang
evanjuang / nagios-on-centos7.md
Last active April 17, 2019 08:01
[nagios - install on centos 7] #nagios

Nagios on CentOS 7

Install Nagios Core

  1. Install package
$ yum install wget httpd php glibc glibc-common gd gd-devel 
make net-snmp unzip openssl-devel gcc
  1. Add user
$ useradd nagios -p nagios
@evanjuang
evanjuang / app.bat
Last active April 17, 2019 08:13
[java - start java application by script] #java #windows #linux #shell
@ECHO off
SET APP_NAME=app
REM Get Home Directory
SET APP_PATH=%~dp0
SET APP_HOME=%APP_PATH:~0,-5%
REM Project Information