Skip to content

Instantly share code, notes, and snippets.

View gmas's full-sized avatar

George Masgras gmas

  • Barcelona
  • 23:42 (UTC +02:00)
View GitHub Profile
@gmas
gmas / gist:33176ef31674ff4aae8b
Created February 29, 2016 22:36
node-exporter
time="2016-02-29T22:35:02Z" level=warning msg="Ignoring sample with out-of-order timestamp for fingerprint d0cb7cc069190c3d (process_cpu_seconds_total{instance=\"172.32.4.130\", job=\"prometheus-haproxy-exporter\"}): 1456785302.002 is not after 1456785302.069" source="storage.go:577"
time="2016-02-29T22:35:02Z" level=warning msg="Ignoring sample with out-of-order timestamp for fingerprint f3460411bc5d628e (process_max_fds{instance=\"172.32.4.130\", job=\"prometheus-haproxy-exporter\"}): 1456785302.002 is not after 1456785302.069" source="storage.go:577"
time="2016-02-29T22:35:02Z" level=warning msg="Ignoring sample with out-of-order timestamp for fingerprint 002e8a697d2ebabe (process_open_fds{instance=\"172.32.4.130\", job=\"prometheus-haproxy-exporter\"}): 1456785302.002 is not after 1456785302.069" source="storage.go:577"
time="2016-02-29T22:35:02Z" level=warning msg="Ignoring sample with out-of-order timestamp for fingerprint a2d5631ed1f015da (process_resident_memory_bytes{instance=\"172.32.4.130\", job=\"
@gmas
gmas / iosnoop 10s
Last active December 23, 2015 19:05
iostat Prom
root@ip-172-32-4-74:/usr/local/src/perf-tools/bin# ./iosnoop -stQ 10
Tracing block I/O for 10 seconds (buffered)...
STARTs ENDs COMM PID TYPE DEV BLOCK BYTES LATms
13970838.483837 13970838.484444 prometheus 32188 WS 202,0 21937465 4096 0.61
13970838.484494 13970838.485483 jbd2/xvda1-2 203 WS 202,0 4578041 45056 0.99
13970838.485500 13970838.486089 jbd2/xvda1-2 203 WS 202,0 4578129 4096 0.59
13970839.443401 13970839.444029 prometheus 32188 WS 202,0 21937473 4096 0.63
13970839.444072 13970839.445037 jbd2/xvda1-2 203 WS 202,0 4578137 36864 0.96
13970839.445066 13970839.445688 jbd2/xvda1-2 203 WS 202,0 4578209 4096 0.62
13970840.402997 13970840.403654 prometheus 32188 WS 202,0 21937481 4096 0.66
@gmas
gmas / PKGBUILD
Created November 29, 2015 02:23 — forked from anish/PKGBUILD
kubernetes 1.0.7 PKGBUILD
#Maintainer: Iwan Timmer <[email protected]>
Contributor: Anish Bhatt <[email protected]>
pkgname=kubernetes
pkgver=1.0.7
pkgrel=1
pkgdesc="Container Cluster Manager for Docker"
depends=('glibc')
makedepends=('go' 'rsync')
optdepends=('etcd: etcd cluster required to run Kubernetes')
@gmas
gmas / ruby.vim
Last active September 2, 2015 17:36
remove scroll lag in Ruby files
"~/.vim/after/syntax/ruby.vim
syntax clear rubySymbol
syntax clear rubyPredefinedConstant
@gmas
gmas / clean_docker_images
Created May 2, 2015 03:54
cleanup unused docker containers and images
#!/usr/bin/env bash
#set IFS to split lines into words
IFS=$'\n'
#find old stopped containers
OLD_CONTAINERS=( $(docker ps -a| grep -v latest | grep -v 'IMAGE' | awk '{print $1}') )
#find images older than 1 day
OLD_IMGS=( $(docker images | grep -v latest | grep 'days\|week\|month\|year' | awk '{print $3}') )
unset IFS
echo "found ${#OLD_CONTAINERS[@]} old/unused containers"
@gmas
gmas / ssh_config
Created April 3, 2015 01:36
SSH through jump server
#ssh_config
#use with ssh -F ssh_config user@<TARGET_SERVER_IP>
Host *
ServerAliveInterval 60
TCPKeepAlive yes
ProxyCommand ssh -q -A gmasgras@<JUMP_SERVER_IP> nc %h %p
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 8h
User ubuntu
#/var/lib/dhcpcd/dhcpcd-tun1.info
GATEWAYS=10.4.3.73
@gmas
gmas / gist:acec677882e7e1eff65b
Created March 18, 2015 20:58
decompress/compress file on the fly
# unzip -p outputs uncompressed data to pipe(stdout)
# gzip -c outputs compressed data to stdout
unzip -p original.sql.zip | gzip -c > test.sql.gz
@gmas
gmas / deploy.sh
Created March 16, 2015 18:00
deploy to Beanstalk through Dockerhub
#! /bin/bash
SHA1=$1
BUILD_NUM=$2
# Push image to Docker Registry
docker commit `docker run -d portaldev_web` $DOCKER_REPO:$SHA1
docker push $DOCKER_REPO:$SHA1
# Create Elastic Beanstalk zipped source bundle
DOCKERRUN_FILE=Dockerrun.aws.json
@gmas
gmas / circle.yml
Created March 16, 2015 17:59
Circle w/ Docker
machine:
services:
- docker
checkout:
post:
# reset mtime to actual changed time in order to have Docker use the cached Gemfile
- for x in Gemfile* ; do touch -t $(date -d "$(git log -1 --format=%ci "${x}")" +%y%m%d%H%M.%S) "${x}"; done
dependencies: