Skip to content

Instantly share code, notes, and snippets.

Timur milovtim

  • MTVv
  • Saint-Petersburg
View GitHub Profile
@kekru
kekru / Docker connect to remote server.md
Last active Mar 23, 2019
Connect to another host with your docker client, without modifying your local Docker installation
View Docker connect to remote server.md

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.
For HTTPS connection use whiledo/docker-remote-api-tls.

@renatoathaydes
renatoathaydes / webServer.groovy
Last active Mar 20, 2019
A simple web server written in Groovy that provides static and code-generated content
View webServer.groovy
#!/usr/bin/env groovy
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import groovy.servlet.*
@Grab(group='org.eclipse.jetty.aggregate', module='jetty-all', version='7.6.15.v20140411')
def startJetty() {
def server = new Server(8080)
@soarez
soarez / ca.md
Last active Apr 20, 2019
How to setup your own CA with OpenSSL
View ca.md

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@kofemann
kofemann / GuavaCacheMXBean.java
Created Sep 25, 2013
Expose Google's guava Cache vie JMX
View GuavaCacheMXBean.java
public interface GuavaCacheMXBean {
public long getRequestCount();
public long getHitCount();
public double getHitRate();
public long getMissCount();
@epicserve
epicserve / redis_key_sizes.sh
Last active Apr 11, 2019
A simple script to print the size of all your Redis keys.
View redis_key_sizes.sh
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
You can’t perform that action at this time.