Skip to content

Instantly share code, notes, and snippets.

View ekoontz's full-sized avatar

Eugene Koontz ekoontz

View GitHub Profile
@ekoontz
ekoontz / gist:6dcc5d793cfcce4182e44079fd6060cb
Created September 5, 2023 20:45
probability of reaching m heads given n coin tosses
(let [n 10
m 5
expt (clojure.math.numeric-tower/expt 2 n)
number-of-heads (->> (range expt)
(map (fn [i] (count (re-seq #"1" (Integer/toBinaryString i)))))
(filter #(or (>= % m)))
count)]
[expt number-of-heads (+ 0.0 (/ number-of-heads expt))])
[1024 638 0.623046875]
ubuntu@ip-172-31-35-185:~/marian-examples/transformer-intro$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 23
model : 49
model name : AMD EPYC 7R32
stepping : 0
microcode : 0x8301055
cpu MHz : 2799.712
cache size : 512 KB
~ on ☁️ eu-central-1 took 16m21s
❯ ssh -i ~/.ssh/eu-central-1.pem ubuntu@18.195.88.121
The authenticity of host '18.195.88.121 (18.195.88.121)' can't be established.
ED25519 key fingerprint is SHA256:MR2Avnm8zMcVw1BclpbrZXT5rn73Ei5i/e+rM0NGxmE.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '18.195.88.121' (ED25519) to the list of known hosts.
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1031-aws x86_64)
* Documentation: https://help.ubuntu.com
❯ ssh -i ~/.ssh/eu-central-1.pem ubuntu@3.122.191.135
ssh: connect to host 3.122.191.135 port 22: Connection refused
~ on ☁️ eu-central-1 took 2s
❯ ssh -i ~/.ssh/eu-central-1.pem ubuntu@3.122.191.135
The authenticity of host '3.122.191.135 (3.122.191.135)' can't be established.
ED25519 key fingerprint is SHA256:M1EDvf/ZkojlkN4yHkMXGHvIqkjkP5DcObuMbE//h9Y.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '3.122.191.135' (ED25519) to the list of known hosts.
❯ ssh -i ~/.ssh/eu-central-1.pem ubuntu@3.73.73.84
The authenticity of host '3.73.73.84 (3.73.73.84)' can't be established.
ED25519 key fingerprint is SHA256:00l5QdmNDTbw1s6uXkd9UJJfx5k06obv3Q77VMjwvRI.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '3.73.73.84' (ED25519) to the list of known hosts.
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1031-aws x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
Last login: Wed Mar 29 15:09:29 on ttys005
~ on ☁️ eu-central-1
❯ ssh -i ~/.ssh/eu-central-1.pem ubuntu@3.126.207.7
The authenticity of host '3.126.207.7 (3.126.207.7)' can't be established.
ED25519 key fingerprint is SHA256:LnEcvPquYW1eQwMXGRB04edM/1R6zD1Q8RD7nE9uu3Y.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '3.126.207.7' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1031-aws x86_64)
Last login: Wed Mar 29 15:09:29 on ttys005
~ on ☁️ eu-central-1
❯ ssh -i ~/.ssh/eu-central-1.pem ubuntu@3.126.207.7
The authenticity of host '3.126.207.7 (3.126.207.7)' can't be established.
ED25519 key fingerprint is SHA256:LnEcvPquYW1eQwMXGRB04edM/1R6zD1Q8RD7nE9uu3Y.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '3.126.207.7' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-1031-aws x86_64)
ubuntu@ip-172-31-46-147:~/marian/build$ history
1 sudo apt-get install -y libgoogle-perftools-dev libprotobuf-dev protobuf-compiler libboost-system-dev gcc-${{ env.gcc_version }} g++-${{ env.gcc_version }}
2 sudo apt-get install -y libgoogle-perftools-dev libprotobuf-dev protobuf-compiler libboost-system-dev gcc-8 g++-8
3 apt-cache search gcc
4 sudo apt-get install -y libgoogle-perftools-dev libprotobuf-dev protobuf-compiler libboost-system-dev gcc-11 g++-11
5 sudo apt-cache search protobuf-compiler
6 sudo apt-cache search protobuf
7 sudo apt-get install -y libgoogle-perftools-dev libprotobuf-c-dev protobuf-compiler libboost-system-dev gcc-11 g++-11
8 sudo apt-get install -y libgoogle-perftools-dev libprotobuf-c-dev protobuf-c-compiler libboost-system-dev gcc-11 g++-11
9 sudo apt-get update
(ns ekoontz.log)
;; thanks to all the commenters on
;; https://stackoverflow.com/questions/24239144/js-console-log-in-clojurescript
(defn info [& args]
(.apply js/console.info js/console (to-array args)))
(defn debug [& args]
(.apply js/console.debug js/console (to-array args)))
@ekoontz
ekoontz / gist:1502838
Created December 20, 2011 19:22
Show your classpath within Clojure REPL.
(use 'clojure.pprint)
(import 'java.lang.Thread)
(-> (Thread/currentThread) (.getContextClassLoader) (.getURLs) (seq) (pprint))