Get EC2 CloudWatch stats and graph them in Dashing.
The graphing widget shows graphs using the Rickshaw graphing library. The names of data fields should be (vaguely) familiar if you've used Rickshaw before.
It's recommended that you replace the /assets/javascripts/rickshaw.min.js from your dashboard with the latest from here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module CarrierWave | |
| module Storage | |
| class Fog | |
| class File | |
| alias :store_without_safety_net :store | |
| def store(new_file) | |
| retries_remaining = 3 | |
| begin | |
| store_without_safety_net(new_file) | |
| rescue Excon::Errors::SocketError => e |
I hereby claim:
- I am hsatac on github.
- I am hsatac (https://keybase.io/hsatac) on keybase.
- I have a public key whose fingerprint is ADD9 28DD E493 F920 2342 AE5E 04AC 2752 62A8 F4E9
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ruby -rsidekiq/api -e 'loop do;count = Sidekiq::Stats.new.enqueued;puts "Remaining jobs: #{count}";exit if count == 0;sleep 5;end' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker build --rm -t $JOB_NAME/$BUILD_NUMBER . | |
| docker run $JOB_NAME/$BUILD_NUMBER | perl -pe '/Failed examples:/ && `echo "fail" > docker-tests-failed`' | |
| if [ ! -f docker-tests-failed ]; then | |
| echo -e "No docker-tests-failed file. Apparently tests passed." | |
| else | |
| echo -e "docker-tests-failed file found, so build failed." | |
| rm docker-tests-failed | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exec { "postgresql-template1-utf8": | |
| command => "psql -c \"update pg_database set datistemplate=false where datname='template1';\" && | |
| psql -c 'drop database Template1;' && | |
| psql -c \"create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;\" | |
| ", | |
| user => "postgres", | |
| path => "/usr/bin", | |
| unless => "/usr/bin/psql -Atc \"select pg_encoding_to_char(encoding) from pg_database where datname='template1'\" | /bin/grep -c UTF8" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y | |
| sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" | |
| sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" | |
| sudo su - postgres -c "service postgresql stop" | |
| sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| apt-get install --yes lsb-release | |
| DISTRIB_CODENAME=$(lsb_release --codename --short) | |
| DEB="puppetlabs-release-${DISTRIB_CODENAME}.deb" | |
| DEB_PROVIDES="/etc/apt/sources.list.d/puppetlabs.list" # Assume that this file's existence means we have the Puppet Labs repo added | |
| if [ ! -e $DEB_PROVIDES ] | |
| then | |
| # Print statement useful for debugging, but automated runs of this will interpret any output as an error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'digest' | |
| filename = "House.Of.Cards.2013.S02E01.720p.WEB-DL.x264-Sohu.mp4" | |
| f = File.new(filename, "rb") | |
| puts f.stat.inspect | |
| file_size = File.size?(filename) | |
| offset = [] |