Skip to content

Instantly share code, notes, and snippets.

Screen Quick Reference

Basic

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
// ==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
@tekgnosis-net
tekgnosis-net / limit_gpu_power.md
Created November 4, 2025 03:12 — forked from jctosta/limit_gpu_power.md
Nvidia GPU Power Limits for Linux System

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 POWER

This should return an output similar to this one:

@tekgnosis-net
tekgnosis-net / postfix-debconf-get-selections.txt
Created August 27, 2025 13:55 — forked from gene1wood/postfix-debconf-get-selections.txt
postfix debconf-get-selections using myhost.example.com as an example domain name
# 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:
@tekgnosis-net
tekgnosis-net / proxmox_raid1_recovery.sh
Created October 2, 2024 04:08 — forked from MakiseKurisu/proxmox_raid1_recovery.sh
Recover Proxmox VE RAID-1 configuration when one disk is replaced / readded
# 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.
@tekgnosis-net
tekgnosis-net / proxmox_btrfs_raid1.sh
Created October 2, 2024 04:07 — forked from MakiseKurisu/proxmox_btrfs_raid1.sh
Convert Proxmox VE over Btrfs to RAID-1 configuration
# 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
@tekgnosis-net
tekgnosis-net / proxmox_custom_partition_layout.sh
Created October 2, 2024 04:07 — forked from MakiseKurisu/proxmox_custom_partition_layout.sh
Migrate Proxmox VE to a custom partition layout feat. Btrfs
# 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
@tekgnosis-net
tekgnosis-net / iommu.sh
Created September 29, 2024 07:58 — forked from n1snt/iommu.sh
A simple bash script to get the list of iommu groups & the devices in those iommu groups.
#!/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
@tekgnosis-net
tekgnosis-net / nginx-wordpress.conf
Created September 26, 2024 05:04 — forked from nfsarmento/nginx-wordpress.conf
Harden wordpress security nginx
############ 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;
}
#!/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