Skip to content

Instantly share code, notes, and snippets.

@BH1SCW
BH1SCW / git-rpm-changelog.sh
Created February 24, 2023 12:41 — forked from jflemer-ndp/git-rpm-changelog.sh
generate a rpm spec compatible changelog from git history
#!/bin/bash
merge_commit() {
git show --no-patch --format='%P' "$@" | head -1 | grep -q ' '
}
commit_meta() {
git show --no-patch --format="* %cd %aN <%ae> - %H" --date=local "$@" | \
head -1 | \
sed -E 's/^(\* [a-z0-9 ]{9,10}) \d{2}:\d{2}:\d{2}/\1/i'
@BH1SCW
BH1SCW / rpmgpgsign.sh
Created February 24, 2023 12:36 — forked from jflemer-ndp/rpmgpgsign.sh
Wrapper for non-interactive signing of RPMs
#!/bin/bash
##############################################################################
# Wrapper for non-interactive signing of RPMs.
#
# _NOTE: This uses environment variables for sensitive information (the GPG
# passphrase), so should not be used on an untrusted or shared host._
#
# Prep
# ----
@tropicbliss
tropicbliss / archcheck.sh
Last active April 3, 2024 18:02
Checks your linux architecture. Code taken from rustup installation script, and emits an arch code that corresponds to what rustc expects. Useful for checing cross compilation arch.
#!/bin/sh
if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then
# The version of ksh93 that ships with many illumos systems does not
# support the "local" extension. Print a message rather than fail in
# subtle ways later on:
echo 'archcheck does not work with this ksh93 version; please try bash!' >&2
exit 1
fi
@evindunn
evindunn / get_firewalld_state.py
Last active December 20, 2023 19:41
Poll Firewalld State as JSON
#!/usr/bin/env python3
import dbus
import json
FIREWALLD_BUS = "org.fedoraproject.FirewallD1"
FIREWALLD_RUNTIME_OBJ = "/org/fedoraproject/FirewallD1"
FIREWALLD_CONFIG_OBJ = "/org/fedoraproject/FirewallD1/config"
@pmarreck
pmarreck / wh_darktide_quote.bash
Created January 29, 2023 21:19
Bash function to generate a random Warhammer Darktide loading screen quote
warhammer_quote() {
local whquotes
whquotes=(
"A coward's only reward is to live in fear another day"
"A dagger in the dark is worth a thousand swords at dawn"
"A pity it is that we can die but once in the Emperor's service"
"A small mind is a tidy mind"
"A suspicious mind is a healthy mind"
"A swift execution is worth a hundred interrogations"
"Abhor the mutant"
@vyach-vasiliev
vyach-vasiliev / ReadMe.md
Last active April 22, 2023 00:44
One element CSS Snow by Keith Clark
@BH1SCW
BH1SCW / create-centos-6.5-mini-unattended-iso.sh
Created January 2, 2023 18:01 — forked from skiane/create-centos-6.5-mini-unattended-iso.sh
# This script create a Centos Minimal Unattended ISO
# This script create a Centos Minimal Unattended ISO
# This method is based on excellent article http://pyxlmap.net/technology/software/linux/custom-centos-iso
#
# This script has be tested with CentOS 6.5
# TODO:
# * test package update to reduce the update task on the target system. The following command downloads all updates :
# (cd $CENTOS_CUSTOM_PATH/Packages ; yumdownloader $(for i in *; { echo ${i%%-[0-9]*}; } ) )
# Some global settings :
@rikkix
rikkix / trss.go
Created December 28, 2022 11:41
convert Telegram Channel to RSS Feed
/*
MIT License
Copyright (c) 2020 Richard Chen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@deepaste
deepaste / services.py
Last active May 30, 2023 12:48
Dictionary of UDP and TCP services - Python
# Network services, Internet style
# Updated from https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml .
SERVICES = {
1: "tcpmux",
7: "echo",
7: "echo",
9: "discard",
9: "discard",
11: "systat",
13: "daytime",
@neggles
neggles / Download-File.ps1
Last active July 19, 2023 06:53
download a file with powershell w/o using invoke-webrequest or DoSing yourself with progress prompts
function Download-File {
[CmdletBinding()]
param (
[Parameter(Mandatory = $True,
Position = 0,
HelpMessage = 'The URI of the file to download.')]
[ValidateNotNullOrEmpty()]
[Alias('Url', 'FileUri')]
[String]$Uri,
# Specifies a path to one or more locations.