Skip to content

Instantly share code, notes, and snippets.

View franchb's full-sized avatar
🎯
Focusing

Eliah Rusin franchb

🎯
Focusing
View GitHub Profile
@cristaloleg
cristaloleg / golangci.yaml
Last active July 15, 2022 17:03
An opinionated golangci-lint config (right version™)
# $ golangci-lint run --config=~/.golangci.yml ./... > lint.txt
run:
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 10m
# exit code when at least one issue was found, default is 1
@eloylp
eloylp / Fedora35Hibernation.md
Last active April 25, 2024 07:40
Fedora 35 hibernation with swapfile, only for hibernation and resume

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
# Set vi key bindings mode
set -g mode-keys vi
set -g status-keys vi
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# List of plugins
@sv3t0sl4v
sv3t0sl4v / clickhouse_backup_remote_bz2.sh
Last active July 2, 2023 16:46
ClickHouse_Backup_Remote_BZ2
#!/bin/bash
#==============================================================================================
# Created by svet0slav of Countess Cat Inc - https://countesscat.com
#==============================================================================================
# We use this because clickhouse-backup freezes data and new data can't insert, not good!
# clickhouse-backup not working with latest version of ClickHouse - not good. Ha-ha!
#==============================================================================================
# Insanely good compression anf quite fast!
# You can symlink bzip2, bunzip2 and bzcat to lbzip2, and gzip, gunzip, gzcat and zcat to pigz:
#
@jenciso
jenciso / Jenkinsfile
Created October 3, 2020 00:15 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@adewes
adewes / track_temperature.sh
Last active February 28, 2024 16:33
Temperature Tracking Script
#!/bin/bash
# logs the temperature every minute
# sends a message if it is too high or low or if it can't be measured
# also sends a message at a given time every day
#sensor ID (must be a DS18B20 sensor)
SENSOR_ID="28-011453d372aa"
# hour when to send the message
REF_HOUR="17:00"
# maximum temperature

GPG / PGP

Best Practices

  • Generate your master key only on an air-gapped PC booted from a live Linux distribution on a bootable USB drive
  • Generate your master key only with only the CERTIFY action
  • Add separate subkeys for SIGN, ENCRYPT, and AUTHENTICATE actions
  • Set an expiration date for all subkeys
  • Export your secret master key in ASCII armored output
  • Do not transfer your secret master and subkeys to a hardware authentication device UNTIL you have exported them in ASCII armored output
  • Export your secret subkeys in ASCII armored output
  • Store your exported secret master and subkeys offline, never on a PC with network access
@LOZORD
LOZORD / json_test.go
Created January 12, 2020 17:14
An example of using a native JSON-friendly Go struct as a type and input in a CEL program.
package test
import (
"bytes"
"encoding/json"
"testing"
"github.com/golang/protobuf/jsonpb"
structpb "github.com/golang/protobuf/ptypes/struct"
"github.com/google/cel-go/cel"
@larzza
larzza / glibc-in-alpine-docker
Created June 24, 2019 20:35
Install glibc in Alpine docker image
RUN apk --no-cache add \
wget \
ca-certificates \
libstdc++
# Get and install glibc for alpine
ARG APK_GLIBC_VERSION=2.29-r0
ARG APK_GLIBC_FILE="glibc-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BIN_FILE="glibc-bin-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${APK_GLIBC_VERSION}"
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
@dmontagu
dmontagu / docker-compose.deploy.volumes-placement.yml
Last active October 12, 2021 03:33
Elasticsearch config files for use with FastAPI generated project
version: '3.3'
services:
db:
volumes:
- app-db-data:/var/lib/postgresql/data/pgdata
deploy:
placement:
constraints:
- node.labels.${STACK_NAME}.app-db-data == true
es01: