Skip to content

Instantly share code, notes, and snippets.

View etki's full-sized avatar
🤡
freaking out neighbor kids

Etki etki

🤡
freaking out neighbor kids
  • [x]
View GitHub Profile
@etki
etki / docker-compose.yml
Last active August 25, 2016 20:08
Quick and dirty dummy DNS SRV record setup
dnsmasq:
image: andyshinn/dnsmasq:2.76
ports:
- 10053:53/tcp
- 10053:53/udp
command:
- -W
- _http._tcp.router.lipe-routing.svc.cluster.local,pod-1,80
- -W
- _http._tcp.router.lipe-routing.svc.cluster.local,pod-2,80
var start = new Date().getTime(),
checkpoint = null,
delay = 1000,
end = start + (delay * 2),
current;
setTimeout(function () {
if ((current = new Date().getTime()) < end) {
console.log('we\'re borked');
} else {
@etki
etki / 2.4.0.out
Last active April 7, 2017 17:45
weird kitchen nil exception
bundle exec kitchen converge 1604 -l debug
-----> Starting Kitchen (v1.15.0)
D [Vagrant command] BEGIN (vagrant --version)
D [Vagrant command] END (0m1.03s)
/home/etki/.rvm/gems/ruby-2.4.0/gems/test-kitchen-1.15.0/lib/kitchen/configurable.rb:99:in `join': no implicit conversion of nil into String (TypeError)
from /home/etki/.rvm/gems/ruby-2.4.0/gems/test-kitchen-1.15.0/lib/kitchen/configurable.rb:99:in `calculate_path'
from /home/etki/.rvm/gems/ruby-2.4.0/gems/test-kitchen-1.15.0/lib/kitchen/provisioner/chef_base.rb:71:in `block in <class:ChefBase>'
from /home/etki/.rvm/gems/ruby-2.4.0/gems/test-kitchen-1.15.0/lib/kitchen/lazy_hash.rb:135:in `proc_or_val'
from /home/etki/.rvm/gems/ruby-2.4.0/gems/test-kitchen-1.15.0/lib/kitchen/lazy_hash.rb:76:in `[]'
from /home/etki/.rvm/gems/ruby-2.4.0/gems/test-kitchen-1.15.0/lib/kitchen/configurable.rb:206:in `block in expand_paths!'
@etki
etki / Dockerfile.echo
Last active August 31, 2017 04:43
Hello-world with exclamation suffix
FROM alpine
ENTRYPOINT ["/bin/sh", "-c", "echo \"Hello $1!\"", "hello-world"]
CMD ["World"]
# docker run --rm -ti -v $(pwd):/tmp/jmh-benchmark -w /tmp/jmh-benchmark ubuntu:18.04 bash
apt-get update
apt-get install curl -y
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
jabba install [email protected]
jabba use [email protected]
which java # /root/.jabba/jdk/[email protected]/bin/java
java -jar target/benchmarks.jar BenchmarkLoop
@etki
etki / Main.java
Last active October 19, 2020 14:30
Building hsdis for multiple java versions and architectures on linux using docker
class Main {
public static void main(String[] args) {
long completion = System.currentTimeMillis() + 1_000;
int accumulator = 1;
while (System.currentTimeMillis() < completion) {
accumulator = permutate(accumulator);
}
System.exit(accumulator - accumulator);
}
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Threads;
javascript:['layer_bg', 'layer_wrap', 'box_layer_bg', 'box_layer_wrap'].map(id => document.getElementById(id)).filter(e => e).forEach(e => e.style.top = '-100%');document.body.style.overflow = null;
@etki
etki / 1-setup.yaml
Created August 22, 2020 11:36
Nested elasticsearch agg
# PUT localhost:9200/index
{
"mappings": {
"properties": {
"nested": {
"type": "nested",
"properties": {
"values": {
"type": "keyword"
@etki
etki / intentional-branching.prof
Created October 6, 2020 00:58
Make It Visible A01: Java's Math.max
IntentionalBranching.run constant avgt 10 84.038 ± 0.053 us/op
IntentionalBranching.run:CPI constant avgt 0.297 #/op
IntentionalBranching.run:L1-dcache-load-misses constant avgt 14347.870 #/op
IntentionalBranching.run:L1-dcache-loads constant avgt 524225.003 #/op
IntentionalBranching.run:L1-dcache-stores constant avgt 163851.052 #/op
IntentionalBranching.run:L1-icache-load-misses constant avgt 9.608 #/op
IntentionalBranching.run:LLC-load-misses constant avgt 1.101 #/op
IntentionalBranching.run:LLC-loads constant avgt 296.037 #/op
IntentionalBranching.run:LLC-store-misses constant avgt 0.103 #/op
IntentionalBranching.run:LLC-stores constant avgt 1.339