Skip to content

Instantly share code, notes, and snippets.

View clexanis's full-sized avatar

clexanis clexanis

  • 10:11 (UTC +02:00)
View GitHub Profile
@clexanis
clexanis / [email protected]
Last active December 17, 2024 15:21 — forked from Arano-kai/[email protected]
SystemD service and timer templates for duperemove.
[Unit]
Description=Recursive deduplication at %I
Documentation=man:duperemove(8)
Documentation=https://github.com/markfasheh/duperemove.git
Conflicts=shutdown.target rescue.target rescue.service emergency.service
After=local-fs.target
Before=shutdown.target
[Service]
Type=simple
@clexanis
clexanis / discord.sh
Last active November 14, 2023 12:09 — forked from Thibaut-Fontaine/discord.sh
discord update script for linux, debian, ubuntu
#!/bin/bash
format="deb"
platform="linux"
while getopts ":f:p:h" opt; do
case $opt in
f) format="$OPTARG" ;;
p) platform="$OPTARG" ;;
h)
@clexanis
clexanis / lvm-daily-snapshot.sh
Last active September 11, 2023 15:27 — forked from olavmrk/lvm-daily-snapshot.sh
A script to take daily snapshots of a LVM volume.
#!/bin/bash
KEEP_DAYS=15
VG="vg" # LVM volume group we are snapshoting
LV="data-volume-name" # Name of LVM-volume to take a snapshot of
BACKUP_PREFIX="snap-${LV}-" # Prefix of snapshot volume name.
SIZE=10%ORIGIN # Amount of disk space to allocate for the snapshot
# Create new snapshot
@clexanis
clexanis / 40-vm-hotadd.rules
Created April 12, 2023 15:14
Hyper-V Dynamic Memory rule for Debian
# On Hyper-V and Xen Virtual Machines we want to add memory and cpus as soon as they appear
ATTR{[dmi/id]sys_vendor}=="Microsoft Corporation", ATTR{[dmi/id]product_name}=="Virtual Machine", GOTO="vm_hotadd_apply"
ATTR{[dmi/id]sys_vendor}=="Xen", GOTO="vm_hotadd_apply"
GOTO="vm_hotadd_end"
LABEL="vm_hotadd_apply"
# Memory hotadd request
SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory[0-9]*", TEST=="state", ATTR{state}!="online", ATTR{state}="online"
@clexanis
clexanis / zstd.sh
Last active March 30, 2023 19:30
omv-tmp
#!/bin/bash
#
# shellcheck disable=SC1091,SC2086,SC2181
#
# Copyright (c) 2013-2023 OpenMediaVault Plugin Developers
#
# This file is licensed under the terms of the GNU General Public
# License version 3. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.
#
We couldn’t find that file to show.
@clexanis
clexanis / readme.md
Last active October 13, 2021 11:44
Instant notification with Gmail in Android

Instant notification with Gmail in Android.

Since the addition of "doze" on recent versions of Android, notifications of new messages from Gmail can have a delay (from several minutes to a few hours). More here. Since Android 10, it is possible to add gmail to the white-list of "doze", without this setting being forgotten at each startup.

Connect to device.

Verify that you are connected to your device with adb by using the following command:

adb devices

NOTE: If adb replies that you are not authorized, you must authorize the connection from your Android device.

@clexanis
clexanis / BasicExcelToGmail.vba
Created March 15, 2021 19:40 — forked from bergerjac/BasicExcelToGmail.vba
How to Send Email from Excel using Gmail
Option Explicit
' 4 variables below require configuration.
' Once you get this working, refactor, etc.
Sub CDO_Mail_Small_Text_2()
Dim user As String
Dim pass As String
Dim port As Integer
Dim receiverEmail As String
Dim fromEmail As String
@clexanis
clexanis / mount_qcow2.md
Created August 7, 2020 15:23 — 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