Skip to content

Instantly share code, notes, and snippets.

View mrozbarry's full-sized avatar
🥰
Always supporting learning and good work

Alex Barry mrozbarry

🥰
Always supporting learning and good work
View GitHub Profile
@bpolaszek
bpolaszek / mercure-provision.sh
Last active April 9, 2024 20:27
Setup Mercure as a service on Ubuntu 20.04
MERCURE_URL=${MERCURE_URL:=https://github.com/dunglas/mercure/releases/download/v0.10.4/mercure_0.10.4_Linux_x86_64.tar.gz}
JWT_KEY=${JWT_KEY:=!ChangeMe!}
MERCURE_FILE=${MERCURE_URL##*/}
# Settings perms
echo "Creating mercure user..."
groupadd --system mercure
useradd --system \
--gid mercure \
--create-home \
@gabrielsson
gabrielsson / minecraft-on-raspberry-pi.md
Last active May 9, 2024 00:32
Minecraft on Raspberry Pi cluster with metrics

alt

Minecraft on Raspberry Pi cluster with metrics

Ever wanted to put your Rapsberry Pi cluster to great use? Our team is working remotely, so we started to play Minecraft. I decided I would host the Minecraft server on my Raspberry Pi cluster. This gist will guide you through the steps I took to get a k3s cluster up with k3sup and later installed Minecraft as well as metrics exporter and Prometheus Operator

Why?

Quoniam Possumus - Because we can

You'll need

@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
;Install autohotkey https://www.autohotkey.com/download/
;put this in your startup folder
;enjoy
;maps common osx keys.
;ctrl + z,x,c,v,a,s,y are all accessible via winkey + z,x,c,v,a,s,y
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
@mosquito
mosquito / README.md
Last active May 10, 2024 20:44
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@obfusk
obfusk / break.py
Last active May 1, 2024 20:32
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@cmlsharp
cmlsharp / make.sh
Last active February 13, 2018 09:27
In case of reinstall, this script puts all of my dotfiles where they should be, sets up mpd and gives me the option of installing all of my previous packages from the official repos and from the AUR (requires my pkgdump script)
#!/usr/bin/env bash
dir=~/.dotfiles # dotfiles directory
olddir=~/.dotfiles_old # old dotfiles backup directory
files="zshrc vimrc tmux.conf vimperatorrc" # list of files/folders to symlink in homedir
# create dotfiles_old in homedir
echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..."
mkdir -p $olddir
@bobuss
bobuss / Calisthenics.md
Last active March 31, 2024 09:41
The 9 Rules of Object Calisthenics

Object Calisthenics outlines 9 basic rules to apply when performing the exercise:

  • One level of indentation per method.
  • Don't use the ELSE keyword.
  • Wrap all primitives and Strings in classes.
  • First class collections.
  • One dot per line.
  • Don't abbreviate.
  • Keep all classes less than 50 lines.
  • No classes with more than two instance variables.