This file contains hidden or 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
| rsync -avhn /data_temp/ /data/ # dry run | |
| rsync -avh /data_temp/ /data/ # copy with archive mode, permissions, lock |
This file contains hidden or 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
| # 1. Check that the disk is empty (no partitions) | |
| lsblk /dev/sdb | |
| # 2. Create GPT partition table | |
| parted /dev/sdb --script mklabel gpt | |
| # 3. Create one full-size LVM partition | |
| parted /dev/sdb --script mkpart primary 0% 100% | |
| # 4. Mark the partition as LVM type |
This file contains hidden or 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
| # Create admin user in Gitea CLI | |
| # substitute $USER, $PASSWORD, $EMAIL | |
| gitea admin user create \ | |
| --username $USER \ | |
| --password $PASSWORD \ | |
| --email $EMAIL \ | |
| --admin | |
This file contains hidden or 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
| rm -f ~/.local/share/keyrings/user.keystore | |
| rm -f ~/.local/share/keyrings/login.keyring |
This file contains hidden or 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
| # put this file in hour $HOME path with the following content | |
| /usr/bin/dbus-launch --exit-with-session xfce4-session | |
| # do chmod 700 .xsession | |
| # in Fedora 43, no need to create or modify /etc/xrdp/startwm.sh |
This file contains hidden or 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
| # set $SSID, $KEY (clear text yes), $IFACE, $UUID (generate uuidgen), to have system defined pre login wifi connection, do not set permissions, set psk-flags=0 | |
| # path /etc/NetworkManager/system-connections/ | |
| # after creation, sudo systemctl restart NetworkManager | |
| [connection] | |
| id=$SSID | |
| uuid=$UUID | |
| type=wifi | |
| interface-name=$IFACE | |
| permissions= |
This file contains hidden or 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
| openssl req -x509 -nodes -days 365 \ | |
| -newkey rsa:4096 \ | |
| -keyout self.key \ | |
| -out self.crt \ | |
| -subj "/C=CT/ST=ST/L=L/O=O/OU=IT/CN=FQDN" |
This file contains hidden or 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
| # set gateway to wireguard interface gw and the interface (like wg2) | |
| GATEWAY="$GATEWAY" | |
| IFACE="$IFACE" | |
| INTERVAL=10 | |
| while true; do | |
| if ! ping -c 2 -W 2 "$GATEWAY" > /dev/null; then | |
| logger "WireGuard watchdog: gateway not reachable, shutting down $IFACE" | |
| wg-quick down "$IFACE" | |
| exit 0 | |
| fi |
This file contains hidden or 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
| # substitute your user | |
| # path: /etc/polkit-1/localauthority/50-local.d/ | |
| # sudo systemctl restart polkit | |
| [Allow all for $USER] | |
| Identity=unix-user:$USER | |
| Action=* | |
| ResultAny=yes | |
| ResultInactive=yes | |
| ResultActive=yes |