Skip to content

Instantly share code, notes, and snippets.

@akordowski
akordowski / RenameWslDistro.ps1
Last active October 10, 2025 17:38
RenameWslDistro.ps1
function Rename-WslDistro {
param (
[string]$OldDistroName,
[string]$NewDistroName
)
Clear-Host
Write-Warning "This function performs a rename operation on the Windows Registry."
$confirm = Read-Host "Do you want to proceed? (y/n)"

Logrotate Configuration with Systemd Timer

This document explains how to set up logrotate to manage log files more frequently using a systemd timer. This approach is useful for log files that grow rapidly and need to be rotated more often than the daily rotation typically provided by cron jobs.

Logrotate Configuration

First, set up the logrotate configuration for your specific log file. Create a file in /etc/logrotate.d/ for your application. Here is an example configuration that rotates a log file when it reaches a certain size:

@aatizghimire
aatizghimire / XRDP-MultiUser-Installation
Last active August 11, 2025 13:57
This is short tutorial to install XRDP on Ubuntu for multi-user Remote desktop connection.
--------------------------------------------
Xrdp Server (Remote Desktop) Installation:
--------------------------------------------
Tested in Ubuntu 22.04.03 LTS
1. Update Environment
$ sudo apt-get update
$ sudo apt-get upgrade
@tatumroaquin
tatumroaquin / archlinux-qemu-kvm.md
Last active November 6, 2025 10:34
QEMU-KVM Installation for Arch Linux

QEMU-KVM in Arch Linux

Check Virtualization Support

lscpu | grep -i Virtualization
  • VT-x for Intel
  • AMD-Vi for AMD

Ensure that your kernel includes KVM modules

@ld100
ld100 / ArchLinuxWSL2.md
Last active September 14, 2025 12:21
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@kabili207
kabili207 / Rclone systemd service.md
Last active November 2, 2025 13:57
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@jacopotediosi
jacopotediosi / block-tor-exit-nodes-fail2ban.md
Last active August 17, 2025 05:37
Block Tor Exit Nodes with Fail2ban

Below is the procedure to automate the ip ban of tor exit nodes with fail2ban.

  1. Install fail2ban:
sudo apt install fail2ban
  1. Create a new fail2ban jail (editing /etc/fail2ban/jail.local):
[tor]
@DamionDamion
DamionDamion / script.sh
Last active December 1, 2024 14:52
Policyd installation (debian 10, postgresql, postfix)
#
# Debain 10, postgresql, postfix
# This servers as a lose lazy refernce, not a turnkey runscript.
# See: https://wiki.policyd.org/installing
# requirements
apt install libnet-server-perl libnet-cidr-perl libnet-dns-perl libmail-spf-perl libtimedate-perl libdbi-perl libdbd-pg-perl
# Use 2.1.x snapshot
wget https://download.policyd.org/v2.1.x-201310261831/cluebringer-v2.1.x-201310261831.tar.gz
@ldvc
ldvc / apt-downgrade-testing-to-backports.md
Last active February 5, 2020 10:01
Use APT pinning in order to force package downgrade

Reinstall packages (testing → backports)

Temporarily force packages from stretch-backports to be installed even if same version is already installed from testing

cat <<EOF | sudo tee /etc/apt/preferences.d/pinning
Package: erlang*
Pin: release a=stretch-backports
Pin-Priority: 1001
@pmeulen
pmeulen / clamav.pm
Created September 9, 2017 16:03
A spamassassin plugin that calls clamav
## A spamassassin plugin for calling clamav
# Version 2.0 was downloaded from https://wiki.apache.org/spamassassin/ClamAVPlugin
#
# # version 2.0, 2010-01-07
# - use SA public interface set_tag() and add_header, instead of
# pushing a header field directly into $conf->{headers_spam}
#
# # version 2.1, 2017-09-09 (pmeulen):
# - Allow ClamAV::Client, which is provided by debian package libclamav-client-perl, to be used
# in addition to File::Scan::ClamAV