Skip to content

Instantly share code, notes, and snippets.

View danielef's full-sized avatar

Daniel Estévez danielef

  • Ontario, Canada
  • 11:43 (UTC -04:00)
  • X @danielef
View GitHub Profile
@danielef
danielef / run.conf
Created October 15, 2016 00:00
JMX SOAP-Version 5.3.0.GA (without authentication)
## -*- shell-script -*- ######################################################
## ##
## JBoss Bootstrap Script Configuration ##
## ##
##############################################################################
### $Id: run.conf 91533 2009-07-22 01:20:05Z gbadner $
#
# This shell script is sourced by run.sh to initialize the environment
@danielef
danielef / xstats-by-metric.bash
Created September 29, 2016 05:37
Elasticsearch extended stats by field
curl -XGET 'http://localhost:9200/logstash-2016.09.28/_search?pretty=true' -d ' {
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{"term": {"service.raw": "jmx.Memory.HeapMemoryUsage.used"}}
]
}
}
@danielef
danielef / classloader-repl.cl
Created September 14, 2016 01:02
Add a jar dependency to classloader
(-> (-> (Thread/currentThread) (.getContextClassLoader)) (.addURL (java.net.URL. "file:///path/to/jboss-cli-client.jar")))
@danielef
danielef / delete-all-docker-containers.bash
Created September 5, 2016 17:32
Docker delete all containers
for i in $( docker ps -a | sed -n '1!p' | awk '{print$1}' ); do docker rm $i; done
@danielef
danielef / get-all-indexes.bash
Last active January 12, 2018 15:52
#ElasticSearch get all indexes
curl http://localhost:9200/_cat/indices?v
@danielef
danielef / run-elasticsearch-in-docker.sh
Created September 2, 2016 16:43
Run ElasticSearch in Docker
sudo sysctl -q -w vm.max_map_count=262144
docker run -p 9200:9200 --security-opt seccomp=unconfined -i -t danielef/elasticsearch:5.0.0-alpha5
@danielef
danielef / fyf.clj
Created July 30, 2016 18:50
Factorial & Fibonnaci en Clojure
;; Factorial Recursivo
;; http://stackoverflow.com/questions/1662336/clojure-simple-factorial-causes-stack-overflow
(defn !-recursive [x]
(if (= x 1) 1N
(* x (!-recursive (dec x)))))
;; Factorial Iterativo
;; https://mitpress.mit.edu/sicp/full-text/sicp/book/node15.html
(defn !-iterative
([x] (!-iterative 1N 1 x))
@danielef
danielef / gist:d5955f67bd842d5604ad48abf0647312
Last active May 12, 2016 22:02
Add a global ACI enabling OpenAM user to modify schema
bin/dsconfig --trustAll -h lab.example.com -p 4444 -D cn="Directory Manager" -w someSecretPWD -n set-access-control-handler-prop --add global-aci:'(target = "ldap:///cn=schema")(targetattr = "attributeTypes || objectClasses")(version 3.0;acl "Modify schema"; allow (write)(userdn = "ldap:///uid=openam,ou=admins,dc=example,dc=com");)'
@danielef
danielef / java-logger.bash
Created April 22, 2016 02:48
SLF4J logging for standalone app
java -Dorg.slf4j.simpleLogger.defaultLogLevel=trace -jar mylib.jar
@danielef
danielef / gist:7a45029568b6311697d682230c5707df
Created April 21, 2016 06:02
Glassfish get JDBC Pool Properties
asadmin get resources.jdbc-connection-pool.<POOLNAME>.property