- copy the file
commit-msg
to.git/hooks/commit-msg
- make sure your delete the sample file
.git/hooks/commit-msg.sample
- Make commit msg executable.
chmod +x .git/hooks/commit-msg
- Edit
commit-msg
to better fit your development branch, commit regex and error message - Profit $$
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
# encoding: UTF-8 | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# More info at http://bundler.io/gemfile.html | |
source 'https://rubygems.org' | |
# Used when running the tests against different Chef versions: | |
chef_version = ENV.key?('CHEF_VERSION') ? ENV['CHEF_VERSION'] : nil |
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
curl -sL -w "%{http_code}" "http://somesite.com" -o /dev/null |
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
import datetime as dt | |
import time | |
import unittest | |
def aws_age_seconds(ec2_launch_time): | |
""" | |
Parse the ec2 launch time string and return how old it is in seconds. | |
""" | |
# Strip trailing subsecond part |
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
#!/usr/bin/python | |
import random | |
import time | |
import statsd | |
ctr_name = 'stats.test.1' | |
while True: | |
client = statsd.StatsClient('localhost', 8125) | |
rand = random.randrange(1, 250) | |
print('count: (%d)' % rand) |
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
/** | |
* Build for production: | |
* $ NODE_ENV=production webpack | |
* | |
* Build for staging or development mode | |
* $ webpack | |
* | |
* Run app server in dev mode and use Hot Module Replacement | |
* $ NODE_ENV=webpack nodemon --watch ./app index.js | |
* |
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
# file: roles/common/tasks/item.yml | |
- name: be sure basic packages are installed | |
apt: pkg={{item}} state=latest update_cache=yes | |
tags: common | |
with_items: | |
- git | |
- subversion | |
- vim | |
- block: |
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
# Default termtype. If the rcfile sets $TERM, that overrides this value. | |
set -g default-terminal screen-256color | |
# support logging out and back in | |
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION" | |
# pbcopy support | |
set-option -g default-command "reattach-to-user-namespace -l bash" | |
# vi mode |
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
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
$ ansible-playbook --version | |
ansible-playbook 1.9.3 | |
configured module search path = ~/git/ansible-modules-core:~/git/ansible-modules-extra:./library | |
$ ansible-playbook play.yml | |
ok: [localhost] |
When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.
Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code>
that will steal hours from your productivity.
So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).