Sunday, April 01, 2018

$ sudo npm install -g create-react-native-app
$ create-react-native-app lemar
$ sudo sysctl -w fs.inotify.max_user_instances=1024
$ sudo sysctl -w fs.inotify.max_user_watches=12288

install the expo app on mobile and open it, then run

$ cd lemar
$ npm start

and follow instructions, you should able to have a live reload development environment to code with react native, basicially it's all javascript

when you want to build the binary, .apk for example, run

$ exp build:android

you'll need an expo account to continue, usually I don't register accounts for development tools, but I don't want to build binary on my old laptop ...

the build process is quite slow, take about 15 minutes for my quick project.

but it works and the whole experience is good.

next I will try their Using ClojureScript guide

Monday, April 02, 2018

cloudflare is Announcing the fastest, privacy-first consumer DNS service

my colleague told me one fun fact about you can just use 1.1

same as, you can just use 127.1, and

0 for (in my machine resolve to

the detailed answer can be found in inet_aton() man page:


Part a specifies the first byte of the binary address. Part b is interpreted as a 24-bit value that defines the rightmost three bytes of the binary address. This notation is suitable for specifying (outmoded) Class C network addresses.


The value a is interpreted as a 32-bit value that is stored directly into the binary address without any byte rearrangement.

Lambda Island has a really funny episode about ed: 40. The Ultimate Dev Setup

I think I really like the idea and started practice with ed:

$ rlwrap ed -p'> '
  • a: insert mode (insert to buffer)
  • .: exit insert mode
  • w [file]: write to file
  • f [file]: set file, then can write simply using w
  • e [file]: edit file and set current file name
  • p: print current line
  • 1p: print first line
  • ,p: print all lines
  • ,n: like ,p but shows line numbers
  • d: delete current line
  • 2d: delete line 2
  • ,d: delete all lines
  • r [file]: read file and append to buffer
  • u: undo
  • s/foo/bar/g: substitution current line
  • ,s/foo/bar/g: substitution all lines
  • 2, 2,3, ,, ?lin?: print lines
  • -, +, ++, -2: move cursor up or down
  • !grep n %: !: exec shell, %: current file name
  • w !clj: pipe buffer to shell command

Saturday, April 14, 2018

combining ed and less can navigate and do minor update very fast.

first, add an environment variable LESSEDIT, less default uses vi (or $VISUAL, $EDITOR), however it also passes +[line_num] to the editor which is not valid for ed

so a simple way to fix is add to .bashrc:

export LESSEDIT='rlwrap ed -p " >" %f'

%f is the filename

in order to display line number under less, type -N to toggle

Sunday, April 15, 2018

I bought Ed Mastery and finished in 2 days.

The book is short but I like the writing style, I put my reading notes here

ed itself doesn't support autocomplete, but rlwrap does

just append -r flag:

$ rlwrap -r ed -p "> " foo.txt

for filename completion, add -c flag

then I found out you can have autocomplete under sqlite, mysql etc...

for mysql, start client with mysql –auto-rehash

Wednesday, April 18, 2018

Announcing GraalVM: Run Programs Faster Anywhere

more details on their official site

I tried it with some simple clojure program, it's amazing!

the compiled programs start fast like it's written in go

some failed to compile, I saw a trick on r/clojure:

$ native-image -cp `lein cp`:target/uberjar/hello-0.1.0-SNAPSHOT-standalone.jar hello.core

Wednesday, April 25, 2018


saw this on r/clojure subreddit:

run gist directly from command line:

$ clojure -Sdeps '{:deps {hello-clojure {:git/url "" :sha "1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9"}}}' -m hello-clojure

essentially a clojure playground

a nice summary on clojure build tools: All the Paths

another summary on what clojure can help you: How Clojure helps you build powerful abstractions


FoundationDB is Open Source, check their Technical Overview page

on the same day Oracle Announcing General Availability of MySQL 8.0

the cluster mode is interesting but I don't have time to dive in yet: MySQL InnoDB Cluster 8.0 – A Hands-on Tutorial

a story about entity-attribute-value data model (which datomic uses): A Massively Multi-user Datastore, Synced with Mobile Clients

two datomic article:

a quick datomic setup from r/clojure:

  • Download, unzip
  • look at and probably not do anything
  • datomic/bin/transactor -Xmx1024m -Xms256m
  • java -cp project.jar clojure.main (or whatever)
  • (d/connect "datomic:free://localhost:4334/my-db")

some other interesting tools/links:

about the last link: people said Portacle is easier to setup a fresh common lisp environment.

Thursday, April 26, 2018

some ssh config to speed up (for git pull etc.)

ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600

force the connection to be closed by using ssh $host -O exit

Blog Archives

Search Blog: