Skip to content

Instantly share code, notes, and snippets.

http://www.paulgraham.com/spam.html
https://queue.acm.org/detail.cfm?id=2187821
https://martinfowler.com/articles/microservices.html
FROM python:3
RUN pip3 install papermill
RUN python3 -m pip install ipykernel
@dileepbapat
dileepbapat / Mosquitto-ssl
Created January 31, 2022 04:14
Mosquitto-ssl
Securing mosquitto
```shell script
# Create certificate authority key
openssl genrsa -des3 -out ca.key 2048
openssl req -new -x509 -days 1826 -key ca.key -out ca.crt
# Server key
openssl genrsa -out server.key 2048
openssl req -new -out server.csr -key server.key
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 360
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 bundleMetaData::pb*
sudo apt-get install python-pip python-dev python-virtualenv
virtualenv --system-site-packages ~/tensorflow
source ~/tensorflow/bin/activate
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc0-cp27-none-linux_x86_64.whl
pip install --upgrade $TF_BINARY_URL
#remember to run source ~/tensorflow/bin/activate on new shell
@dileepbapat
dileepbapat / gist:54bc8f5c9147e2c2512e
Created July 2, 2014 11:11
ab on local nginx on ubuntu 1204
Document Length: 46 bytes
Concurrency Level: 500
Time taken for tests: 50.656 seconds
Complete requests: 1000000
Failed requests: 0
Write errors: 0
Total transferred: 255000000 bytes
HTML transferred: 46000000 bytes
Requests per second: 19740.96 [#/sec] (mean)
Time per request: 25.328 [ms] (mean)
(defn jsArr
"Recursively converts a sequential object into a JavaScript array"
[seq]
(.array (vec (map #(if (sequential? %) (jsArr %) %)
seq))))
(defn jsObj
"Convert a clojure map into a JavaScript object"
[obj]
(.strobj (into {} (map (fn [[k v]]
@dileepbapat
dileepbapat / gist:8951779
Created February 12, 2014 08:20
new install dw
dwenv=$1
dwenv=${dwenv:=dwdev}
if [[ -z "$1" ]]; then
echo "Setting up $dwenv (press ctrl+c to stop)"
read in
else
echo "Setting up $dwenv"
fi
sudo apt-get update && \
sudo apt-get install -y git && \
@dileepbapat
dileepbapat / gist:8596912
Created January 24, 2014 13:09
list python unit tests taking more time (nose tests)
cat /tmp/nosetests.xml|tr '<' '\n'|grep 'testcase ' |cut -d\" -f2,6|sort -n -t\" -k2