Skip to content

Instantly share code, notes, and snippets.

View timbuchwaldt's full-sized avatar

Tim Buchwaldt timbuchwaldt

View GitHub Profile
FROM elixir as build
RUN mix local.hex --force && mix local.rebar --force
ADD .depscache/ /app/
RUN cd /app && mix deps.get && mix deps.compile && MIX_ENV=test mix deps.compile && MIX_ENV=prod mix deps.compile
FROM elixir
RUN mix local.hex --force && mix local.rebar --force
ADD . /app
COPY --from=build /app/_build /app/_build
- GPG Token (Yubikey)
- Zentraler Server mit Keystore
- Annahme von E-Mails am Mailserver nur wenn verschlüsselt + signiert (z.B. via https://github.com/flashmob/go-guerrilla)
Setup
- Empfang eines USB GPG-Tokens (Yubikey)
- Empfang einer PIN zum Setup (Getrennte Sendung, hier könnte man durchaus noch anders sichern, evtl Video ID / nPA o.Ä. um Fake-Anmeldungen zu verhindern)
- Key wird auf Token generiert, mit Upload-PIN nach Erstellen hochgeladen
- Key wird zum Restore (wie Bitcoin-Wallet) als Text exportiert
defmodule MyAPI do
use Tesla
adapter Tesla.Adapter.Hackney
plug Tesla.Middleware.BaseUrl, "http://127.0.0.1:4000"
def foo(client, login) do
get(client, "/foo")
end
{
"imported": {
"919B0EBE-36BA-4751-B3F5-D51EC1E2666E": {
"vclock": {"919B0EBE-36BA-4751-B3F5-D51EC1E2666E": 13, "B55FBBD9-3260-4819-B79F-CF04A282C984": 18}
},
"B55FBBD9-3260-4819-B79F-CF04A282C984": {
"vclock": {"919B0EBE-36BA-4751-B3F5-D51EC1E2666E": 13, "B55FBBD9-3260-4819-B79F-CF04A282C984": 18}
}
},
"accounts": {
{"database":"foo","points":[{"fields":{"value":0.64},"name":"foo","tags":["foo","bar"]}]}
"{\"database\":\"foo\",\"points\":[{\"fields\":{\"value\":0.64},\"name\":\"foo\",\"tags\":[\"foo\",\"bar\"]}]}"

Keybase proof

I hereby claim:

  • I am timbuchwaldt on github.
  • I am timbuchwaldt (https://keybase.io/timbuchwaldt) on keybase.
  • I have a public key whose fingerprint is 2F45 DB2A 5552 9B08 CF10 9B51 5CA9 6074 8C8A 6254

To claim this, I am signing this object:

>> awacs start parkingscout
Starting environment parkingscout:
- redis [OK]
- elasticsearch [OK]
- postgresql [OK]
>> awacs ls
Running environments:
- parkingscout
@timbuchwaldt
timbuchwaldt / gist:6225369
Created August 13, 2013 20:30
json pagination
{
"results": [
....
],
"pagination":{
"total":321,
"pages":21,
"current":1
},
"links":{
@timbuchwaldt
timbuchwaldt / redis.rb
Created December 5, 2012 13:07
Redis Performance Benchmark
require 'rubygems'
require 'hiredis'
require 'redis'
require 'json'
require 'msgpack'
script = <<EOF
redis.call('get', 'a')
redis.call('get', 'b')
redis.call('get', 'c')