Skip to content

Instantly share code, notes, and snippets.

View romansavrulin's full-sized avatar
❤️
Creating wonderful things

Roman Savrulin romansavrulin

❤️
Creating wonderful things
View GitHub Profile
@romansavrulin
romansavrulin / kernel-compilation-test.sh
Created March 6, 2024 15:03
kernel-compilation-test.sh
#!/bin/bash
sudo apt-get install -y git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison
KERNEL_DIR=linux-4.19.274
if [ ! -f $KERNEL_DIR.tar.xz ]; then
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.19.274.tar.xz
fi

Proxmox with LVM-thin and why we should use Trim/Discard

Excerpts from the Proxmox VE Administration Guide]

LVM normally allocates blocks when you create a volume. LVM thin pools instead allocates blocks when they are written. This behaviour is called thin-provisioning, because volumes can be much larger than physically available space.

8.10.2. Trim/Discard It is good practice to run fstrim (discard) regularly on VMs and containers. This releases data blocks that the filesystem isn’t using anymore. It reduces data usage and resource load. Most modern operating systems issue such discard commands to their disks regularly. You only need to ensure that the Virtual Machines enable the disk discard option.

@romansavrulin
romansavrulin / mount_qcow2.md
Created May 5, 2023 20:30 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@romansavrulin
romansavrulin / PVE-HP-ssacli-smart-storage-admin.md
Created March 25, 2023 21:59 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@romansavrulin
romansavrulin / memtest.sh
Last active March 6, 2024 14:28
memtest.sh
#!/bin/bash
set -e
apt update
apt install -y sysbench build-essential nasm lshw jq git
rm -rf bandwidth-benchmark || true
git clone https://github.com/romansavrulin/bandwidth-benchmark.git
cd bandwidth-benchmark/
make
@romansavrulin
romansavrulin / tmux-cheatsheet.markdown
Created February 25, 2023 20:34 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@romansavrulin
romansavrulin / gist:4cc5f86621a95ecedd3675456079fd0e
Created February 23, 2023 15:45
Remove files by md5 sum list
#!/bin/bash
cut -f 2- -d ' ' md5.sum > file.list
input="file.list"
######################################
# $IFS removed to allow the trimming #.
#####################################
while read -r line
do
file=$(echo $line | awk 'sub(/ *$/, "", $0)')
[ -f "$file" ] && rm "$file"
@romansavrulin
romansavrulin / iso_date.groovy
Created April 7, 2021 13:23 — forked from kdabir/iso_date.groovy
current date in iso 8601 in groovy
new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))
@romansavrulin
romansavrulin / remove-slack-settings.sh
Created March 25, 2021 19:03 — forked from skoji/remove-slack-settings.sh
remove Slack settings (OS X)
rm -rf ~/Library/Application\ Support/Slack/
rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/
rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist
rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState
rm ~/Library/Safari/LocalStorage/*slack*