Skip to content

Instantly share code, notes, and snippets.

View islander's full-sized avatar

kiba islander

  • Innova Distribution
  • Moscow | Saint Petersburg
View GitHub Profile
@pohzipohzi
pohzipohzi / walg-pitr.md
Last active April 25, 2023 15:47
PostgreSQL Point-In-Time-Recovery (PITR) with WAL-G

WAL-G PITR

This gist summarises a way to simulate point-in-time recovery (PITR) using WAL-G. Most of the material is adapted from Creston's tutorial.

Setup

First we initialize a database cluster

pg_ctl init -D cluster

systemd-nspawn container architecture

This short document will show how to turn systemd-nspawn into a usable containeration system.

Those instructions here should work under Arch Linux and Debian 10 (Buster)

Host requirements

  • systemd-nspawn and machinectl (systemd-container package under Debian)
  • dnsmasq
  • debootstrap
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@Yatoom
Yatoom / setup.md
Last active April 19, 2024 06:41
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@altaurog
altaurog / docker_descendants.py
Last active May 29, 2023 04:11
Python3 script to find descendants of one or more docker images
#!/usr/bin/python3
#
# usage: python3 docker_descendants.py <image_id> ...
import sys
from subprocess import check_output
def main(images):
image_ids = set(images)
@gustavohenrique
gustavohenrique / pre-sharedkey-aes.py
Created September 13, 2017 17:52
An example using Python3 and AES criptography
import sys
import base64
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key):
self.bs = 16
self.cipher = AES.new(key, AES.MODE_ECB)
@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@mosquito
mosquito / README.md
Last active April 27, 2024 00:07
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@iswilson
iswilson / reboot-spa112.sh
Created March 7, 2017 23:36
Bash script to reboot a Cisco SPA112 using its web ui.
#!/bin/bash
#
# Reboot a Cisco SPA112 using its web ui.
# Tested on firmware v1.4.1 (002).
#
# Written by Ian Wilson <ian@iswilson.com> on 2017-03-07
DEVICE_IP=192.168.1.42
USER=admin
PASSWORD=hunter2
@jgsqware
jgsqware / kubeadm-install-offline.md
Last active March 7, 2024 05:48
Offline Kubeadm install

On master and nodes

Pull images form internet access laptop

docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-proxy-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.5.0
docker pull weaveworks/weave-npc:1.8.2
docker pull weaveworks/weave-kube:1.8.2