| Description | Command |
|---|---|
| Start a new session with session name | screen -S <session_name> |
| List running sessions / screens | screen -ls |
| Attach to a running session | screen -x |
| Attach to a running session with name | screen -r |
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
| // ==UserScript== | |
| // @name X Article to Markdown | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0.0 | |
| // @description Copy X (Twitter) long articles as Markdown format | |
| // @author geekjourney | |
| // @match https://x.com/*/status/* | |
| // @match https://x.com/*/article/* | |
| // @icon https://x.com/favicon.ico | |
| // @grant none |
You can use the following commands to limit the maximum power allowed to your NVIDIA GPU when using linux systems.
First, let's check how much power the GPU is allowed to draw and the current value:
nvidia-smi -q -d POWERThis should return an output similar to this one:
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
| # Internet protocols to use: | |
| # Choices: all, ipv6, ipv4 | |
| postfix postfix/protocols select all | |
| # System mail name: | |
| postfix postfix/mailname string myhost.example.com | |
| # Add a 'mydomain' entry in main.cf for upgrade? | |
| postfix postfix/mydomain_warning boolean | |
| # Correct tlsmgr entry in master.cf for upgrade? | |
| postfix postfix/tlsmgr_upgrade_warning boolean | |
| # Root and postmaster mail recipient: |
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
| # TODO: Add ESP disk replacement | |
| # Assuming the disk in problem is /dev/sdb, and we are running off /dev/sda in degraded mode. | |
| # However, if both /dev/sda and /dev/sdb have been booted in degraded mode, | |
| # then the next time when you boot with both disk present, initramfs will not be able to mount root in rw mode. | |
| # In that case, you may have PERMANENT DATA LOSS if you are not careful, and MAKE BACKUPS of your current disks before any recovery. | |
| # I HAVE NOT tried to recovery from such situation, as my plan is always recovery from existing backups. | |
| # However, I'm more likely to recreate the system from scratch, as my data are stored in RAID and with multiple backups, | |
| # so I only need to recreate my VM environment according to the script I'm writting on Gist. I love fresh system anyway. |
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
| # Please follow https://gist.github.com/MakiseKurisu/3a44918bccf3383c0b5ccf362f429c8b first to set up rootfs | |
| # Assuming rootfs on /dev/sdb2, and adding /dev/sda to the RAID-1 configuration | |
| # Remove existing Proxmox installation and LVM Thin storage | |
| pvesm remove local-lvm | |
| vgremove pve -y | |
| # Set up partition table | |
| (echo g; echo n; echo ''; echo ''; echo '+512M'; echo t; echo 1; echo n; echo ''; echo ''; echo ''; echo w) | fdisk /dev/sda |
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
| # The following script was tested for fresh install only, without any VM | |
| # Assuming Proxmox is installed in /dev/sda with LVM-ext4 partition and UEFI boot, and the target disk is /dev/sdb | |
| # Prepare | |
| sed -i "s/deb/#deb/" /etc/apt/sources.list.d/pve-enterprise.list | |
| apt update | |
| apt full-upgrade -y | |
| # WARNING! Check your target disk device name! | |
| lsblk |
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
| #!/bin/bash | |
| for d in /sys/kernel/iommu_groups/*/devices/*; do | |
| n=${d#*/iommu_groups/*}; n=${n%%/*} | |
| printf 'IOMMU Group %s ' "$n" | |
| lspci -nns "${d##*/}" | |
| done |
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
| ############ WordPress #################### | |
| # Disable logging for favicon and robots.txt | |
| location = /favicon.ico { | |
| try_files /favicon.ico @empty; | |
| access_log off; | |
| log_not_found off; | |
| expires max; | |
| } |
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
| #!/bin/bash | |
| # SPDX-License-Identifier: MIT | |
| ## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com> | |
| ## | |
| ## This script is licensed under the terms of the MIT license. | |
| ## https://opensource.org/licenses/MIT | |
| # | |
| # Lockable script boilerplate | |
NewerOlder