Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
umask 0022
MIRROR_DIR="/var/www/html/yum"
REPOS=(
# Oracle Linux 9 (and EPEL 9 for RHEL 9)
"ol9_baseos_latest"
"ol9_appstream"
#!/bin/bash
# --- INITIALIZATION ---
# Hide cursor for a clean look
tput civis
# Ensure cursor returns on exit
trap "tput cnorm; echo -e '\nExiting...'; exit" SIGINT
# --- DATA GATHERING ---
get_stats() {
# 1. Create LVM Map (Major:Minor -> vgname/lvname)
LVM_MAP=$(sudo lvs --noheadings -o lv_kernel_major,lv_kernel_minor,vg_name,lv_name --separator : | tr -d ' ')
# 2. Iterate using -P (Pairs) to handle empty columns safely.
lsblk -P -n -o NAME,TYPE,FSTYPE,MAJ:MIN,MOUNTPOINT | sed 's/MAJ:MIN/MAJMIN/g' | while read -r line; do
# Load variables safely
eval "$line"
# EXCLUSION: Skip Boot partitions

How to Add Multiple Users in a Single Polkit Rule

Create a new file in the /etc/polkit-1/rules.d/ directory, for example, 50-pcsc-multiple-users.rules.

Use the following JavaScript code, replacing "user1", "user2", and "user3" with the actual usernames of the individuals who need access. You can add as many users as you need.

polkit.addRule(function(action, subject) {
  if (action.id == "org.debian.pcsc-lite.access_pcsc" && (subject.user == "user1" || subject.user == "user2" || subject.user == "user3")) {
 return polkit.Result.YES;
@NQevxvEtg
NQevxvEtg / bulk-ssh-copy.sh
Last active July 30, 2025 17:04
sshcopyid
#!/usr/bin/env expect -f
# Prompt for SSH password once
stty -echo
send_user "Enter SSH password: "
expect_user -re "(.*)\n"
stty echo
send_user "\n"
set ssh_password $expect_out(1,string)