NOTE: 534 stars, 106 forks. I love you all. Please contribute tips and edits back to this cheat sheet -- email's [email protected] and you can treat gists like git repositories and send git diffs.
############################################################################### | |
## Monit control file | |
############################################################################### | |
## | |
## Comments begin with a '#' and extend through the end of the line. Keywords | |
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | |
## | |
## Below you will find examples of some frequently used statements. For | |
## information about the control file, a complete list of statements and | |
## options please have a look in the monit manual. |
This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec
plugin.
This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.
This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec
plugin in collectd to execute the collectd-docker.sh
script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.
#!/bin/bash | |
# Check out the blog post at: | |
# | |
# http://www.philipotoole.com/influxdb-and-grafana-howto | |
# | |
# for full details on how to use this script. | |
AWS_EC2_HOSTNAME_URL=http://169.254.169.254/latest/meta-data/public-hostname | |
INFLUXDB_DATABASE=test1 |
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
See my DASH-IF presentation from October, 2014: | |
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/ | |
1. encode multiple bitrates with keyframe alignment: | |
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \ | |
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4 | |
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment | |
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012. |
When using virtual machines for testing web apps in various browsers (e.g. Internet Explorer), I have found it rather tedious having to continually tweak the hosts file within each new VM for the purpose of adding entries pointing back to the host machine's development web server address.
Instead, the steps below will setup Dnsmasq on a Ubuntu 14.04LTS or 12.04LTS host machine for the purpose of serving both it's own DNS queries and that of virtual machine guests. Dnsmasq will parse your host's /etc/hosts
file where we will keep a single set of DNS entires to our test web applications.
configurations { | |
apt | |
} | |
dependencies { | |
compile 'com.squareup.dagger:dagger:1.1.0' | |
apt 'com.squareup.dagger:dagger-compiler:1.1.0' | |
} | |
android.applicationVariants.all { variant -> |
# PROJECT `.gitignore` | |
# put it in the *root* of your project | |
# most likely just append this line to the already existing file | |
/secret.properties |
package de.tutorials.training.java8.lambda; | |
import java.util.stream.IntStream; | |
import static java.lang.Math.*; | |
import static java.util.concurrent.ThreadLocalRandom.*; | |
/** | |
* Author: Thomas Darimont | |
*/ |