Skip to content

Instantly share code, notes, and snippets.

View DavidPesticcio's full-sized avatar
🚀
¯\_(ツ)_/¯

David Pesticcio DavidPesticcio

🚀
¯\_(ツ)_/¯
View GitHub Profile
@DavidPesticcio
DavidPesticcio / tbb_clone.sh
Created January 29, 2026 12:01 — forked from lethak/tbb_clone.sh
Clone a default TOR browser instance to allow the clones to be ran as multiple TOR Browser instances with different IPs. If you want the same effect without the Browser, head over https://github.com/lethak-docker/tor-clients
#!/bin/bash
# HOWTO MAKE IT WORK ?
#
# Required for windows user: you may want to have linux friendly shell already installed (Git-Bash is doing a fine job and easy to install)
# Then,
# Go to Tor Browser install directory ex: "C:\Programs\Tor Browser"
# Create and or copy this script there under the name "tbb_clone.sh" (name and path not important if you know what you are doing)
# Run the script ex: "bash ./tbb_clone.sh -n 4 -p ./Browser"
# This will create 4 copies of the "Browser" folder named "TBB1" to "TBB4"
@DavidPesticcio
DavidPesticcio / commit.sh
Created December 23, 2024 21:17 — forked from jurakovic/commit.sh
Script for notes or "changelog" repo (more info here: https://news.ycombinator.com/item?id=42489124)
#!/bin/bash
git status -s
read -p "Press any key to show diff" -n1 -s; echo
git --no-pager diff
read -p "Press any key to stage all files" -n1 -s; echo
git add .
git status -s
@DavidPesticcio
DavidPesticcio / base64.nix
Created December 8, 2024 14:04 — forked from manveru/base64.nix
Encode to base 64 in pure Nix
{lib, ...}: {
toBase64 = text: let
inherit (lib) sublist mod stringToCharacters concatMapStrings;
inherit (lib.strings) charToInt;
inherit (builtins) substring foldl' genList elemAt length concatStringsSep stringLength;
lookup = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
sliceN = size: list: n: sublist (n * size) size list;
pows = [(64 * 64 * 64) (64 * 64) 64 1];
intSextets = i: map (j: mod (i / j) 64) pows;
compose = f: g: x: f (g x);
@DavidPesticcio
DavidPesticcio / udemy-course-reset-for-browser.md
Last active January 8, 2024 18:56
Udemy: Reset a course, i.e. uncheck all boxes

Un/check all visible checkboxes for a course.

Currently only works if course content is visible, and course section(s) is/are already expanded.

Usage:

Open console for web browser (F12 or Right-Click Inspect) Paste the section of JavaScript below into the console according to your needs.

Open Course Content (WIP)

@DavidPesticcio
DavidPesticcio / syncthing-automerge.py
Created August 26, 2023 20:43 — forked from solarkraft/syncthing-automerge.py
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@DavidPesticcio
DavidPesticcio / setup-users.groovy
Created May 14, 2023 10:39 — forked from johnbuhay/setup-users.groovy
jenkins init.groovy.d script for configuring users
import jenkins.*
import hudson.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
import hudson.model.*
import jenkins.model.*
import hudson.security.*
To add a GPG Public key
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 1AD28806
@DavidPesticcio
DavidPesticcio / vsc-settings.py
Created February 6, 2023 11:42 — forked from wonderbeyond/vsc-settings.py
script to export vsc settings
#!/usr/bin/env python3
from os import path
import tempfile
import subprocess
import datetime as dt
import click
@click.group()
def cli():
@DavidPesticcio
DavidPesticcio / gpg-hints-and-tips.txt
Created January 12, 2023 16:38
GPG Hints and Tips
Export a key to GPG or ASCII format
gpg --export YOUR_FINGERPRINT > pubkey.gpg
gpg --armor --export YOUR_FINGERPRINT > pubkey.asc
Convert a key/file to/from GPG or ASCII format
gpg --enarmor file.gpg > file.asc
gpg --dearmor file.asc > file.gpg