Skip to content

Instantly share code, notes, and snippets.

View DeepInThought's full-sized avatar
🎯
Focusing

DeepInThought

🎯
Focusing
View GitHub Profile
@DeepInThought
DeepInThought / README.md
Created October 13, 2020 18:48 — forked from thomaslarsen/README.md
Convert PEM certificate to JSON format
@DeepInThought
DeepInThought / README.md
Created October 13, 2020 18:48 — forked from thomaslarsen/README.md
Convert PEM certificate to JSON format
@DeepInThought
DeepInThought / chain_spec--tests-test_connectivity_backtrace_02.log
Created September 3, 2019 01:23
test chain_spec::tests:test_connectivity
running 1 test
test chain_spec::tests::test_connectivity ... FAILED
failures:
---- chain_spec::tests::test_connectivity stdout ----
thread 'chain_spec::tests::test_connectivity' panicked at 'Error creating test node service: Error(Client(VersionInvalid), State { next_error: None, backtrace: InternalBacktrace { backtrace: Some(stack backtrace:
0: error_chain::backtrace::imp::InternalBacktrace::new::h507d7f94a8f20409 (0x564f3a98f6e2)
1: <error_chain::State as core::default::Default>::default::hf41fd1effeed9af8 (0x564f3a98fa16)
2: <substrate_client::error::Error as core::convert::From<substrate_client::error::ErrorKind>>::from::he7cf6d166d742b29 (0x564f3a74fcc6)
@DeepInThought
DeepInThought / docker-bench-security.sh
Created June 12, 2019 20:10
Docker bench security local
#!/bin/sh
# ------------------------------------------------------------------------------
# Docker Bench for Security
#
# Docker, Inc. (c) 2015-
#
# Checks for dozens of common best-practices around deploying Docker containers in production.
# ------------------------------------------------------------------------------
version='1.3.4'
#!/usr/bin/env bash
#file: ~/.docker/docker_lib_functions.sh
#? REF: https://dev.to/argherna/bash-functions-and-aliases-for-the-beginning-docker-developer-d4
# Runs Docker build and tag it with the given name.
#
docker_build_tag() {
if [ $# -lt 1 ]; then
echo "Usage $FUNCNAME DIRNAME [TAGNAME ...]"
@DeepInThought
DeepInThought / docker_aliases
Created June 12, 2019 20:08
Lukes collection of docker aliases
#file: ~/.docker/.docker_aliases
#? REF: https://dev.to/argherna/bash-functions-and-aliases-for-the-beginning-docker-developer-d4
alias docker-print-aliases='cat ~/.docker/.docker_aliases'
alias d-att='docker attach'
alias dc-b='docker-compose build'
alias dc-logs='docker-compose logs'
alias dc-u='docker-compose up'
alias d-diff='docker diff'
# .root_backup_excludes
/dev
/etc/fstab
/home
/lib/modules/*/volatile/.mounted
/media
/mnt
/proc
/run
# For use in restic-backup.sh
#? See https://gist.github.com/DeepInThought/67d3a4fd42d3ec43e85c5fd5966c0944
# Script directory
export SCRIPT_DIR="${HOME}/.scripts"
# Restic variables
export RESTIC_MOUNTPOINT="/mnt/restic"
export RESTIC_PASSWORD_FILE="${SCRIPT_DIR}/.backup_secrets"
export RESTIC_PATH="/home/restic/bin/restic"
# For use in restic-backup.sh
#? See https://gist.github.com/DeepInThought/67d3a4fd42d3ec43e85c5fd5966c0944
# Script directory
export SCRIPT_DIR="${HOME}/.scripts"
# Setup
export GET_LATEST_HOME_EXCLUDES="$(wget https://raw.githubusercontent.com/rubo77/rsync-homedir-excludes/master/rsync-homedir-excludes.txt -O ${SCRIPT_DIR}/homedir-excludes-latest.txt 2>/dev/null)"
# Restic variables
@DeepInThought
DeepInThought / restic-install.sh
Last active June 1, 2019 16:55
Restic installer
#!/bin/bash
mkdir -p ${HOME}/.scripts
sudo useradd -m restic
sudo mkdir -p ~restic/bin | ls -lat --color=always ~restic/bin || exit 1
curl -L https://github.com/restic/restic/releases/download/v0.9.3/restic_0.9.3_linux_amd64.bz2 | bunzip2 > ~restic/bin/restic
sudo chown root:restic ~restic/bin/restic
sudo chmod 750 ~restic/bin/restic
setcap cap_dac_read_search=+ep ~restic/bin/restic
#sudo -u restic /home/restic/bin/restic --exclude={/dev,/media,/mnt,/proc,/run,/sys,/tmp,/var/tmp} -r /tmp