This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 16 TB drive with ext4 file system optimized for max available space: | |
# -------------------------------------------------------------------- | |
$ sudo mkfs.ext4 -m 0 -T largefile4 /dev/sdX | |
/dev/sdX: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54 | |
/dev/sdX: 8 bytes were erased at offset 0xe8d7dfffe00 (gpt): 45 46 49 20 50 41 52 54 | |
/dev/sdX: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa | |
/dev/sdX: calling ioctl to re-read partition table: Success | |
mke2fs 1.45.5 (07-Jan-2020) | |
Creating filesystem with 3906461696 4k blocks and 3814912 inodes | |
Filesystem UUID: 3ea950c5-ae13-4755-a6b8-6f317f6f8dea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
grep "^HostKey" /etc/ssh/sshd_config | while read -r HOST_KEY; do | |
KEY_FILE=$(echo "$HOST_KEY" | cut -d' ' -f2) | |
KEY_DIR=$(dirname "$KEY_FILE") | |
KEY_TYPE=$(echo "$KEY_FILE" | cut -d'_' -f3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run this every time you open spotify (after it has launched and says it is offline) | |
# it probably notices network manager is stopped for a second which disables the check | |
sudo systemctl restart network-manager.service | |
# turning off network manager makes it immediately show online when it starts up | |
sudo systemctl stop network-manager.service | |
sudo systemctl disable network-manager.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVER=<your-server> | |
DOMAIN=<your-domain> | |
ssh-keygen -R ${SERVER} | |
ssh-keygen -R ${SERVER}.${DOMAIN} | |
ssh-keygen -R $(dig +short ${SERVER}.${DOMAIN}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list of hostnames from file | |
ssh-keyscan -H -f /<path>/<to>/<file> >> ~/.ssh/known_hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires docker-cli 19.03 or higher | |
docker run --privileged linuxkit/binfmt:v0.7 | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker buildx use arm64builder || docker buildx create --name arm64builder --use | |
docker buildx inspect --bootstrap | |
docker buildx build --platform=linux/arm64 -t <tag> -f <docker-file> . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmap -p <port> 192.168.0.*|grep -B3 open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# default theme broken and not available after upgrade from ubuntu 18.04 | |
# running these two commands seems to fix it | |
sudo apt-get --reinstall install ubuntu-session | |
sudo apt-get --reinstall install yaru-* | |
# optionally reset everything | |
dconf reset -f /org/gnome/ | |
# tweak tool to select theme | |
sudo apt-get install gnome-tweak | |
# add adwaita-dark theme variant | |
sudo apt-get install gnome-themes-extra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -print -delete | pv -l > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsettings set org.gnome.desktop.background picture-options 'none' | |
gsettings set org.gnome.desktop.background primary-color '#000000' |