This file contains 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
def parseQuery(query) {query.split('&').collect{it.split('\\=', 2)}.groupBy{it[0]}.collectEntries{k, v ->[k, v.collect{it.size() == 2 ? it[1] : ''}]}} | |
// USAGE EXAMPLE BELOW (uncomment lines below to test) | |
// def query = 'orange=price=10&orange=color=red&edit&separator===========' | |
// def queryParameters = parseQuery(query) | |
// assert queryParameters.toString() == '[orange:[price=10, color=red], edit:[], separator:[==========]]' | |
// assert queryParameters.orange[0] == 'price=10' | |
// assert queryParameters.orange[1] == 'color=red' |
This file contains 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
// To start | |
// node proxy-server.js REMOTE_ADDR PORT | |
// REMOTE_ADDR the remote address. eg. https://my-secure-site | |
// PORT port number to listen | |
var http = require('http'); | |
var request = require('request'); | |
var url = require('url') |
This file contains 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
def nullTrustManager = [ | |
checkClientTrusted: { chain, authType -> }, | |
checkServerTrusted: { chain, authType -> }, | |
getAcceptedIssuers: { null } | |
] | |
def nullHostnameVerifier = [ | |
verify: { hostname, session -> | |
//true | |
hostname.startsWith('yuml.me') |
This file contains 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
for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" |
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "s3:ListAllMyBuckets", | |
"Resource": "arn:aws:s3:::*" | |
}, | |
{ | |
"Effect": "Allow", |
This file contains 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
# ~/.profile: executed by the command interpreter for login shells. | |
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login | |
# exists. | |
# see /usr/share/doc/bash/examples/startup-files for examples. | |
# the files are located in the bash-doc package. | |
# the default umask is set in /etc/profile; for setting the umask | |
# for ssh logins, install and configure the libpam-umask package. | |
#umask 022 |
This file contains 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
/* | |
* Reindex elasticsearch | |
* Read all documents from oldServer/oldIndex/oldType and put them into newServer/newIndex/newtype | |
* If the newIndex raises an error script will print and stop | |
*/ | |
/* Configuration START */ | |
// OLD Server config - READ_ONLY | |
def oldServer = "http://localhost:9200" |
This file contains 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
du -h --max-depth=1 |
This file contains 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
@Grapes( | |
@Grab(group='commons-codec', module='commons-codec', version='1.10') | |
) | |
import java.security.* | |
import java.util.Base64; | |
def file = new File('c:/users/danielr/Downloads/mortalkombat.mp4') | |
FileInputStream fis = new FileInputStream(file); | |
def md5 = org.apache.commons.codec.digest.DigestUtils.sha256(fis); | |
fis.close() | |
println md5 |
This file contains 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
log4j.debug=true | |
# Set root category priority to INFO and its only appender to CONSOLE. | |
log4j.rootCategory=TRACE, CONSOLE, ROLLINGFILE | |
# CONSOLE is set to be a ConsoleAppender using a PatternLayout. | |
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender | |
log4j.appender.CONSOLE.Threshold=INFO | |
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout | |
log4j.appender.CONSOLE.layout.ConversionPattern=[%6.6r]%m%n |