Skip to content

Instantly share code, notes, and snippets.

View gamlerhart's full-sized avatar

Roman Stoffel gamlerhart

View GitHub Profile
<script
type="application/javascript"
src="https://sig.edgeno.de/edgemesh.client.min.js"
onload="window.edgemesh = new Edgemesh()">
</script>
package info.gamlor.blog;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
enum TypeInfo {
UNKNOWN(0),
INT(1),
STRING(2);
@gamlerhart
gamlerhart / DemoService.scala
Last active April 25, 2017 14:02
JVM-Docker
// Version 1 did just start Jetty
// val server = new Server(8080)
// It creates many acceptors, selectors and threads on big machines, even when running in small container
// So, let's explicitly configure it.
val minThreads = System.getProperty("jetty.min-threads", "8").toInt
val maxThreads = System.getProperty("jetty.max-threads", "200").toInt
var threadPool = new QueuedThreadPool(minThreads, maxThreads)
val server = new Server(threadPool)
val acceptorCount = System.getProperty("jetty.acceptor-threads", "-1").toInt
@gamlerhart
gamlerhart / turbo-stuff.sh
Last active September 28, 2016 11:36
turbo-filtering-etc
#Stop & remove al containers running a firefox process:
turbo ps --no-trunc | grep firefox | awk '{ print $3 }' | uniq | xargs -n1 -I# turbo rm -f #
@gamlerhart
gamlerhart / environment.sh
Last active February 11, 2017 01:34
manta-get-started
# https://my.joyent.com/main/#!/manta/intro Lists your's
export MANTA_URL=https://us-east.manta.joyent.com;
export MANTA_USER=<Joyent-User>;
export MANTA_KEY_ID=<ssh-public-key-finger-print>;
# Or read it directly from your local .ssh keys
export MANTA_KEY_ID=$(ssh-keygen -l -f $HOME/.ssh/id_rsa.pub | awk '{print $2}')
@gamlerhart
gamlerhart / Dockerfile
Created July 24, 2016 14:50
bad-container-example
FROM node
RUN mkdir /demo
COPY io-wasting.js /demo/
CMD ["/usr/local/bin/node", "/demo/io-wasting.js"]
@gamlerhart
gamlerhart / dtrace-start.sh
Last active July 25, 2016 12:16
triton-debug
#linux-syscalls aka lx-syscalls
root@3bd53e4a7fe4:/# dtrace -ln 'lx-syscall:::'
ID PROVIDER MODULE FUNCTION NAME
1549 lx-syscall sys32 inotify_init1 return
1550 lx-syscall sys32 preadv entry
1551 lx-syscall sys32 preadv return
1552 lx-syscall sys32 pwritev entry
# Start tracing the syscalls. Grouped by execname, pid and syscallname (probefunc)
root@3bd53e4a7fe4:/# dtrace -n 'syscall::: { @num[execname,pid,probefunc] = count() }'
@gamlerhart
gamlerhart / adhoc-reloading.clj
Last active August 7, 2016 13:19
clojure-realoading
; Allow changing in REPL.
; In a real app this could be admin functionality / more advanced toggle
(def reload-enabled
(atom false))
(defn handler
"Most boring handler. Just returns our example email as JSON"
[request]
; When reload is enabled, then we do a full reload
(when @reload-enabled
@gamlerhart
gamlerhart / build-postman.bat
Last active December 8, 2016 06:14
hey-mister-postman-blog
turbo build --no-base --overwrite postman.turbo.me
@gamlerhart
gamlerhart / create-profile.sh
Last active July 7, 2016 03:34
triton-intro
gamlor@minty ~ $ triton profile create
A profile name. A short string to identify a CloudAPI endpoint to the
`triton` CLI.
name: us-west-1
The CloudAPI endpoint URL.
url: https://us-west-1.api.joyent.com
Your account login name.
account: Gamlor