I recently had the following problem:
- From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
- That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
#!/bin/bash | |
# file: ttfb.sh | |
# curl command to check the time to first byte | |
# ** usage ** | |
# 1. ./ttfb.sh "https://google.com" | |
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
curl -o /dev/null \ | |
-H 'Cache-Control: no-cache' \ | |
-s \ |
This blog post series has moved here.
You might also be interested in the 2016 version.
Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.
Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.
(ns scrape | |
(:require [babashka.pods :as pods] | |
[clojure.walk :as walk])) | |
(pods/load-pod "bootleg") ;; installed on path, use "./bootleg" for local binary | |
(require '[babashka.curl :as curl]) | |
(def clojure-html (:body (curl/get "https://en.wikipedia.org/wiki/Clojure"))) |
In an effort to gain at least a superficial understanding of the technical implementation of cryptocurrencies, I recently worked my way through "Learn Blockchains by Building One" using Clojure.
This was a good chance to experiment with using spec in new ways. At work, we primarily use spec to validate our global re-frame state and to validate data at system boundaries. For this project, I experimented with using instrumentation much more pervasively than I had done elsewhere.
This is not a guide to spec (there are already many excellent resources for this). Rather, it's an experience report exploring what went well, what is still missing, and quite a few unanswered questions for future research. If you have solutions for any of the problems I've presented, please let me know!
You don't need to know or care about blockchains to understand the code be