Skip to content

Instantly share code, notes, and snippets.

tap "armosec/kubescape"
tap "danvergara/tools"
tap "env0/terratag"
tap "fluxcd/tap"
tap "github/gh"
tap "go-task/tap"
tap "goodwithtech/r"
tap "helm/tap"
tap "homebrew/bundle"
tap "homebrew/cask-drivers"

SSH into AWS ec2/ Digitalocean droplet/ or else other PAAS, linux machine

  1. Install Docker
$sudo apt install docker.io
$sudo usermod -aG docker $USER

I already installed docker

@g3rhard
g3rhard / easylist.pl
Last active January 13, 2024 17:09
Adding EasyList subscriptions for PiHole project
#!/usr/bin/perl -w
#Source: https://newspaint.wordpress.com/2014/08/18/filtering-easylist-for-hosts-file-style-adblock/
use strict;
my %hosts = ();
while ( <> ) {
if ( $_ =~ m/^\|\|([a-z][a-z0-9-_.]+\.([a-z]{2,3}))\^\s*$/ ) {
$hosts{$1} = 1;
}
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2023-12-11T08:55:48.601Z",
"redirects": [
{
"description": "Youtube",
"exampleUrl": "https://www.youtube.com/watch?v=iv8Ci8omkks",
"exampleResult": "https://invidious.g3rhard.cc/watch?v=iv8Ci8omkks",
"error": null,
"includePattern": "www.youtube.com/(watch.*)",
@g3rhard
g3rhard / playlist.m3u
Last active November 29, 2023 00:16
Create playlist file or list streams for radiorecord.ru stations
#EXTM3U
#PLAYLIST:Playlist Name
#EXTINF:-1,1970
http://air.radiorecord.ru:805/1970_64
#EXTINF:-1,1980
http://air.radiorecord.ru:805/1980_64
#EXTINF:-1,2step
http://air.radiorecord.ru:805/2step_64
#EXTINF:-1,ansh
http://air.radiorecord.ru:805/ansh_64
@g3rhard
g3rhard / vpn_reconnect.bat
Created June 21, 2017 09:36
Bat script for reconnect VPN connection in Windows
@echo off
:loop
echo testing IP address
ping 123.456.78.90 >nul || (
echo ping failure - disconnecting
rasdial name_of_your_vpn_connect /disconnect
timeout /t 10 /nobreak
echo reconnecting
rasdial name_of_your_vpn_connect
timeout /t 10 /nobreak
## Monitor Pi-Hole service
check process pihole-FTL with pidfile /var/run/pihole-FTL.pid
start program = "/etc/init.d/pihole-FTL start"
stop program = "/etc/init.d/pihole-FTL stop"
if changed pid then exec "/bin/bash -c '/usr/local/bin/slack-webhook.rb'"
if 1 restart within 1 cycle then exec "/bin/bash -c '/usr/local/bin/slack-webhook.rb'"
if failed port 53 type tcp with timeout 5 seconds for 2 cycles then restart
## Check Pi-Hole web interface
check process lighttpd with pidfile /var/run/lighttpd.pid
@g3rhard
g3rhard / AuthyToOtherAuthenticator.md
Created August 8, 2023 19:48 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@g3rhard
g3rhard / docker-compose.yaml
Created July 10, 2019 06:01
docker-compose for ipsec vpn + pihole + telegram proxy
version: '2'
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
volumes:
- /etc/localtime:/etc/localtime:ro
- /dev/rtc:/dev/rtc:ro
dns:
@g3rhard
g3rhard / bash-skel.sh
Created May 3, 2023 07:49 — forked from wardenlym/bash-skel.sh
Minimal safe Bash script template
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]