Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@josephbolus
josephbolus / marks.md
Created July 4, 2024 20:10
Small scripts, hacks and automations.

This is more in the "hack" category, but here is a solution for bookmarking directories[1] that I am quite fond of:

mkdir -p ~/.marks/
export CDPATH=.:~/.marks/
function mark { ln -sr "$(pwd)" ~/.marks/"$1"; }

Then:

@josephbolus
josephbolus / scan.sh
Created July 4, 2024 19:49
Use the following tiny script to make PDFs look like they have been scanned.
#!/bin/sh
# Help message
show_help() {
echo
echo "Convert PDFs to make them look like they have been scanned"
echo "Example: $0 file.pdf"
}
# Check if the provided argument is not empty
@josephbolus
josephbolus / dracula-theme.css
Last active July 5, 2024 20:17
dracula-theme.css
/* Casual stab at modifying the Bookstack main theme using the Dracula color scheme. Download and use at your own risk. */
/* https://github.com/domainzero/bookstack-dark-theme */
/* optional */
/* uppercase titles */
.page-content h1{text-transform:uppercase}
h1.break-text{text-transform:uppercase}
/* Dracula stuff */
/* background */
@josephbolus
josephbolus / install_zellij_btop.sh
Created June 2, 2024 23:07
Installs Zellij and btop with custom MacOS keybindings
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Variables
zellij_version="0.40.1"
btop_version="1.3.2"
zellij_file="zellij-${zellij_version}.tar.gz"
@josephbolus
josephbolus / redis.conf
Created April 24, 2024 19:26
default Redis config
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
@josephbolus
josephbolus / README.md
Last active April 22, 2024 23:04
SeaweedFS Cluster Setup Guide

Configuring Replication at Startup

When you start the master server, you can specify the replication strategy using the -defaultReplication flag. This flag defines how data is replicated across the cluster. Here's how you can set it:

  • 000: no replication
  • 001: replicate once on the same rack
  • 010: replicate once on a different rack, but same data center
  • 100: replicate once on a different data center
  • 200: replicate twice on two different data center
  • 110: replicate once on a different rack, and once on a different data center
[
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen",
},
{
"key": "ctrl+e",
"command": "workbench.action.quickOpen",
"when": "!terminalFocus"
}

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@josephbolus
josephbolus / npm-template.md
Created October 11, 2023 20:24 — forked from scyto/npm-template.md
Nginx Proxy Manager swarm template

Description

This template runs my experimental NPM service as part of evaluating if i should stop using my hand crafted nginx reverse proxy. Note change your passwords and don't use the examples bellow :-) )

State Considerations for SWARM

This container has a database, as such I store the data on the gluster volume. I am currenlty using a mount point to store the voume data on glusterfs. I restrict to 1 instance of each container to avoid database corruption from having two instances. Change example usernames and passwords as needed. leave hostname as db (name resolution works fine using the method)

@josephbolus
josephbolus / Makefile
Last active September 11, 2023 19:04
Self-Documented Makefile
.PHONY: help
help: ## ## Display this help
@printf "\nusage : make <commands> \n\nthe following commands are available : \n\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install: ## Install npm dependencies for the api, admin, and frontend apps
@echo "Installing Node dependencies"
@npm install