Create file /etc/systemd/system/docker-compose@.service
. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin
, you should use paths specific for your environment.
[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
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
client = paramiko.SSHClient() | |
client._policy = paramiko.WarningPolicy() | |
client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
ssh_config = paramiko.SSHConfig() | |
user_config_file = os.path.expanduser("~/.ssh/config") | |
if os.path.exists(user_config_file): | |
with open(user_config_file) as f: | |
ssh_config.parse(f) |
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 levdist | |
(let [lev (atom nil) | |
impl | |
(fn [s t] | |
(let [lev @lev] | |
(cond | |
(empty? s) (count t) | |
(empty? t) (count s) | |
:else (let [ns (rest s) | |
nt (rest t)] |
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
; inspired from http://stackoverflow.com/questions/3906831/how-do-i-generate-memoized-recursive-functions-in-clojure | |
(defmacro memoize-fn | |
"Produces a memoized anonymous function that can recursively call itself." | |
[fn-name & fn-args] | |
`(with-local-vars | |
[~fn-name (memoize | |
(fn ~@fn-args))] | |
(.bindRoot ~fn-name @~fn-name) | |
@~fn-name)) |