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
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
#!/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
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
# -*- 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
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
# tmxsync: bring all windows as panes into one window and activate the "synchronize-panes" option | |
# tmxunsync: split all panes into different windows and deactivate the "synchronize-panes" option. | |
# Licence: | |
# To the extent possible under law I, Konstantinos Koukopoulos, have waived all copyright and related or neighboring rights to tmxsync.sh, as describe by the CC0 document: | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
# This work is published from: Greece. | |
tmxsync () { | |
export _TMUX_SYNC=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
$ curl --dump-header - localhost:12345 | |
HTTP/1.0 404 Not Found | |
Content-Type: text/html | |
Content-Length: 43 | |
Date: Fri, 05 Dec 2014 17:48:56 +0000 | |
<html> | |
<body> | |
<h1>WUT</h1> | |
</html> |
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
# Tries to connect to a running gpg-agent or starts one itself. It tries connecting to: | |
# 1. the agent currently designated in the environment, | |
# 2. the agent designated in the $HOME/.gnupg/gpg-agent-info file, | |
# 3. the most recently started running gpg-agent process, or last | |
# 4. a new gpg-agent process, with ssh support and, if applicable, x11 support. | |
# | |
# Step no. 3 requires the "pgrep" and "sockstat" utilities (available on FreeBSD) | |
CONNECTGPG=$(which gpg-connect-agent) | |
if [ -x $CONNECTGPG ] ; 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
$ python foo.py & | |
[1] 21377 | |
$ gdb -p 21377 | |
GNU gdb (GDB) Fedora 7.7.1-17.fc20 | |
[... gdb loading messages ...] | |
0x00007f9a09af46e3 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:81 | |
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS) | |
(gdb) py-bt | |
#4 Frame 0x22d9c70, for file foo.py, line 12, in forever () | |
sleep(1) |