Annoying message?
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
#!/usr/bin/env python | |
import hashlib | |
import optparse | |
import paramiko | |
from Crypto.PublicKey import RSA | |
def insert_char_every_n_chars(string, char='\n', every=64): | |
return char.join( |
The problem: | |
I wanted to use the jinja 'map' filter to modify each item in a string, in this simple | |
example, adding '.conf' to each item. | |
The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately, | |
it uses 'value' as the pattern. When called inside map 'value' is the current item in | |
the list, or in other words *args as far as format is concerned. So it's the wrong way | |
around. |
# Automated AMI Backups | |
# | |
# @author Robert Kozora <[email protected]> | |
# | |
# This script will search for all instances having a tag with "Backup" or "backup" | |
# on it. As soon as we have the instances list, we loop through each instance | |
# and create an AMI of it. Also, it will look for a "Retention" tag key which | |
# will be used as a retention policy number in days. If there is no tag with | |
# that name, it will use a 7 days default value for each AMI. | |
# |
""" | |
Suspend an auto scaling group's scaling processes that can interfere with CodeDeploy deploys. | |
It assumes a single ASG per deployment group. | |
To use this: | |
* create a lambda function with this code, then hook up it up to an SNS topic that receives all deployment events (but not host events). | |
* attach that topic as a trigger in your deployment groups. | |
Unlike AWS's in-appspec approach, this supports arbitrary deploy concurrency. |
#!/bin/bash | |
# mk-eph.sh | |
# Creates a lvm volume over all ephemeral devices. | |
# Swap related operations | |
function SwapEnabler() { | |
local swapdev='/dev/ephemeral/swap' | |
local swapon="$(swapon -s | wc -l)" | |
# See if some swap is enabled already. |
var table = document.getElementsByClassName('advanced_dns')[0]; | |
var rows = table.getElementsByTagName('tr'); | |
var i, len, row; | |
var hostname, type, priority, ttl, destination; | |
var output = ''; | |
output += '$TTL 600\n'; // start with default TTL | |
// skip header and last two rows (add new entry, delete all entries) | |
for (i = 1, len = rows.length - 2; i < len; i++) { |
[Unit] | |
Description=Backup with restic to Backblaze B2 | |
OnFailure=status-email-user@%n.service | |
[Service] | |
Type=simple | |
Nice=10 | |
ExecStart=/usr/local/sbin/restic_backup.sh | |
# $HOME or $XDG_CACHE_HOME must be set for restic to find /root/.cache/restic/ | |
Environment="HOME=/root" |
write-host "`n ## NODEJS INSTALLER ## `n" | |
### CONFIGURATION | |
# nodejs | |
$version = "4.4.7-x64" | |
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi" | |
# git | |
$git_version = "2.9.2" |
Data Size: | |
Input: 2074 | |
LZ4: 758 (0.37) | |
Snappy: 676 (0.33) | |
LZF: 697 (0.34) | |
ZLIB: 510 (0.25) | |
LZ4 / Snappy: 1.121302 | |
LZ4 / LZF: 1.087518 | |
LZ4 / ZLIB: 1.486275 | |
Benchmark: 50000 calls |