This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# reproduce commands and wrap output in spoilers | |
set -eu | |
export LC_ALL=C | |
# defaults: | |
FILE=test.txt | |
DIR=/tmp | |
REMOTE=teldrive-testbench: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Supporting the software's development team is essential." | |
echo "Check their official website's Support Subscriptions for pricing." | |
echo "Without their dedicated work, we wouldn't have this exceptional software." | |
if ! dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; then | |
sed -i '/data\.status.*{/{s/\!//;s/active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js | |
echo "Disabled subscription nag. Please reload your browser cache." | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import os | |
import sys | |
if __name__ == '__main__': | |
BASE_DIR = f'{os.environ['HOME']}/.var/app/com.vscodium.codium-insiders' | |
os.environ['PIPX_HOME'] = f'{BASE_DIR}/data/pipx' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def main(): | |
print("Paste your text (end with an EOF signal: Ctrl-D on Unix/Mac, Ctrl-Z then Enter on Windows):") | |
try: | |
# Read multiline text from standard input until EOF | |
input_text = [] | |
while True: | |
line = input() | |
input_text.append(line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import time | |
data = b'a' * (10**6) # 1 MB of data | |
# Benchmark SHA-256 | |
start = time.time() | |
for _ in range(1000): | |
hashlib.sha256(data).hexdigest() | |
print("SHA-256 time:", time.time() - start) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Create telegram bots automatically (from your browser's dev console) | |
1. Go to https://web.telegram.org/a/ | |
2. Open dev console | |
3. Copy paste this code | |
4. Adjust the number of bots and sleep settings to your liking (`addBots` and `sleep`) | |
5. Execute | |
6. Collect token, wait and repeat this step |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Place this file in /usr/local/bin and make it executable. | |
## reference: https://forum.restic.net/t/recipes-for-managing-repository-environment-variables/1716/2 | |
REPO_NAME="$1" | |
REPO_SCRIPT="/usr/local/sbin/restic-$REPO_NAME" | |
# Check if the corresponding script exists and is executable | |
if [ -x "$REPO_SCRIPT" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import shlex | |
def wrap(string, width, prefix='', initial_prefix='', subsequent_prefix='', suffix='', initial_suffix='', subsequent_suffix='', word_wrap=False, cmd_wrap=False, join=True, join_with='\n'): | |
lines = [] | |
if word_wrap or cmd_wrap: | |
for line in string.strip().splitlines(): | |
line_list = [] | |
line_length = 0 | |
for word in shlex.split(line, posix=False) if cmd_wrap else line.split(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import configparser | |
import json | |
from pprint import pp | |
def parse_proxmox_config(file_path): | |
parser = configparser.ConfigParser(allow_no_value=True, delimiters=':') | |
with open(file_path, 'r') as file: | |
content = file.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"homepage": "https://github.com/divyam234/rclone", | |
"version": "1.67.2", | |
"license": "MIT license", | |
"url": "https://github.com/divyam234/rclone/releases/download/v1.67.2/rclone-v1.67.2-windows-amd64.zip", | |
"hash": "e32f95a5af686f2e79515ef3eddb52b7a8a21a030388f72223261e869fa5d970", | |
"extract_dir": "rclone-v1.67.2-windows-amd64", | |
"bin": "rclone.exe", | |
"shortcuts": [ | |
[ |
NewerOlder