Skip to content

Instantly share code, notes, and snippets.

View ndelitski's full-sized avatar

Nick Delitski ndelitski

  • Lisbon, Portugal
  • 13:14 (UTC -12:00)
View GitHub Profile
@ndelitski
ndelitski / docker-snippets.sh
Created October 11, 2015 10:40
docker snippets
#clean all exited images
docker ps -a | grep 'Exited' | awk '{print $1}' | xargs -n1 docker rm
@ndelitski
ndelitski / common-config.fish
Last active October 11, 2015 20:54
fish ec2 alias
# setup vim mode
set fish_key_bindings fish_vi_key_bindings
#
# Common aliases
#
alias fe="vi ~/.config/fish/config.fish"
alias rld-fsh="source ~/.config/fish/config.fish"
#
@ndelitski
ndelitski / synccloud.conf.redis.conf
Created October 11, 2015 23:04
configuration for Redis in configuration service 😄
Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
upstream rancher {
server rancher-server:8080;
}
server {
listen 80;
server_name rancher.synccloud.com;
location / {
proxy_set_header Host $host;
2015-10-12 16:25:07,225 ERROR [d57be8d4-68c6-4b6d-b0f0-e308053dc04f:1656] [instance:141] [instance.start->(InstanceStart)] [] [cutorService-16] [i.c.p.process.instance.InstanceStart] Failed to Scheduling for instance [141]
2015-10-12 16:25:07,575 ERROR [75900548-20bd-44f0-a62b-ee41b152ac5d:1659] [instance:142] [instance.start->(InstanceStart)->instance.allocate->(InstanceAllocate)] [] [cutorService-23] [c.p.a.e.i.AllocatorEventListenerImpl] No allocator handled [EventVO [id=a8a6d026-23d7-46d2-95f9-178fdb2ec39c, name=instance.allocate, previousNames=null, replyTo=reply.8787793340769848252, resourceId=142, resourceType=instance, publisher=null, transitioning=null, transitioningMessage=null, transitioningInternalMessage=null, previousIds=null, data={}, time=Mon Oct 12 16:25:07 UTC 2015, listenerKey=null, transitioningProgress=null]]
2015-10-12 16:25:07,578 ERROR [75900548-20bd-44f0-a62b-ee41b152ac5d:1659] [instance:142] [instance.start->(InstanceStart)->instance.allocate] [] [cutorService-25] [c.p.e.p.i.Defau
#! /bin/bash
set -eou pipefail
#usage: sudo ./docker-cleanup-volumes.sh [--dry-run]
docker_bin=$(which docker.io 2> /dev/null || which docker 2> /dev/null)
# Default dir
dockerdir=/var/lib/docker
#!/bin/bash
set -e
repo=${DOCKER_REGISTRY}
[ -z "${DOCKER_REGISTRY}" ] && (echo "DOCKER_REGISTRY is missing"; exit 1)
image=$(node -p "$(cat <<EOF
require('./package.json').name.replace('synccloud.','');
EOF
)")
@ndelitski
ndelitski / generate_docker_cert.sh
Created November 13, 2015 00:27 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
#!/bin/bash
c=0;
while true;
let c=c+1;
redis-cli -h redis set "/conf/hello/count" "$c";
sleep 10;
done
@ndelitski
ndelitski / netcat.sh
Last active October 14, 2020 09:09
measure network speed with netcat
# on server machine
nc -v -v -l -n -p 2222 >/dev/null
# on client machine. transfer 2GB
dd if=/dev/zero bs=2100004096 count=1 | nc 172.30.1.171 2222