Skip to content

Instantly share code, notes, and snippets.

View 2lach's full-sized avatar
🌀

Stefan Lachmann 2lach

🌀
View GitHub Profile
@2lach
2lach / Docker_functions.sh
Created December 7, 2023 07:33
My time saving super awesome docker functions
#!/usr/bin/bash
####################
# Docker
####################
function docker-ps() {
docker ps --format 'table {{.Names}}\t{{.Image}}'
}
function docker-pa() {
@2lach
2lach / git-ssh.sh
Last active November 23, 2022 20:59
how to setup git with ssh
ssh-keygen -t rsa -b 4096 -C "gituser@email.com"
eval "$(ssh-agent -s)"
# if there is no 'config' file in ~/.ssh
touch ~/.ssh/config
----------------------------------
# in file config, this will add ssh to keychain
----------------------------------
Host *
@2lach
2lach / terminal-output.md
Last active February 7, 2020 16:54
Grab terminal output

Some terminal stuff

How to grab the keypressed in terminal (useful for keybindings)

$ cat -  (+ ENTER)
^[[H     (fn + left)

Log Terminal output

@2lach
2lach / macOS-installer-usb.md
Last active August 7, 2021 19:32
How to create a macOS installer on usb oneliner

Create installer MacOS/OSX

First of all: Insert USB drive (usally 8GB+ is needed). format w disk utility to GUID Partition Map and Mac OS Extended (Journaled).

can be downloaded from App Store or with: softwareupdate --fetch-full-installer

@2lach
2lach / de-prioritize.sh
Last active February 26, 2020 21:57
Throttle & Normalize mac apps: Backup and Sync, Google Chrome, Time machine
# *** note: These apps cause memory and cpu issues for me
# *** and this approach works fine for me on my mac, ii have not tested it on any other OS and cannot garantee anything
# *** so feel free to use them but dont blame me if shit goes boom
### Backup and Sync
for f in $(pgrep 'Backup and Sync'; pgrep 'FinderSyncAPIExtension'); do renice +20 -p $f; done
### Chrome
for f in $(pgrep 'Chrome'); do renice +20 -p $f; done
### Time machine
@2lach
2lach / remove-minikube-from-machine.sh
Last active January 25, 2020 20:51
💥 minikube
minikube stop;
minikube delete
docker stop (docker ps -aq)
rm -r ~/.kube ~/.minikube
sudo rm /usr/local/bin/localkube /usr/local/bin/minikube
systemctl stop '*kubelet*.mount'
sudo rm -rf /etc/kubernetes/
docker system prune -af --volumes