Skip to content

Instantly share code, notes, and snippets.

View betawax's full-sized avatar

Holger Weis betawax

  • Germany
View GitHub Profile
@betawax
betawax / config
Created December 15, 2023 08:28
SSH Client Config
ServerAliveInterval 120
Host <host>
HostName <hostname>
User <user>
IdentityFile ~/.ssh/<file>
@betawax
betawax / terminal_color_preview.sh
Created December 19, 2022 08:18
Terminal Color Preview
#!/usr/bin/env bash
TEXT_SHORT='Foobar'
TEXT_LONG='The quick brown fox jumps over the lazy dog.'
FGs=(30 90 31 91 32 92 33 93 34 94 35 95 36 96 37 97)
BGs=(40 100 41 101 42 102 43 103 44 104 45 105 46 106 47 107)
echo
@betawax
betawax / SpawnItems.lua
Created November 12, 2022 21:18
Project Zomboid Starter Kit
if SandboxVars.StarterKit then
local bag = playerObj:getInventory():AddItem("Base.Bag_ALICEpack_Army");
bag:getItemContainer():AddItem("Base.Hammer");
bag:getItemContainer():AddItem("Base.Screwdriver");
playerObj:getInventory():AddItem("Base.BaseballBat");
playerObj:getInventory():AddItem("Base.WaterBottleFull");
playerObj:getInventory():AddItem("Base.WaterBottleFull");
playerObj:setClothingItem_Back(bag);
end;
@betawax
betawax / gist:19fa6fdf88d759eff99f0de55d9e36cc
Created July 27, 2022 18:05
Replace a string in the entire Git history
git filter-branch --tree-filter 'if [ -f README.md ]; then sed -i "s/foo/bar/g" README.md; fi' HEAD
@betawax
betawax / docker.sh
Last active December 19, 2022 09:59
Docker
docker build -t <image> .
docker run -d -it -v (pwd):/var/www -p 3000:3000 --name <service> <image>
docker system prune --all --force --volumes
docker compose up -d --no-deps --force-recreate --build <service>
@betawax
betawax / gist:7b8763c10d98dc90e86ddf9b8d37bc96
Created June 16, 2019 10:42
Search & Replace in place
sed -i "s/foo/bar/g" foobar.txt
perl -i -pe "s/foo/bar/g" foobar.txt
ruby -pi -e "gsub(/foo/, 'bar')" foobar.txt
@betawax
betawax / gist:affc848c25565a013ae0077beae079f8
Created May 6, 2019 06:53
Allow the use of sudo without a password
<username> ALL=(ALL) NOPASSWD:ALL
figlet -f slant foobar | lolcat
figlet -f slant foobar | cowsay -n | lolcat
@betawax
betawax / gist:748250f96f4918473590757579b02f89
Created November 24, 2018 22:08
Merge a Git branch with a single commit
git merge --squash <branch>