Skip to content

Instantly share code, notes, and snippets.

View delameter's full-sized avatar
🛰️
transmitting

Alexandr Shavykin delameter

🛰️
transmitting
View GitHub Profile

Shell pipes & redirects

Summary, syntax, examples.

#!/bin/bash
# -----------------------------------------------------------------------------
# es7s/core (shared code)
# (C) 2021-2022 A. Shavykin <0.delameter@gmail.com>
# -----------------------------------------------------------------------------
# shellcheck disable=SC2059
# shellcheck disable=SC2120
# -----------------------------------------------------------------------------
if [[ -n "${ES7S_DEBUG:-}" ]] ; then
printf "$(basename "${BASH_SOURCE[-1]^^}") %s\n" \

Linux Text Processing

Cheatsheet for sed, grep and other text utils typical usecases.

@delameter
delameter / preview.png
Last active October 16, 2023 13:51
sql-joins-cheatsheet
preview.png

Python itertools recipes

import collections
import operator
import random
from itertools import *

def take(n, iterable):
    "Return first n items of the iterable as a list"

.gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

Nginx and Let’s Encrypt with Docker

The Setup

Official images of nginx and an automated build of certbot, the EFF’s tool for obtaining Let’s Encrypt certificates, are available in the Docker library.

Let’s begin with a basic docker-compose.yml configuration file that defines containers for both images:

version: '3'

services: