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
If you have a huge repository (in size and in history) and want to add a subfolder | |
to your project as a submodule you can follow this example to save time and space | |
using git's shallow clone and shallow checkout feature. It is a bit more complicated | |
in this example because I assume that you want your submodule to track a non-default | |
branch, called `mybranch`, instead of the `master` branch. Things could probably get | |
a lot simpler when using the default branch. After following the commands in these | |
examples you can use `git submodule update` and `git submodule update --remote` as normal. |
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
# -*- coding: utf-8 -*- | |
# To the extent possible under law, the author of this work, Konstantinos | |
# Koukopoulos, has waived all copyright and related or neighboring rights to | |
# "Python codec for Wobbly Transformation Format - 8-bit (WTF-8)". It is | |
# dedicated to the public domain, as described in: | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
# This work is published from Greece and is available here: | |
# https://gist.github.com/kouk/d4e1faababf14b09b27f | |
from __future__ import unicode_literals, print_function | |
import six |
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
from itertools import islice | |
from igrouper import igrouper | |
test = [] | |
for batch in list(igrouper(range(24), 5)): | |
test.append(list(batch)) | |
assert test == [[], [], [], [], []] |
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/sh -e | |
# cf. https://github.com/wal-e/wal-e/issues/206 | |
cutoff=`date -u -d '1 month ago' +%s` | |
latest=`date -u +%s` | |
wal-e --terse backup-list | tail -n +2 | { | |
# find the oldest backup after the cutoff date | |
while IFS= read -r line; do | |
last_modified_date=`echo $line|awk '{print $2}'` | |
last_modified=`date -u -d "$last_modified_date" +%s` | |
if [ $last_modified -gt $cutoff -a $last_modified -lt $latest ]; then |
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
2018/09/25 14:14:32 [INFO] Terraform version: 0.11.7 41e50bd32a8825a84535e353c3674af8ce799161 | |
2018/09/25 14:14:32 [INFO] Go runtime version: go1.10.1 | |
2018/09/25 14:14:32 [INFO] CLI args: []string{"/bin/terraform", "apply"} | |
2018/09/25 14:14:32 [DEBUG] Attempting to open CLI config file: /home/ansible/.terraformrc | |
2018/09/25 14:14:32 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2018/09/25 14:14:32 [INFO] CLI command args: []string{"apply"} | |
2018/09/25 14:14:32 [INFO] command: empty terraform config, returning nil | |
2018/09/25 14:14:32 [DEBUG] command: no data state file found for backend config | |
2018/09/25 14:14:32 [DEBUG] New state was assigned lineage "2adf3ae4-aa99-0739-0027-8b17ae7c3762" | |
2018/09/25 14:14:32 [INFO] command: backend initialized: <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
FROM jess/chrome | |
USER root | |
# Add chrome user | |
RUN groupadd -r -g 1001 kouk && useradd -r -g kouk -u 1001 -G audio,video kouk \ | |
&& mkdir -p /home/kouk/Downloads && chown -R kouk:kouk /home/kouk | |
USER kouk |
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/sh | |
NAME=$(basename $0) | |
PROFILE=${NAME#tf} | |
export TERRAGRUNT_DOWNLOAD=.terragrunt-cache-$PROFILE | |
exec env -u TF_DATA_DIR aws-vault exec $PROFILE -- "$@" |
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
--- | |
kind: DaemonSet | |
apiVersion: extensions/v1beta1 | |
metadata: | |
name: whoami-daemonset | |
labels: | |
k8s-app: whoami | |
spec: | |
template: | |
metadata: |
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/sh | |
HOST_PORT=30022 | |
DRYRUN= | |
if [ "$1" = "-n" ] ; then | |
DRYRUN=true | |
shift | |
fi | |
TARGET=$1 |
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 io | |
import boto3 | |
import datetime | |
from zipfile import ZipFile | |
from dateutil.tz import tzutc | |
from botocore.config import Config | |
outfile = sys.argv[1] |