Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile

sudo tcpdump -i en0 icmp ping -c2 224.0.0.251

20:47:43.072218 IP 192.168.146.61 > 224.0.0.251: ICMP echo request, id 32551, seq 0, length 64
20:47:43.074505 IP 192.168.146.83 > 192.168.146.61: ICMP echo reply, id 32551, seq 0, length 64
20:47:43.183397 IP 192.168.146.63 > 192.168.146.61: ICMP echo reply, id 32551, seq 0, length 64
2017-09-12T07:16:52.000Z [2]: Initializing data volume.
2017-09-12T07:16:52.000Z [2]: [01/04] http://web-1:9000/data/1 - 60 GiB online
2017-09-12T07:16:52.000Z [2]: [02/04] http://web-2:9000/data/2 - 60 GiB online
2017-09-12T07:16:52.000Z [2]: [03/04] http://web-3:9000/data/3 - 60 GiB online
2017-09-12T07:16:52.000Z [2]: [04/04] http://web-4:9000/data/4 - 13 GiB online
2017-09-12T07:16:53.000Z [2]: Endpoint: http://10.81.128.100:9000 http://172.17.0.8:9000 http://127.0.0.1:9000
2017-09-12T07:16:53.000Z [2]: AccessKey: ACCESSKEY
2017-09-12T07:16:53.000Z [2]: SecretKey: SECRETKEY
2017-09-12T07:16:53.000Z [2]:
2017-09-12T07:16:53.000Z [2]: Browser Access:
#cloud-config
write_files:
- path: /etc/kontena-agent.env
permissions: 0600
owner: root
content: |
KONTENA_URI="TODO"
KONTENA_TOKEN="TODO"
KONTENA_PEER_INTERFACE=ens4v1
KONTENA_VERSION=latest
#!/usr/bin/env sh
set -e
REGION=$1
NAME=$2
REVISION=$3
MACHINE_TYPE=$4
DISK_SIZE=$5
gcloud compute instance-templates create ${NAME}-i-$REVISION \

https://www.postgresql.org/docs/current/static/continuous-archiving.html

benefits:

we can combine an indefinitely long sequence of WAL files for replay, continuous backup can be achieved simply by continuing to archive the WAL files. This is particularly valuable for large databases, where it might not be convenient to take a full backup frequently.

It is not necessary to replay the WAL entries all the way to the end. We could stop the replay at any point and have a consistent snapshot of the database as it was at that time. point-in-time recovery: it is possible to restore the database to its state at any time since your base backup was taken.

If we continuously feed the series of WAL files to another machine that has been loaded with the same base backup file, we have a warm standby system --> nearly-current copy of the database.

### Display execution time if command took longer than REPORTTIME_TOTAL
#
# https://superuser.com/a/847411/376927
#
REPORTTIME_TOTAL=1 # seconds
cmd_execution_time() {
local stop=$((`date "+%s"`))
let local "cmd_elapsed = ${stop} - ${cmd_start_time}"
let local "cmd_minutes = ${cmd_elapsed} / 60"
let local "cmd_seconds = ${cmd_elapsed} % 60"
i-2-0rm2 login: core (automatic login)
Last login: Wed Mar 28 09:05:01 UTC 2018 on tty1
Container Linux by CoreOS stable (1688.4.0)
Update Strategy: No Reboots
core@i-2-0rm2 ~ $ [   27.273522] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update y
our scripts to load br_netfilter if you need this.
[   27.290348] Bridge firewalling registered
[   27.310434] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[   27.454606] Initializing XFRM netlink socket
echo 'SUBSYSTEM=="input", ATTRS{name}=="TOMMO NEOGEOX Arcade Stick", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"' > /etc/udev/rules.d/10-neogeo.rules
# metal slug a-b-c /home/pi/.config/retroarch/autoconfig/TOMMO NEOGEOX Arcade Stick.cfg
input_device = "TOMMO NEOGEOX Arcade Stick"
input_driver = "udev"
input_start_btn = "9"
input_exit_emulator_btn = "9"
input_up_btn = "h0up"
input_a_btn = "1"
disable_overscan=1
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0