- Ubuntu 17.04
sudo apt-get update
import javax.naming.Context; | |
import javax.naming.NamingEnumeration; | |
import javax.naming.NamingException; | |
import javax.naming.directory.*; | |
import java.util.Hashtable; | |
public class TestApp { | |
public static void main(String[] args) { | |
Hashtable<String, String> env = new Hashtable<>(); | |
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); |
#!/bin/bash | |
# 语法: getopts OPTSTRING VARNAME [ARGS…] | |
# OPTSTRING 是允许的选项,例如"lt:p:",字母后面紧跟一个冒号":"表示该选项需要参数,例如 -l -p aaa | |
# VARNAME 是getopts用来存储每次解析到的选项字母(不包括 "-" ) | |
# | |
# 错误处理 | |
# A. getopts发现错误(非法选项或者选项缺少参数),输出错误信息 | |
# B. 在OPTSTRING前加多一个冒号 ":" (比如 ":lt:p:"),则不会输出错误信息并做如下处理 | |
# B1. 非法选项:VARNAME被设为 "?",OPTARG被设为所解析到非法选项字母 |
let fs = require('fs') | |
let cheerio = require('cheerio') | |
let file = fs.readFileSync('ios_device_specifications_grid.html'); | |
let $ = cheerio.load(file); | |
var keys = []; | |
var data = []; | |
var shouldAddKey = true; |
import os | |
times = 2 | |
show_top = 10 | |
flag = 'time=' | |
domain = '.vpnhide.com' | |
protocols = ['p1', 'p2'] | |
nodes = { # node: number | |
'jp': 4, |
$gitlab_server= | |
# gitlab server | |
0 2 * * * tar -cf $(date "+/var/opt/gitlab/backups/%s_gitlab_etc.tar") -C / etc/gitlab; /opt/gitlab/bin/gitlab-ci-rake backup:create CRON=1 | |
# backup server | |
0 3 * * * rsync -avH root@$gitlab_server:/var/opt/gitlab/backups/ ~/Documents/backup/gitlab |
apt–get install python–gevent python–pip python–m2crypto | |
pip install shadowsocks | |
mkdir -p /etc/shadowsocks.conf | |
vi /etc/shadowsocks.conf | |
``` | |
{ | |
"server": "0.0.0.0", | |
"port_password": | |
{ |
public class MetricInfo { | |
static Object memoryMeter; | |
static { | |
try { | |
memoryMeter = Class.forName("org.github.jamm.MemoryMeter").newInstance(); | |
logger.info("MemoryMeter loaded"); | |
} catch (Exception e) { | |
// empty | |
} |