- Useful One Liners and Small Scripts
Credit: Ravi Nandval - Superuser
- install:
DISM.exe /Online /Add-Capability /CapabilityName:OpenSSH.Client~~~~0.0.1.0
-
git clone using specific identity file Credit: Jan Toth - devopsinuse
git clone git@github.com:autocloudmaniacs/red-queen-appl.git --config core.sshCommand="ssh -i ~/.ssh/erste"
macos-headless-display.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\SIMULATED_1002_6939_00000001_00000000_100^90637A258A32A466A3662FA204717CB2\00]
"PrimSurfSize.cx"=dword:00000a00
"PrimSurfSize.cy"=dword:00000640
"Stride"=dword:00002800
Used to fix global address syncing issues credit: Peter Schmidt MS Digest
get-childitem -path "c:\users\" -filter "sip*" -recurse -force -errorAction SilentlyContinue | remove-item -confirm
Credit: Alex Lubbock
- Get List of Disks Make Note of identifier of your removable media
diskutil list
- Format the removable Media
diskutil eraseDisk MS-DOS "WINDOWS10" MBR <Your Disk Identifier>
- Mount Windows 10 ISO in Finder
- Make Note of Volume Name
ls /Volumes
- Copy all files except .wim to removable USB
rsync -avh --progress --exclude=sources/install.wim /Volumes/<Your Volume Name>/ /Volumes/WINDOWS10
- install wimlab requires brew
brew install wimlib
- Use WimLib to copy over the .wim files to the removable media
wimlib-imagex split /Volumes/<Your Volume Name>/sources/install.wim /Volumes/WINDOWS10/sources/install.swm 3800
credit: Silas Paul and others stackoverflow
# set all variables defined in the .env file
export $(grep -v '^#' .env | xargs)
# up your composition expecting the defined environment variables
docker-compose up -d
# Unset the variables when done
unset $(grep -v '^#' .env | sed -E 's/(.*)=.*/\1/' | xargs)
credit: superpoussin22 github
export DOCKER_DEFAULT_PLATFORM=linux/amd64
Credit: John Kuriakose
docker-clean.sh
#!/bin/bash
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -a -q)
docker volume prune -f
docker network prune -f
Credit: devopscube
ENTRYPOINT ["tail", "-f", "/dev/null"]
docker run --name [name] -e POSTGRES_PASSWORD=[pass] -e POSTGRES_USER=[user] -e POSTGRES_DB=[dbname] -d -p 5432:5432 postgres
apt-get update && apt-get install -y cron && echo "* * * * * <USER> sh /path/to/script.sh" >> /etc/crontab && service cron restart
echo "from django.contrib.auth.models import User" > createadmin.py
echo "User.objects.create_superuser('$SUPERUSER', '$SUPERUSER_EMAIL', '$SUPERUSER_PASS')" >> createadmin.py
python manage.py shell < createadmin.py
rm -f createadmin.py
credit Serhat Teker
python manage.py shell -c 'from django.core.management import utils; print(utils.get_random_secret_key())'
- install pyenv
brew install pyenv
- install specific python version
pyenv install 3.11.1
- configure zsh ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
fi
- set pyenv global environment
pyenv global 3.11.1
setTimeout(() => {
debugger;
}, 5000);
credit Griffon stackexchange
/etc/polkit-1/localauthority/50-local-d
[Allow Wifi Scan]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.wifi.scan;org.freedesktop.NetworkManager.enable-disable-wifi;org.freedesktop.NetworkManager.settings.modify.own;org.freedesktop.NetworkManager.settings.modify.system;org.freedesktop.NetworkManager.network-control
ResultAny=yes
ResultInactive=yes
ResultActive=yes