Skip to content

Instantly share code, notes, and snippets.

View ulises's full-sized avatar

Ulises Cervino Beresi ulises

View GitHub Profile
@ulises
ulises / README.md
Created May 7, 2020 20:37 — forked from datagrok/README.md
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@ulises
ulises / walk_tree.py
Created April 2, 2019 10:53 — forked from woodsaj/walk_tree.py
Walk graphite metrics tree from specified prefix
#!/usr/bin/python
import requests
import json
import argparse
from Queue import Queue
from threading import Thread, Lock
import sys
import unicodedata
@ulises
ulises / README.md
Created April 1, 2017 22:08 — forked from metmajer/README.md
Ansible Logging To Elasticsearch

Ansible Logging To Elasticsearch

Turns Ansible log outputs into plain JSON strings and sends them to an Elasticsearch cluster.

Place the script in your playbook's plugins/callbacks/ directory.

@ulises
ulises / scriptrec.sh
Created April 27, 2016 07:21 — forked from hoehrmann/scriptrec.sh
Automatically record bash sessions
#####################################################################
#
# This script starts an automatically recorded session using `script`
# storing logs in `$log_dir`. Care should be taken to secure records
# generated by this script as they may easily contain passwords and
# other sensistive information.
#
#####################################################################
# FIXME(bh): make this configurable
(rstreams/ddt
(rstreams/moving-time-window
interval-in-seconds
(fn [events]
(let [total (reduce + (map :metric events))
example-event (first events)
total-event (assoc example-event :metric total)]
(log/info "Evs:" events)
(log/info "T:" total)
{23:05}~/personal/ylu ➭ lein compile | gist 3s
Wed 8 Jan 2014 23:05:49 GMT
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:212: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/convert/WrapAsScala, compiling:(producer.clj:1:1)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3463)
at clojure.lang.Compiler.compile1(Compiler.java:7153)
at clojure.lang.Compiler.compile1(Compiler.java:7143)
at clojure.lang.Compiler.compile(Compiler.java:7219)
at clojure.lang.RT.compile(RT.java:398)
at clojure.lang.RT.load(RT.java:438)
user> (JobConfig/STREAM_JOB_FACTORY_CLASS)
"job.factory.class"
user>
(handle-call
[this from id msg]
(handle-call* msg))
(defmulti handle-call* first)
(defmethod handle-call* :search
[[query]]
(str "Would search for" query))
user> (require '[clojure.core.match :refer [match]])
nil
user> (match [:search "query"] [:search query] (println "Searching for:" query) [:other [:here :be :args]] :other)
Searching for: query
nil
user> (match [:search "query"] [:search query] (str "Searching for:" query) [:other [:here :be :args]] :other)
"Searching for:query"
user>