Skip to content

Instantly share code, notes, and snippets.

View gema-arta's full-sized avatar
:octocat:
Octocating

gema-arta gema-arta

:octocat:
Octocating
View GitHub Profile
@gema-arta
gema-arta / tailscale
Created December 21, 2022 02:06 — forked from cmtsij/tailscale
tailscale completion
#!/bin/bash
# tailscale completion -*- shell-script -*-
_tailscale()
{
local cur prev words cword
_init_completion -n = || return
if [[ $cword -eq 1 ]]; then
SUBCOMMANDS=$(tailscale --help 2>&1 | awk '/SUBCOMMANDS/{ f = 1; next } /FLAGS/{ f = 0 } f{print $1}')
# run with
# bash <(curl -s https://gist.githubusercontent.com/iampeterbanjo/f1c9931002f5a939464c172fed6f96cb/raw/520cee811a47714291394dec5fb4352683a17158/install-modprobe-ubuntu-kernel.sh)
apt-get update
apt-get install build-essential libssl-dev
apt-get install -y libssl-dev
apt-get install -y zfsutils-linux # will fail on dkms
# Determine versions
arch="$(uname -m)"
# run with
# bash <(curl -s https://gist.githubusercontent.com/iampeterbanjo/f1c9931002f5a939464c172fed6f96cb/raw/520cee811a47714291394dec5fb4352683a17158/install-modprobe-ubuntu-kernel.sh)
apt-get update
apt-get install build-essential libssl-dev
apt-get install -y libssl-dev
apt-get install -y zfsutils-linux # will fail on dkms
# Determine versions
arch="$(uname -m)"
@gema-arta
gema-arta / http-benchmark.md
Created October 11, 2022 17:01 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@gema-arta
gema-arta / catalog.sh
Created September 9, 2022 02:28 — forked from lucasburlingham/catalog.sh
File Scan and Tracker
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NC='\033[0m'
$CAT_DIR
echo -e "--------- ${GREEN}CATALOGING ISO FILES${NC} ------------"
@gema-arta
gema-arta / bash-colors.md
Created August 26, 2022 20:05 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
#!/bin/bash
# Author: Andrea Lazzarotto
# http://andrealazzarotto.com
# andrea.lazzarotto@gmail.com
# Slideshare Downloader
# This script takes a slideshare presentation URL as an argument and
# carves all the slides in flash format, then they are converted to
# and finally merged as a PDF
@gema-arta
gema-arta / inotify-channel-backup.md
Created June 25, 2022 19:55 — forked from alexbosworth/inotify-channel-backup.md
Backup channel.backup file using systemd and inotify

LND backup script for channel.backup using inotify

Install inotify

sudo apt install inotify-tools

Create script to watch for changes and copy on change

Faking DNS from userland

To give false DNS responses from userland we need to handle different type of syscalls : gethostbyname(), gethostbyname2(), getaddrinfo(), getnameinfo(), etc. To cover all these cases, and to prevent leaks to real dns servers, we will use two libraries : libresolv_wrapper and libnss_wrapper.

Installation

Install resolv_wrapper and nss_wrapper, either from sources or from your favorite Linux distribution.

@gema-arta
gema-arta / mpv.conf
Created January 17, 2022 21:46 — forked from shabbir-hasan/mpv.conf
MPV Configuration (mpv.conf) on Windows 10 Pro
# vim: syntax=config
###########
# General #
###########
priority=high
input-ipc-server=/tmp/mpvsocket # listen for IPC on this socket
load-stats-overlay=yes # use local stats.lua