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
[Unit] | |
Description = A fast & powerful event analysis platform | |
After = network.target | |
[Service] | |
Type = simple | |
PIDFile = /opt/caudal/caudal.pid | |
ExecStart = /opt/caudal/bin/caudal -d start | |
ExecStop = /opt/caudal/bin/caudal stop | |
Restart = always |
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
#!/bin/bash | |
# Initial config for users access | |
function validate_root { | |
if [ "$USER" -ne "root" ]; then | |
printf "WARN: this script is for root user\n" | |
fi | |
} | |
function add_user { |
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
cljs.user=> (js/cljs.js.eval (js/cljs.js.empty-state) {:a 1 :b 2 :c 3} (fn [x] (str (:b (:value x))))) | |
"2" | |
cljs.user=> (js/cljs.js.eval (js/cljs.js.empty-state) '(+ 1 2) (fn [x] (str (:b (:value x))))) | |
"" | |
cljs.user=> (js/cljs.js.eval (js/cljs.js.empty-state) '(+ 1 2) (fn [x] (str (:value x)))) | |
"3" | |
cljs.user=> (js/cljs.js.eval (js/cljs.js.empty-state) '{:a (+ 1 2)} (fn [x] (str (:value x)))) | |
"{:a 3}" |
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
(fn [ctx] | |
(letfn [(two-weeks [] | |
(let [now (java.util.Calendar/getInstance) | |
dis -15] | |
(-> (doto now | |
(.add java.util.Calendar/DATE dis)) | |
.getTime)))] | |
(let [fmt (java.text.SimpleDateFormat. "yyyy-MM-dd")] | |
(str (-> fmt (.format (two-weeks))) | |
"," |
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
global | |
log 127.0.0.1 local2 | |
chroot /var/lib/haproxy | |
pidfile /var/run/haproxy.pid | |
maxconn 8000 | |
user haproxy | |
group haproxy | |
#nbproc 2 | |
daemon |
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
;; Sinks | |
(defsink my-sink 1 ;; backpressure | |
(->INFO [:all] | |
(time-stampit [:millis] | |
(->INFO [:all] | |
(counter [:s-state :n] | |
(defstream [event] | |
(println "hola: " event)))))) | |
) |
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
#!/bin/bash | |
# See http://www.imagemagick.org/Usage/thumbnails/#pad | |
convert image200x70.png -thumbnail '200x200>' -background transparent -gravity center -extent 200x200 image199x199.png |
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
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/my-index -d ' | |
{ | |
"mappings": { | |
"user": { | |
"properties": { | |
"name": { "type": "text" }, | |
"user_name": { "type": "keyword" }, | |
"email": { "type": "keyword" } | |
} | |
} |
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
#!/bin/bash | |
for i in $( ls -Al | grep -e "^d"| tr -s ' ' | cut -f9- -d' ' ); do du -sh $i; done |
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
(defn write-to-drive[ctx] | |
(let [{:keys [sheet-id data-dir]} ctx | |
httpTransport (com.google.api.client.googleapis.javanet.GoogleNetHttpTransport/newTrustedTransport) | |
jsonFactory (com.google.api.client.json.jackson2.JacksonFactory/getDefaultInstance)] | |
(letfn [(authorize [] | |
(let [_ (clojure.java.io/make-parents (str data-dir "/.store/oauth2")) | |
dataStoreDir (java.io.File. (str data-dir "/.store/oauth2")) | |
dataStoreFactory (com.google.api.client.util.store.FileDataStoreFactory. dataStoreDir) | |
scopes (java.util.Arrays/asList (into-array String ["https://www.googleapis.com/auth/spreadsheets"])) |