Skip to content

Instantly share code, notes, and snippets.

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

David Pesticcio DavidPesticcio

🚀
¯\_(ツ)_/¯
View GitHub Profile
@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
@DavidPesticcio
DavidPesticcio / github_multiple-accounts.md
Created January 5, 2023 20:26 — forked from JoaquimLey/github_multiple-accounts.md
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@DavidPesticcio
DavidPesticcio / pomodoro.sh
Created December 9, 2022 10:01 — forked from jameswpm/pomodoro.sh
Minimalistic Pomodoro Timer
#!/bin/bash
#
# Minimalistic_Pomodoro_Timer
#
# Based on the SU answer found here: https://superuser.com/questions/224265/pomodoro-timer-for-linux/669811#669811
#
# Tested in Ubuntu 16.04 and Arch
pomodorotime () {
notify-send "Time to Work" "Focus" -u normal -a 'Pomodoro' -i $HOME/Documentos/icon.png
paplay /usr/share/sounds/freedesktop/stereo/window-attention.oga
@DavidPesticcio
DavidPesticcio / tfc-getting-started.md
Last active November 27, 2022 09:04
Terraform Cloud Getting Started

New to TFC? Follow these steps to instantly apply an example configuration:

$ git clone https://github.com/hashicorp/tfc-getting-started.git
$ cd tfc-getting-started
$ scripts/setup.sh