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 lazy-search | |
"elegant as fuck, http://www.4clojure.com/problem/108" | |
[& x] | |
(let [[[b & e] & c] (sort-by first x)] | |
(if (apply = (map first x)) | |
b | |
(apply lazy-search (conj c e))))) |
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
(Thread/setDefaultUncaughtExceptionHandler | |
(reify Thread$UncaughtExceptionHandler | |
(uncaughtException [_ thread ex] | |
(track-error :thread-exception ex "Uncaught exception on" (.getName thread))))) |
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
StrictHostKeyChecking no | |
HashKnownHosts yes | |
TCPKeepAlive yes | |
ServerAliveInterval 20 | |
GSSAPIAuthentication no | |
GSSAPIDelegateCredentials no | |
Host my |
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
# edit file: /etc/ssh/sshd_config | |
ChallengeResponseAuthentication no | |
PasswordAuthentication no | |
UsePAM no | |
PermitRootLogin no |
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 com.google.gson.stream.JsonReader) | |
(import com.google.gson.Gson) | |
(def data "[{\"id\":2,\"name\":\"Thing1\"},{\"id\":3,\"name\":\"Thing2\"},{\"id\":4,\"name\":\"Thing3\"}]") | |
(def gson (Gson.)) | |
(defrecord example [id name]) | |
(defn to-record [java-map] | |
(map->example (into {} (map | |
(juxt |
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
-- mysql super user | |
CREATE USER 'newuser'@'%' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%'; |
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 / { | |
proxy_redirect off; | |
proxy_pass http://www.google.com; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Accept-Encoding ""; #2 | |
proxy_set_header User-Agent "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10 (this is for 3.2 beta 3)"; #3 | |
proxy_set_header Accept-Language "en-US"; #4 | |
proxy_set_header Cookie "PREF=ID=xxxxxx:U=yyyyy:FF=0:LD=zh-CN:NW=1:CR=2:TM=zzzz:LM=mmmmm:GM=1:SG=1:S=-nnnnn"; #5 |
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
#install elasticsearch marvel plugin | |
sudo docker run -v $HOME/data:/data dockerfile/elasticsearch /elasticsearch/bin/plugin -i elasticsearch/marvel/latest |
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
the ulimit command by default changes the HARD limits, which you (a user) can lower, but cannot raise. | |
Use the -S option to change the SOFT limit, which can range from 0-{HARD}. | |
I have actually aliased 'ulimit' to 'ulimit -S', so it defaults to the soft limits all the time. | |
alias ulimit='ulimit -S' | |
As for your issue, you're missing a column in your entries in limits.conf | |
There should be FOUR colums, the first is missing in your example. |
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
;;clojure tip . Clojure is awesome and all,but | |
;;0. you need to have a working and comfortable workflow. | |
;; I use emacs and I quite like "reloaded" workflow | |
;;1. wrap stateful services as components | |
;; when you start adding more stuff to you project, | |
;; you have to control code complexity with abstractions. | |
;; or you are piling up soon to be dead code... |