Skip to content

Instantly share code, notes, and snippets.

@SpareSimian
SpareSimian / asntoipset.py
Created November 30, 2022 01:52
Convert a list of records from iptoasn.com to a firewalld ipset XML file.
#!/usr/bin/env python3
""" Convert a list of records from iptoasn.com to a firewalld ipset XML file.
Download https://iptoasn.com/data/ip2asn-v4.tsv.gz, uncompress, filter
with grep, and feed to this script to generate a file to place in
/etc/firewalld/ipsets for use in firewall rules.
Example:
wget -q -O - https://iptoasn.com/data/ip2asn-v4.tsv.gz | \
@paranoiq
paranoiq / index.php
Created November 29, 2022 12:25
Generator of the Supersymmetric Table of Cellular Automata
<?php
error_reporting(E_ALL);
function bin(int $n): string
{
$bin = str_pad(decbin($n), 8, '0', STR_PAD_LEFT);
return substr($bin, 0, 4) . ' ' . substr($bin, 4, 4);
}
@writzx
writzx / timerService.ps1
Last active July 19, 2023 06:53
Modified ryzenAdj PS Script for applying config periodically without monitoring. No dependency on inpoutx64.dll (no problem with anticheats).
Param([Parameter(Mandatory=$false)][switch]$noGUI)
$Error.Clear()
################################################################################
#### Configuration Start
################################################################################
# WARNING: Use at your own risk!
$pathToRyzenAdjDlls = Split-Path -Parent $PSCommandPath
$monitorPowerSlider = $true
@vyach-vasiliev
vyach-vasiliev / compact-vdisk.sh
Last active March 30, 2024 18:43
Compact VDisk after Docker operations
: script for Windows 10 and above
wsl --shutdown
diskpart
:: opening window Diskpart
:: compact my Docker disk
select vdisk file="C:\Users\Alex\AppData\Local\Docker\wsl\data\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
@cam8001
cam8001 / service-regions.sh
Last active December 20, 2023 19:41
One liner to get list of services keyed to AWS region
#!/bin/bash
curl -s 'https://api.regional-table.region-services.aws.a2z.com/index.json' \
| jq '.prices[] | .attributes | .["aws:region"], .["aws:serviceName"]' \
| sed '$!N;s/\n/,/'
@conofor
conofor / coalesce-12-phosphorescence-6.markdown
Created October 29, 2022 01:42
Coalesce 12 - Phosphorescence 6
@Gemba
Gemba / bashwelcomeextra-README.md
Last active May 28, 2023 03:42
Bash Welcome Extra: Scriptmodule for RetroPie-Setup with additional versions output on bash start.

INSTALLATION

On RetroPie shell as user pi:

cd RetroPie-Setup
mkdir -p ext/local/scriptmodules/supplementary
pushd ext/local/scriptmodules/supplementary
wget -O bashwelcomeextra.sh https://gist.githubusercontent.com/Gemba/bc41f9b2570486b855d6bfa57b3cbdc5/raw/d03b9f101212a0acb37d8750f9006f8639fcc54e/bashwelcomeextra.sh
popd
# remove genuine scriptmodule and install this one
@adelton
adelton / bugzilla-favicon.js
Last active March 28, 2023 23:39
Violentmonkey scripts
// ==UserScript==
// @name Set bugzilla favicon
// @namespace Adelton Violentmonkey Scripts
// @include https://bugzilla.redhat.com/*
// @grant none
// ==/UserScript==
var link = document.querySelector("link[rel = 'shortcut icon']");
if (!link) {
link = document.createElement('link');
# Load git info module
autoload -Uz vcs_info
# Configure git info
local fmt_vcs_status='%F{yellow}‹%b%f%u%c%F{yellow}›%f'
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' unstagedstr '%F{red}●%f'
zstyle ':vcs_info:git:*' stagedstr '%F{green}+%f'
zstyle ':vcs_info:git:*' patch-format ' %p %n/%a'