Skip to content

Instantly share code, notes, and snippets.

@jftuga
jftuga / a-description.md
Last active August 6, 2024 13:49
Python insert_lines function

File Insertion Utility

This Python utility provides two functions for inserting lines into configuration files:

  • insert_lines
  • regex_insert_lines

These functions allow for precise and flexible modification of text files, particularly useful for updating configuration files in networking and system administration tasks.

  • insert_lines: Inserts specified lines into a file before or after a line that starts with a given string.
@jftuga
jftuga / zsh-prompt.md
Last active June 15, 2024 00:52
My zsh prompt with current working directory, git branch name, and current time
@jftuga
jftuga / MacOS_Terminal.md
Created June 11, 2024 14:53
Change Terminal Transparency in MacOS Sonoma

Change Terminal Transparency in MacOS Sonoma

This setting has recently changed so YMMV

  • Terminal -> Settings
  • Text tab
  • Background -> click on the box to the left of Color & Effects
    • There is no button, just click on it.
  • Slide Opacity to 100%
@jftuga
jftuga / goreleaser_homebrew.md
Created June 10, 2024 11:40
GoReleaser and Homebrew setup

CONFIGURING GORELEASER TO BUILD HOMEBREW BINARIES

In .github/workflows/release.yml file:

      - name: run GoReleaser
        uses: goreleaser/goreleaser-action@v6
        env:
 HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
@jftuga
jftuga / ytdlp_nest_comments.py
Created June 6, 2024 10:17 — forked from pukkandan/ytdlp_nest_comments.py
Prettify and nest comments from yt-dlp's info.json file and write it to a new html/json file
#!/usr/bin/env python3
"""
SPDX-License-Identifier: MIT https://opensource.org/licenses/MIT
Copyright © 2021 pukkandan.ytdlp@gmail.com
* Input file is an info.json (with comments) that yt-dlp (https://github.com/yt-dlp/yt-dlp) wrote
* Change FIELDS according to your needs
@jftuga
jftuga / example.go
Created May 30, 2024 13:40
example
package main
import (
"fmt"
"io"
"os"
)
func main() {
var count int64
@jftuga
jftuga / dump-all-variables.py
Last active May 18, 2024 10:23
Dump all Python variables
r"""
dump-all-variables.py
-John Taylor
2024-05-16
Dumps both global and local Python variables and their values
"""
import json
import re
@jftuga
jftuga / CreateS3Objects.sh
Created May 9, 2024 14:41
Batch create S3 objects
#!/bin/bash
# create a number of objects in the given S3 bucket
set -euo pipefail
COUNT=25
START=0
SOURCE=object
DEST="s3://test-bucket-${RANDOM}-${RANDOM}-${RANDOM}"
@jftuga
jftuga / 00_Unison_Configuration.md
Last active June 22, 2024 01:14
Unison Configuration

Cross Platform Unison Setup: One Way, Immutable File Mirroring

  • Server: desktop - a windows PC
  • Client: macbook
  • Unison: version 2.53.5

Concept

I need to run KeePassXC on both my Windows desktop and MacBook. I consider the desktop to be the source of truth. If I want to update an entry, then I will modify KeePassXC only on my Windows box. I am restricting myself to this

@jftuga
jftuga / update_firmware_from_ubuntu_or_debian.md
Last active August 30, 2024 03:50
How to Update Firmware on Ubuntu or Debian