Skip to content

Instantly share code, notes, and snippets.

View mlotysz's full-sized avatar

Maciej Łotysz mlotysz

  • Szczecin, Poland
View GitHub Profile
8.4. Timing events
------------------
Timers provide a great help in troubleshooting network problems. All values are
reported in milliseconds (ms). These timers should be used in conjunction with
the session termination flags. In TCP mode with "option tcplog" set on the
frontend, 3 control points are reported under the form "Tw/Tc/Tt", and in HTTP
mode, 5 control points are reported under the form "Tq/Tw/Tc/Tr/Tt" :
- Tq: total time to get the client request (HTTP mode only). It's the time
@alandipert
alandipert / ec2query.boot
Last active July 31, 2018 16:33
Example of querying AWS infrastructure with Amazonica and Datomic, in Clojure with Boot-clj
#!/usr/bin/env boot
;; or `BOOT_FILE=ec2query.boot boot repl' for interactive use
(set-env! :dependencies '[[amazonica "0.3.23"]
[com.datomic/datomic-free "0.9.5344"]])
(require '[amazonica.aws.ec2 :as ec2]
'[amazonica.core :refer [defcredential]]
'[boot.cli :refer [defclifn]]
'[boot.util :refer [info]]
@mrserverless
mrserverless / MultiTenantDataSource
Last active February 17, 2017 09:52
Dropwizard MultiTenant DataSource using RequestScope injected Schema object
public class MultiTenantDataSource implements ManagedDataSource {
private final ManagedDataSource managedDataSource;
private final SchemaResolver schemaResolver;
public MultiTenantDataSource( final ManagedDataSource managedDataSource, final SchemaResolver schemaResolver )
{
this.managedDataSource = managedDataSource;
this.schemaResolver = schemaResolver;
}
public class CurrentUserLoggingFilter implements Filter {
public static final String MDC_CURRENT_ACCOUNT_ID_KEY = "CurrentAccountId";
@Context
HttpContext context;
@Override
public void init(FilterConfig filterConfig) throws ServletException { /* unused */ }
@Sch3lp
Sch3lp / DropWizardHibernateRule
Last active August 29, 2015 13:56
Dropwizard-hibernate integration test using a Rule
package org.yourcompany.test;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import javax.sql.DataSource;
@dejanr
dejanr / README
Last active June 11, 2023 20:35
OSX, X11, dwm, urxvt, vim environment
OSX Apps
- Total Spaces, for keeping X11 in different space and faster switching
- MenuAndDockless for hidding topbar menu
X11 - Macports
- sudo port install xorg-server
- sudo port install xinit
- sudo port install terminus-font dejavu-fonts bitstream-fonts
Suckless - suckless.org
@sargun
sargun / gist:5693318
Created June 2, 2013 11:07
New Upstart Script style
description "service"
start on filesystem
stop on runlevel S
respawn
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
@areina
areina / emacs-email-setup.md
Created October 12, 2012 15:00
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@kimble
kimble / ApplicationGuiceModule.java
Created May 6, 2012 19:01
Dropwizard instrumentation of Guice beans annotated with @timed
package com.developerb.dropbot;
import com.developerb.dropbot.instrumentation.MethodInvocationTimingInterceptor;
import com.google.inject.AbstractModule;
import com.yammer.metrics.annotation.Timed;
import static com.google.inject.matcher.Matchers.annotatedWith;
import static com.google.inject.matcher.Matchers.any;
/**