This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Value("${some.key:one,two,three}") | |
| private String[] stringArrayWithDefaults; | |
| @Value("${some.key:1,2,3}") | |
| private int[] intArrayWithDefaults; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "ansible_ssh_pass":"vagrant", | |
| "module_setup":"True", | |
| "ansible_distribution_version":"7.1.1503", | |
| "ansible_env":{ | |
| "USERNAME":"root", | |
| "LANG":"C", | |
| "TERM":"xterm-256color", | |
| "SHELL":"/bin/bash", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private Invocable initRuleEngine(String ruleLocation) throws ScriptException, FileNotFoundException { | |
| ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn"); | |
| Compilable compEngine = (Compilable) engine; | |
| final CompiledScript compiledScript = compEngine.compile(new FileReader(ruleLocation)); | |
| compiledScript.eval(); | |
| return (Invocable) engine; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static byte[] hexStringToByteArray(String s) { | |
| int len = s.length(); | |
| byte[] data = new byte[len / 2]; | |
| for (int i = 0; i < len; i += 2) { | |
| data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) | |
| + Character.digit(s.charAt(i+1), 16)); | |
| } | |
| return data; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yum install nmap-ncat.x86_64 | |
| echo mntr|nc 127.0.0.1 2181 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| r = {'is_claimed': 'True', 'rating': 3.5} | |
| r = json.dumps(r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat vars/logstash-vars.yml| python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location ^~ /uri { | |
| index index.html; | |
| root /usr/local/openresty/nginx/html/; | |
| auth_basic "Restricted"; | |
| auth_basic_user_file /usr/local/nginx/conf/servers/.httppassword; | |
| } | |
| ## httppassword generator: http://www.htaccesstools.com/htpasswd-generator/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iptables -I INPUT -p tcp --dport 5141 -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String getParameter(ServletRequest request) { | |
| Assert.notNull(request, "request must not be null"); | |
| StringBuilder parameter = new StringBuilder(); | |
| Enumeration<String> enumeration = request.getParameterNames(); | |
| ArrayList<String> parameterList = Collections.list(enumeration); | |
| Collections.sort(parameterList); | |
| for (String paramName : parameterList) { | |
| String value = request.getParameter(paramName); | |
| if (!paramName.equals("sign") && !paramName.equals("pic")) { | |
| parameter.append(paramName).append("=").append(value).append("&"); |