Ops notes

Riak🔗

attach to running riak node

riak attach

list processes by memory usage

riak-admin top -sort msg_q

programatically build a pid

c:pid(0,227,0)

get info about a process

erlang:process_info(c:pid(0,227,0)).

Haproxy🔗

Haproxy doc (1.9)

use the runtime api to get some info

/usr/bin/socat -T 15 -t 5 /run/haproxy/admin.sock - <<< "show activity" 

some of the stuff:

how to get the socket?

grep "stats socket" conf

Container stuff🔗

go into container to run gdb

nsenter -t $host_pid -m -p gdb -p $in_container_pid

bind the container fs to get symbols in thee binary container from the host machine with perf (from this)

bindfs /proc/$(docker inspect --format {{.State.Pid}} $CONTAINER_ID)/root /foo
perf record -g -a -F 100 -e cpu-clock -G docker/$(docker inspect --format {{.Id}} $CONTAINER_ID) sleep 90

Flamegraph🔗

Flamegraph instructions

(clone the repo and do the stuff)

JVM🔗

Adopt A JDK to get a free JDK

list jvm options (command line cli parameters)🔗

java -XX:+PrintFlagsFinal

jshell🔗

HttpURLConnection con = (HttpURLConnection) new URL("https://***").openConnection();
con.setRequestMethod("GET"); con.getResponseCode();

To test whether the JVM can deal with the pointed server.

jmx stuff🔗

for quick debugging

ex -vnE /...java11.../conf/security/java.policy <<EOF
/grant {/ a
    permission java.security.AllPermission;
.
wq
EOF
# stuff that works for my start scripts
ex -vnE ...startscript... <<EOF
/Heap/ a
-Dcom.sun.management.jmxremote !
-Dcom.sun.management.jmxremote.ssl=false !
-Dcom.sun.management.jmxremote.authenticate=false !
-Dcom.sun.management.jmxremote.port=1098 !
.
%s/!/\\\\/
wq
EOF
reset
killall java
unset JAVA_TOOL_OPTIONS
jstatd -p ...whatever... &

Security🔗

TLS🔗

Networking🔗

Static website🔗

Cloudflare + AWS S3

Extra stuff to do because moving stands... (2019/06/04):

  1. Click on bucket
  2. Click on permission
  3. Click on "Block public access"
  4. Untick "Block all public access"
  5. Set "Block public access to buckets and objects granted through new access control lists (ACLs)" as "OFF"
  6. Set "Block public access to buckets and objects granted through any access control lists (ACLs)" as "OFF"

Try Cloudflare workers for serverless?

Netflix suddenly fucking up (loads but won't play)🔗

chrome://settings/clearBrowserData

and remove 1h or so

Gems for immutable ruby🔗

Modeling server response time!🔗