Skip to content

Instantly share code, notes, and snippets.

View hSATAC's full-sized avatar
🐈
Cataholic

Ash Wu hSATAC

🐈
Cataholic
View GitHub Profile
@hSATAC
hSATAC / commit-msg
Created February 12, 2014 10:23 — forked from remi/commit-msg
#!/usr/bin/env ruby
# 1. Install hunspell
# $ brew install hunspell
# 2. Download a dictionary and install it in a path listed by `hunspell -D`
# $ open http://wiki.services.openoffice.org/wiki/Dictionaries
# 3. Move this file into your repository
# $ mv commit-msg /path/to/repo/.git/hooks
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 = []
#!/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
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"'
ruby -rsidekiq/api -e 'loop do;count = Sidekiq::Stats.new.enqueued;puts "Remaining jobs: #{count}";exit if count == 0;sleep 5;end'

Keybase proof

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:

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

Graphing Widget

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.

Supported HTML data fields

Get EC2 CloudWatch stats and graph them in Dashing.