Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files
- Install grip
$ pip install grip
- Install wkhtmltopdf
$ sudo apt-get install wkhtmltopdf
javascript:(function(){ | |
var jsCode=document.createElement('script'); | |
jsCode.setAttribute('src','https://gist.github.com/M1ke/4944552/raw/17d5768dab89f3737104202b4fc7a56d286fc4c7/trello-timer.js'); | |
document.body.appendChild(jsCode); | |
}()); |
#!/bin/sh | |
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; | |
do | |
echo $output | |
used=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 ) | |
partition=$(echo $output | awk '{ print $2 }' ) | |
if [ $usep -ge 80 ]; then | |
echo "The partition \"$partition\" on $(hostname) has used $used% at $(date)" | mail -s "Disk space alert: $used% used" your@email.com | |
fi | |
done |
# https://stackoverflow.com/a/28641626/518703 | |
def decode_ddb: | |
def _sprop($key): select(keys == [$key])[$key]; # single property objects only | |
((objects | { value: _sprop("S") }) # string (from string) | |
// (objects | { value: _sprop("NULL") | null }) # null (from boolean) | |
// (objects | { value: _sprop("B") }) # blob (from string) | |
// (objects | { value: _sprop("N") | tonumber }) # number (from string) | |
// (objects | { value: _sprop("BOOL") }) # boolean (from boolean) | |
// (objects | { value: _sprop("M") | map_values(decode_ddb) }) # map (from object) | |
// (objects | { value: _sprop("L") | map(decode_ddb) }) # list (from encoded array) |
const apiGWEventFromReq = (req: Request): APIGatewayEvent => { | |
const [headers, multiValueHeaders] = Object.keys(req.headers).reduce((parts, key) => { | |
const val = req.headers[key] | |
if (!val) { | |
return parts | |
} | |
const [headers, multiValueHeaders] = parts | |
if (Array.isArray(val)) { | |
multiValueHeaders[key] = val; | |
} else { |
<?php | |
const PSALM_STRING = ': string'; | |
const SELECT_ALL = '*'; | |
// These must be upper case to avoid accidental positives | |
const SQL_SELECT = 'SELECT'; | |
const SQL_FROM = 'FROM'; | |
const ARG_DEBUG = '--debug'; | |
// This is lower case as the field names are forced to lower case | |
const SQL_AS = ' as '; |
pipelines: | |
# Manually triggered Pipelines | |
custom: | |
composer-update: | |
- step: | |
name: Composer Update | |
image: prooph/composer:<pick your version, e.g 7.4> | |
script: | |
- export COMPOSER_BRANCH="composer-update-auto-$(date +"%Y-%m-%d")" | |
- git checkout -b "$COMPOSER_BRANCH" |
#!/bin/bash | |
# Install grip $ pip install grip | |
# Install wkhtmltopdf $ sudo apt-get install wkhtmltopdf | |
md=$1 | |
pdf=$md.pdf | |
port=$(( ( RANDOM % 6000 ) + 5000 )) | |
echo $port |
Using EC2 instances within an autoscaling group is the best way to guarantee redundancy, scalability and fault tolerance across your infrastrucutre.
This comes at the price of common paradigms such as being able to SSH into a known URL to manage configuration or logs, and the requirement that configurations must be applied to multiple machines.
DevOps provisioning tools such as Puppet can be used to manage configurations, but they
<?php | |
/* | |
* Declare the following consts: | |
* | |
* REPO_DEFAULT - Set this to avoid having to type each time | |
* TEAM - Find this in URLs | |
* USER, PASS - Bitbucket credentials | |
* | |
* Install Guzzle and require './vendor/autoload.php' | |
*/ |