How to remove old 6.17.x kernel packages when using 7.0.x kernel :
pveversion
proxmox-boot-tool kernel list
apt purge proxmox-kernel-6.17*
How to remove old 6.17.x kernel packages when using 7.0.x kernel :
pveversion
proxmox-boot-tool kernel list
apt purge proxmox-kernel-6.17*
find . -type f ! -name "*.?*" -delete
A quick and dirty way to make a specific hard drive LED blink so that it can be identified.
while true; do smartctl -a /dev/<device>; done
The simple trick is to run smartctl in a while loop. The command will run forever until you Ctrl + C. It make the LED blink rather obviously, which made things much easier.
Other method :
To start: ledctl locate=/dev/sdd
To stop: ledctl off={/dev/sdd}
This lives in the ledmon package.
grep -rnlw '/path/to/dir/' -e 'pattern'
-r or -R is recursive,-n is line number, and-w stands for match the whole word.-l can be added to just give the file name of matching files.-e is the pattern used during the searchAlong with these, --exclude, --include, --exclude-dir flags could be used for efficient searching:
grep --include=\*.{c,h} -rnw '/path/to/search/' -e "pattern"grep --exclude=\*.o -rnw '/path/to/search/' -e "pattern"--exclude-dir parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/:grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/search/' -e "pattern"Show used ports across all containers :
docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a
Rosetta 2 doesn’t install automatically on an ARM-based mac without X86-64 apps. If you try to run an Intel-only binary on an Apple Silicon chip, the default message will be :
bad CPU type in executable: {executable_path}
To install Rosetta 2, run :
softwareupdate --install-rosetta
This change will add the “Anywhere” option for opening apps to the Security preference panel in macOS Sonoma and Sequoia, which is hidden by default otherwise.
sudo spctl --master-disable
You’ll see a confirmation reported back stating: “Globally disabling the assessment system needs to be confirmed in System Settings.”
To re-enable the default behaviour, use :
sudo spctl --master-enable
In general you can use the mdfind (MetaData Find) command to (very) quickly search for files.
The mdfind command consults the central metadata store and returns a list of files that match the given metadata query. The query can be a string or a query expression.
mdfind kMDItemKind="Alias"
This will recursively traverse the /path/to/folder directory and list only the symbolic links:
ls -lR /path/to/folder | grep '^l'
If your intention is to follow the symbolic links too, you should use your find command but you should include the -L option; in fact the find man page says:
-L Follow symbolic links. When find examines or prints information
about files, the information used shall be taken from the prop‐
erties of the file to which the link points, not from the link
itself (unless it is a broken symbolic link or find is unable to
examine the file to which the link points). Use of this option
implies -noleaf. If you later use the -P option, -noleaf will
still be in effect. If -L is in effect and find discovers a
symbolic link to a subdirectory during its search, the subdirec‐
tory pointed to by the symbolic link will be searched.
When the -L option is in effect, the -type predicate will always
match against the type of the file that a symbolic link points
to rather than the link itself (unless the symbolic link is bro‐
ken). Using -L causes the -lname and -ilname predicates always
to return false.
Then try this:
find -L /var/www/ -type l
This will probably work: I found in the find man page this diamond: if you are using the -type option you have to change it to the -xtype option:
l symbolic link; this is never true if the -L option or the
-follow option is in effect, unless the symbolic link is
broken. If you want to search for symbolic links when -L
is in effect, use -xtype.
Then:
find -L /var/www/ -xtype l
In macOS, when a key is held down while entering text, a popup is shown which lets one choose between various accented forms of the character. To disable this execute the following command line in the Terminal :
defaults write -g ApplePressAndHoldEnabled -bool false
You’ll need to log out and log back in again for the setting to take effect.
This should disable the display of the popup and character typed should start repeating when the key is held down.
If you ever wish to revert to the orignial behaviour, execute the following command line in the Terminal :
defaults write -g ApplePressAndHoldEnabled -bool true
You’ll need to log out and log back in again for the setting to take effect.
sudo diskutil list
sudo diskutil unmountdisk /dev/diskX
sudo dd if=path/to/distro.iso of=/dev/diskX bs=1m
Stop critical services running on the host machine
systemctl stop XXX.service
Update the current running system to minimize the update gap :
apt update && apt full-upgrade
Remplace all occurrences of the old release (bookworm) with the new one (trixie) in the APT sources file :
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.list
Update the APT repository with the new packages list. You will get an estimate of the number of packages that will be upgraded.
apt update
Proceed with upgrading the packages. This step is the most time-consuming since it downloads the new packages. A list of important changes will be displayed, read it carefully. You can read through with Space and escape with Q. During the upgrade, you might be asked if you want to restart running services, you cant answer with Y.
apt full-upgrade
Once everything is up-to-date, restart the host :
reboot
Confirm you are running the new OS version :
cat /etc/os-release
Upgrade the source files to the new deb822 format, confirm with Y :
apt modernize-sources
List obsolete packages :
apt list '~o'
Attention, some packages installed outside official APT repos might be treated as obsolete. Double-check these carefully before purging obsolete packages :
apt purge '~o'
apt autoremove
See https://www.debian.org/releases/ for current information.
| Version | Code Name | Release Date | End of Life |
| 13 | Trixie | 2025-08-09 | 2028-08-09 |
| 12 | Bookworm | 2023-06-10 | 2026-06-10 |
| 11 | Bullseye | 2021-08-14 | 2024-08-14 |
| 10 | Buster | 2019-07-06 | 2022-09-10 |
Obsolete releases :
brew install yt-dlp
yt-dlp -x --audio-format mp3 {youtube-url}
yt-dlp -f "bestvideo[height<=1080]+bestaudio[ext=m4a]" -S vcodec:h264 {youtube-url}
In Control Panel, go to Network and Internet.
Next, click on Internet Options.
In the Internet Properties dialog, open the Security tab.
Next, select the Local intranet option and then click on the Sites button for Local intranet.
In the new window, click on the Advanced button.
In the Add this website to the zone field, you need to add the IP address (or FQDN) of the server and click Add.
Click Close and OK to save the changes.
| OS Version | Command |
| macOS 12 (Monterey) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| macOS 11 (Big Sur) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| macOS 10.15 (Catalina) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| macOS 10.14 (Mojave) | sudo killall -HUP mDNSResponder |
| macOS 10.13 (High Sierra) | sudo killall -HUP mDNSResponder |
| macOS 10.12 (Sierra) | sudo killall -HUP mDNSResponder |
| OS X 10.11 (El Capitan) | sudo killall -HUP mDNSResponder |
| OS X 10.10 (Yosemite) | sudo discoveryutil udnsflushcaches |
| OS X 10.9 (Mavericks) | sudo killall -HUP mDNSResponder |
| OS X 10.8 (Mountain Lion) | sudo killall -HUP mDNSResponder |
| Mac OS X 10.7 (Lion) | sudo killall -HUP mDNSResponder |
| Mac OS X 10.6 (Snow Leopard) | sudo dscacheutil -flushcache |
| Mac OS X 10.5 (Leopard) | sudo lookupd -flushcache |
| Mac OS X 10.4 (Tiger) | lookupd -flushcache |
ipconfig /flushdns
#!/bin/sh
WEB_JS=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
if [ -s "$WEB_JS" ] && ! grep -q NoMoreNagging "$WEB_JS"; then
echo "Patching Proxmox VE Web UI nag..."
sed -i -e "/data\.status/ s/!//" -e "/data\.status/ s/active/NoMoreNagging/" "$WEB_JS"
fi
echo "Restarting Proxmox VE Web UI..."
systemctl restart pveproxy.service
This has been tested in Proxmox VE 9.1 and must be run after each update of the Proxmox User Interface. (source : https://community-scripts.github.io/ProxmoxVE/)
In the file :
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
search for the line :
.data.status.toLowerCase() !== 'active') {
and replace with :
.data.status.toLowerCase() == 'active') {
Then, restart the Web UI :
systemctl restart pveproxy.service
First find the key in the old location
apt-key list | grep -A4 "trusted.gpg$"
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
pub rsa2048 2012-06-17 [SC]
CF8A 1AF5 02A2 AA2D 763B AE7E 82B1 2992 7FA3 303E
uid [ unknown] Raspberry Pi Archive Signing Key
What you need from this is the last 8 characters of the long hexadecimal number, without the spaces. In this case, 7FA3303E. Then you export the key to a temporary file.
apt-key export 7FA3303E | sudo gpg --dearmor -o /tmp/raspi.gpg
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
This should have created a file /tmp/raspi.gpg with the key in.
file /tmp/raspi.gpg
/tmp/raspi.gpg: PGP/GPG key public ring (v4) created Sun Jun 17 15:49:51 2012 RSA (Encrypt or Sign) 2048 bits MPI=0xabc2a41a70625f9f…
Now delete the old key.
apt-key del 7FA3303E
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
And finally put the new key in place.
Code: Select all
mv /tmp/raspi.gpg /etc/apt/trusted.gpg.d/raspberrypi-bookworm-stable.gpg
The reason for doing the steps in this order is that otherwise the new key gets deleted as well as the old one.
For Raspberry Pi OS Bookworm :
Add the video information to the end of cmdline.txt :
(located at /boot/firmware/cmdline.txt or on the /boot partition of the SD Card.)
video=DSI-1:800x480@60,rotate=<rotation-value>
Replace the <rotation-value> placeholder with one of the following values, which correspond to the degree of rotation relative to the default on your display: 0 (default), 90, 180 (reversed), 270
(https://www.raspberrypi.com/documentation/accessories/display.html)
For Raspberry Pi OS Buster / Bullseye :
Add one of the following values in config.txt
(located at /boot/firmware/cmdline.txt or on the /boot partition of the SD Card.)
lcd_rotate=0 # default (normal landscape)
lcd_rotate=1 # 90 degrees (portrait, upside down)
lcd_rotate=2 # 180 degrees (landscape)
lcd_rotate=3 # 270 degrees (portrait, upside down)
defaults write com.apple.PowerChime ChimeOnAllHardware -bool true
Available for Mac OS 10.10.3 and up
Enterprise Linux 9 / Raspberry Pi OS 12 :
sudo nmtui
Or
su
# list devices (ens192 used as example below)
nmcli device
# set [manual] for static setting or [auto] for DHCP
nmcli connection modify ens192 ipv4.method manual
nmcli connection modify ens192 ipv4.addresses xx.xx.xx.xx/24
nmcli connection modify ens192 ipv4.gateway xx.xx.xx.1
# for multiple DNS, specify with space separated
nmcli connection modify ens192 ipv4.dns "xx.xx.xx.1 xx.xx.xx.2"
# restart the interface to reload settings
nmcli connection down ens192; nmcli connection up ens192
# confirm the applied settings
nmcli device show ens192
# confirm state
ip address show
Debian 12 :
su
ip a
nano /etc/network/interfaces
# restart the interface to reload settings
systemctl restart networking
# confirm state
systemctl status networking
Raspbian 10 / Raspberry Pi OS 11 :
sudo nano /etc/dhcpcd.conf
In Activity Monitor, kill the QuickLookUIService process.
This might also help
qlmanage -r cache
Install the vmfs pckages :
sudo apt install vmfs6-tools
Mount the partition sdX1 using FUSE :
vmfs6-fuse /dev/sdX1 /mnt/media
There are hidden files in the root of any VMFS volume which start with a dot and end with the extension .sf, and some free space seems to be missing from a newly created VMFS datastore.
These system files are indexes and descriptors of the files on the VMFS filesystem and cannot be deleted.
The VMFS-3 file system organizes all space on disk in collections of resources. There are four resource types managed by the VMFS-3 file system: Blocks, sub-blocks, pointer blocks, and file descriptors.
Resources are grouped together into collections called CLUSTERs and clusters can be further grouped together into CLUSTER GROUPS.
Each resource type is managed by one of several system files which are created during the file system bootstrap process:
The VMFS-5 file system uses one additional system file:
Open up /etc/samba/smb.conf and add the following lines to each share :
veto files = /._*/.DS_Store/
delete veto files = yes
restart samba :
systemctl restart smbd.service
If neede, cleanup the server of unwanted .DS_Store files :
find ./ -type f -name ".DS_Store" -exec rm -f {} \;
or
find ./ ( -name ".DS_Store" -or -name "._" -or -name "Thumbs.db" -or -name ".tmp" -or -name "*.lnk" -or -name "TemporaryItems" -or -name "folders.501" -or -name ".TemporaryItems" -or -name "__MACOSX" ) -ls -delete
In the Proxmox VE host, display the local disks in the Disks section and note the device you’ll be passing to your VM (e.g. /dev/sdX).
Then, run the host console in the web UI or connect via ssh.
Take note of the VM ID that the physical hard disk will be connecting to.
list the local disks available (since we’ll be passing a physical disk, ignore partitions) :
ls -n /dev/disk/by-id/
sample output :
lrwxrwxrwx 1 0 0 9 Feb 11 10:05 ata-CT1050MX30SSD1_1723175912B9 -> ../../sdb
…
lrwxrwxrwx 1 0 0 9 Feb 11 10:05 ata-CT525MX300SSD1_171816E67E70 -> ../../sdc
…
lrwxrwxrwx 1 0 0 9 Feb 11 10:05 ata-CT500MX500SSD1_21102D720097 -> ../../sda
Make sure the VM is stopped before changing its configuration.
Using the VM ID noted earlier, pass the disk to your VM either as a virtio or sata (recommended) device :
qm set VMID -sata1 /dev/disk/by-id/YYY
usage:
qm set %VMID% -%VIRTUALDEVICE% %DISKID
%VIRTUALDEVICE% can ben set as sataN where N is a digit between 0 and 5.
Then, check in the VM’s Hardware tab that the disk is listed.
Verify inside the guest OS that the physical disk is connected, then it can then be used normally as a physical disk (mount partitions, etc…)