Skip to content

Instantly share code, notes, and snippets.

View J00MZ's full-sized avatar
🍋
Snicket

Joe Tavin J00MZ

🍋
Snicket
View GitHub Profile
@J00MZ
J00MZ / repo_push.sh
Created July 28, 2025 13:03
push all repos to Gitlab
#!/bin/bash
REPO_NAMES=${REPO_NAMES_LIST:-'test-repo'}
GROUP_NAME="${GROUP_NAME:-'my-group'}"
for repo in "${REPO_NAMES[@]}"
do
echo "Pushing to repo $repo"
cd "${repo}" || exit
git remote rename origin old-origin
@J00MZ
J00MZ / create_repos.sh
Created July 28, 2025 13:02
Create multiple Gitlab repos
#!/bin/bash
GITLAB_API="https://gitlab.com/api/v4"
TOKEN="${GL_ACCESS_TOKEN}"
GROUP_NAME="${GROUP_NAME:-'my-group'}"
REPO_NAMES=${REPO_NAMES_LIST:-'test-repo'}
@J00MZ
J00MZ / quick_terraform.md
Last active July 7, 2022 09:34
Quickly create terraform files from resources - reverse Terraform

Create .tf files from remote resources

Disclaimer

Generating configuration from remote state is still not officially supported by Terraform.

However, when I stupidly enough deleted a complex DataDog resource that I had created manually, I managed to fully restore it and create a full terraform file for it using a few simple commands

This worked for me with the datadog_synthetics_test resource, so this will be the example resource below.
If this works for you with any other Terraform resources, I would love to know 🤗 .

@J00MZ
J00MZ / secrets.md
Last active July 6, 2022 09:14
Jenkins_Get_Secrets

Get Jenkins Secrets as plaintext

def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
    com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class,
    Jenkins.instance,
    null,
    null
);
for (c in creds) {
@J00MZ
J00MZ / repo_pull_aliases.sh
Last active July 14, 2025 14:27
Pull All Repos Command
# Version 1 - one repo at a time
function pull_all_repos(){
CURRENT_DIR="$(pwd)"
DIRLIST=($(cdr && ls -1|xargs))
REPODIR="$(cdr && pwd)"
for dir in "${DIRLIST[@]}";do
echo "Pulling latest from [${dir}]"
(cd "${REPODIR}/${dir}" && gfa) || echo "Failed to access ${dir}"
done
cd "${CURRENT_DIR}" || exit
@J00MZ
J00MZ / nf_wa.js
Last active February 7, 2021 17:57
NF WhatsApp
(function () {
const iframe = document.createElement("iframe");
function sendMessageToWaServer(qr) {
iframe.contentWindow.postMessage({ qr }, "*");
}
function getQrFromCanvas() {
let canvas = document.querySelectorAll('[role="img"]')[0];
let qrUrl = canvas.toDataURL();
#!/bin/bash
DAF_DIR="$HOME/Documents/dafyomi/עירובין"
mkdir -p "${DAF_DIR}"
echo "Downloading Eruvin from daf Bet Amud Alef until daf Nun Gimel Amud Alef, for additional dapim adjust the script range."
for daf_file in {440..540}; do
echo "downloading daf [${daf_file}]"
URL="http://daf-yomi.com/Data/UploadedFiles/DY_Page/${daf_file}.pdf"
wget -q --show-progress -O "${DAF_DIR}/eruvin_${daf_file}.pdf" "$URL" || ( echo "Error downloading daf file ${daf_file}" && exit 1 )
@J00MZ
J00MZ / collectd.conf
Created June 10, 2020 06:54
collectd config
#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#
##############################################################################
# Global #
#----------------------------------------------------------------------------#
# Global settings for the daemon. #
@J00MZ
J00MZ / question.md
Last active April 28, 2022 00:22
SRE Python question

Problem


You have an string including words and characters that describes a boolean expression.
The words in the string may include one of the following four options

1. "true"
2. "false"
3. "&"
4. "|"
@J00MZ
J00MZ / profs.json
Last active July 24, 2019 10:04
terminal_profiles
"profiles" :
[
{
"acrylicOpacity" : 0.5,
"background" : "#012456",
"closeOnExit" : true,
"colorScheme" : "Campbell",
"commandline" : "powershell.exe",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",