Skip to content

Instantly share code, notes, and snippets.

#+PROPERTY: header-args:sql :cache yes
#+PROPERTY: header-args:sql+ :exports both
#+PROPERTY: header-args:sql+ :engine postgresql
#+PROPERTY: header-args:sql+ :dbhost localhost
#+PROPERTY: header-args:sql+ :dbuser lumen
#+PROPERTY: header-args:sql+ :dbpassword password
#+PROPERTY: header-args:sql+ :database lumen_tenant_1
#+PROPERTY: header-args:bash :output results
#+PROPERTY: header-args:bash+ :cache yes
#+STARTUP: showall
diff --git a/backend/.dir-locals.el b/backend/.dir-locals.el
index c995d58e..4aa605f9 100644
--- a/backend/.dir-locals.el
+++ b/backend/.dir-locals.el
@@ -1,20 +1,5 @@
-;; using docker-compose up, we loose the cider ability to navigate definitions with `C - .` due the source of current (docker) nrepl is under a different path `/app/src` instead of akvo-lumen local git repo
-;; so the trick is to replace docker source paths by user-local-paths.
-((nil . ((eval . (defun to-local-paths (info)
- "adapt src and .m2 docker paths to local paths"
- (let* ((file (nrepl-dict-get info "file"))

Testing connection

docker-compose exec -T postgres \ # (1)
               sed -i -e "s/^#log_destination/log_destination/"  -e "s/^#log_min_error_statement = error/log_min_error_statement = info/" -e "s/^#log_min_duration_statement = -1/log_min_duration_statement = 0/" -e "s/^#log_min_messages = warning/log_min_messages = info/" /var/lib/postgresql/data/postgresql.conf && \ # (2)
docker-compose restart postgres && \ # (3)
docker-compose restart backend && \ # (4)
docker-compose logs --no-color --follow postgres # (5)
  1. Calls exec with -T to disable pseudo-TTY. The command to execute is sed.

  2. Using sed we modify the postgresql.conf config file enable sql statement logging, using 0 for logging all statements. -i in sed modifies the source file instead of priting to stdout

@iperdomo
iperdomo / .npm-cache.txt
Created January 15, 2020 14:19
Contents of $HOME/.npm
.
./_cacache
./_cacache/index-v5
./_cacache/index-v5/3f
./_cacache/index-v5/3f/08
./_cacache/index-v5/3f/08/b27ed1af4818c3fa7a8cf301c79c47720daa91a5865b8fb7c052a8050292
./_cacache/index-v5/3f/ab
./_cacache/index-v5/3f/ab/2a8426bd792bbe142451ea1de52ca21c54302af944039d997e317f90bb26
./_cacache/index-v5/3f/ed
./_cacache/index-v5/3f/ed/a4262af2fd69542dbc4a870f3a5a9c5c7bfb2ee02ead6051deab177a7e46
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iperdomo
iperdomo / .dir-locals.el
Created November 13, 2019 09:30
CIDER translation paths
((nil
(cider-path-translations . (("/app" . (clojure-project-dir))
("/home/akvo" . (getenv "HOME"))
("/root" . (getenv "HOME")))))
#!/usr/bin/env bash
set -eu
set -o pipefail
apt-get update
apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [971 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [587 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [6276 B]
Get:10 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
@iperdomo
iperdomo / build-log.txt
Created October 8, 2019 09:44
Build output of build-node-mapnik.sh
# https://gist.github.com/iperdomo/2eb4ff45486651ef2c521320ab1aa008
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [971 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]