Skip to content

Instantly share code, notes, and snippets.

View bulletinmybeard's full-sized avatar
🤘

Robin Schulz bulletinmybeard

🤘
View GitHub Profile
@bulletinmybeard
bulletinmybeard / obsidian-plugin-sync-script.md
Last active February 28, 2024 18:04
Bash script to sync local Obsidian Plugin files and directories (Tested on macOS!)

https://github.com/bulletinmybeard/obsidian-plugin-dev-sync

Overview

This Bash script helps synchronize local Obsidian plugins. It leverages rsync for the transfer, including the ability to handle deletions, and fswatch to monitor the files and directories for changes.

The script will synchronize all Obsidian-related and mandatory main.js and manifest.json files required for the plugin to be enabled and executed in both Obsidian's native and mobile versions (iCloud!).

Prerequisites

  • Ensure that rsync and fswatch are installed on your system.
@bulletinmybeard
bulletinmybeard / custom-zsh-prompt.md
Last active February 24, 2024 11:58
Customize Oh My Zsh (zsh-syntax-highlighting) prompt
@bulletinmybeard
bulletinmybeard / terminate-unresponsive-macos-apps-using-a-terminal-command.md
Created February 2, 2024 10:21
Terminate unresponsive macOS apps using a terminal command

To terminate unresponsive apps, open your terminal and execute the command pkill -x followed by the app's name (e.g., pkill -x Alfred).

@bulletinmybeard
bulletinmybeard / nmap-port-scan.md
Last active January 25, 2024 07:43
Use the Nmap network scanner command to perform a TCP SYN scan on open ports specified (macOS/Linux)

Use, on macOS/Linux, the nmap command to scan open ports (e.g., github.com) and retrieve the results in a valid JSON format using xml2json and jq.

Prerequisites

  • Install xml2json with npm install -g xml2json-command (NodeJS required!)
  • Install jq with brew install jq (Homebrew required)

CLI Arguments

Arg Function
sudo This command needs to run as root
@bulletinmybeard
bulletinmybeard / verify-gitignore-rules.md
Created January 7, 2024 16:49
Verify .gitignore rules
# Without colors
find . -type f | git check-ignore -v --stdin | sort | uniq -c | awk '{for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n"}'

# With colors
find . -type f | git check-ignore -v --stdin | sort | uniq -c | awk '{printf "\033[43;30m%s\033[0m", $2; for (i=3; i<=NF; i++) printf "\033[46;30m %s\033[0m", $i; printf "\n"}'

ANSI color codes

@bulletinmybeard
bulletinmybeard / gists-export-bash-script.md
Last active January 7, 2024 11:32
Download and overwrite the updated remote gists via this bash script

The bash script below will download all users gists from https://api.github.com/users/<github-username>/gists and need the GitHub username and GitHub API token as the rate limit for unauthenticated requests is 👎

# Unauthenticated
{
	"rate": {
		"limit": 60,
		"remaining": 59,
		"reset": 1704592325,
		"used": 1,
@bulletinmybeard
bulletinmybeard / list-network-connections-and-transform-them-into-json.md
Last active January 6, 2024 22:16
List network connections and transform them into JSON
# All files and processes
lsof -i -P -n | sed 1d | awk '{
    gsub(/[^a-zA-Z0-9_-]/, "-", $1);
    cmd = "ps -p " $2 " -o comm= ";
    cmd | getline path;
    close(cmd);
    split($9, arr, ":");
    host = arr[1];
 port = arr[2];
@bulletinmybeard
bulletinmybeard / chat.openai.com-userscript.js
Last active January 4, 2024 05:58
ChatGPT (chat.openai.com) - Disable keyboard command `CMD+K` that clears the prompt form and resets the URL (macOS!)
// ==UserScript==
// @name ChatGPT (chat.openai.com) - Disable keyboard command `CMD+K`
// @namespace https://rschu.me/
// @homepage https://rschu.me/
// @version 1.0.0
// @encoding utf-8
// @description ChatGPT (chat.openai.com) - Disable keyboard command `CMD+K` that clears the prompt form and resets the URL
// @author Robin Schulz
// @match *://chat.openai.com/c/*
// @compatible chrome
@bulletinmybeard
bulletinmybeard / fix-cannot-connect-to-the-docker-daemon-error-on-macoslinux.md
Created December 21, 2023 04:07
Fix "Cannot connect to the Docker daemon" error on macOS/Linux
Cannot connect to the Docker daemon at unix:///Users/<username>/.local/share/containers/podman/machine/qemu/podman.sock. Is the docker daemon running?
  1. Check the $DOCKER_HOST environment variable to see which socket Docker is using by running echo $DOCKER_HOST in your terminal.
  2. Unset the $DOCKER_HOST environment variable with unset DOCKER_HOST.
  3. Check your terminal configurations, such as ~/.zshrc or ~/.bashrc, for a line like export DOCKER_HOST='unix:///Users/<username>/.local/share/containers/podman/machine/qemu/podman.sock' and remove it.
  4. Run source ~/.zshrc or exec $SHELL in your terminal to refresh the shell environment.

That's about it \w

@bulletinmybeard
bulletinmybeard / bol.com-userscript.js
Created December 20, 2023 09:19
Bol.com - Disable marketing click-events on product links
// ==UserScript==
// @name Bol.com - Disable marketing click-events on product links
// @namespace https://rschu.me/
// @homepage https://rschu.me/
// @version 1.0.0
// @encoding utf-8
// @description Bol.com - Disable marketing click-events on product links
// @author Robin Schulz
// @match *://*.bol.com/*
// @compatible chrome