Skip to content

Instantly share code, notes, and snippets.

@obazoud
obazoud / clean-docker.sh
Last active September 27, 2022 04:56
Remove docker image without tag
#!/bin/bash
sudo docker stop $(docker ps -a -q)
sudo docker rm $(docker ps -a -q)
sudo docker ps -a | grep 'months ago' | awk '{print $1}' | xargs sudo docker rm
sudo docker images | grep "\<none\>" | awk '{ print $3 }' | xargs sudo docker rmi
@obazoud
obazoud / Dockerfile
Last active December 22, 2015 04:58
Build Docker images - Jenkins - https://index.docker.io/u/obazoud/jenkins/
# Install Jenkins 1.529 on Ubuntu 12.10
# Build
# sudo docker run -p 8080:8080 -i -t obazoud/jenkins /bin/bash
# Install
# sudo docker pull obazoud/jenkins
# Use
# cd /opt && java -jar jenkins.war
@obazoud
obazoud / puppet-agent.sh
Created September 11, 2013 06:47
Append hostname and current timestamp in puppet logs
cd /etc/puppet/ && puppet agent --test --environment=$1 --verbose --debug 2>&1 | awk -v hostname=$(hostname) '{print hostname" - " strftime("%Y-%m-%d %H:%M:%S") " - " $0}'
@obazoud
obazoud / gist:6520354
Created September 11, 2013 07:31 — forked from dch/gist:4148379
Carbon relay - performance
alias(color(sumSeries(group(carbon.agents.*.updateOperations)), "blue"),"Updates")
alias(color(sumSeries(group(carbon.agents.*.metricsReceived)), "green"), "Metrics Received")
alias(color(sumSeries(group(carbon.agents.*.committedPoints)),"orange"),"Committed Points"))
alias(secondYAxis(color(sumSeries(group(carbon.agents.*.pointsPerUpdate)),"yellow")),"PPU")
alias(secondYAxis(color(averageSeries(group(carbon.agents.*.cpuUsage)),"red")),"CPU (avg)")
alias(secondYAxis(color(sumSeries(group(carbon.agents.*.creates)),"purple")),"Creates")
Metrics received
carbon.agents.*.metricsReceived
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade
@obazoud
obazoud / Graphite - Relay - Collectd
Last active March 16, 2017 20:04
Install Graphite / Collectd in Ubuntu 12.04 (precise 64)
ssh -p 2222 -R 2204:192.168.7.176:2204 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR -o IdentitiesOnly=yes -i ~/.vagrant.d/insecure_private_key vagrant@127.0.0.1
@obazoud
obazoud / style.css
Created October 26, 2013 15:27
voyages-sncf.com - stylish
#breadcrumb {
display:none;
}
#header {
display:none;
}
#pre-header {
display:none;
}
wget --no-cookies --header "Cookie: s_nr=1359635827494; s_cc=true; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk6downloads-1902814.html; s_sq=%5B%5BB%5D%5D; gpv_p24=no%20value" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

boxes = [
{ :name => :default, :role => 'default', :ip => '10.11.12.13' },
{ :name => :stats, :role => 'stats', :ip => '10.11.12.14' },
{ :name => :something, :role => 'something', :ip => '10.11.12.15' },
{ :name => :jenkins, :role => 'jenkins', :ip => '10.11.12.16', :http_forward => 8080 },
{ :name => :buildagent, :role => 'buildagent', :ip => '10.11.12.17', :http_forward => 8080 },
{ :name => :something, :role => 'something', :ip => '10.11.12.18' }
]
Vagrant::Config.run do |config|