Skip to content

Instantly share code, notes, and snippets.

View paride's full-sized avatar

Paride Legovini paride

View GitHub Profile
#!/usr/bin/python3
import sys
import yaml
# Use LibYAML is available, otherwise this is going to be super slow
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
print("Expect slowness!")
#!/usr/bin/python3
import sys
import yaml
# Use LibYAML is available, otherwise this is going to be super slow
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
print("Expect slowness!")
@paride
paride / defer.sh
Created November 20, 2023 18:59
defer
#!/bin/sh
DEFER=
defer() {
DEFER="$*; ${DEFER}"
trap "{ $DEFER }" EXIT
}
#!/bin/bash
set -e
CSV=/usr/share/distro-info/ubuntu.csv
if [[ $# != 1 ]]; then
echo "Usage: $0 <series>"
echo "Example: $0 <jammy>"
exit 1
#!/bin/bash
set -eu -o pipefail
### retry script snippet
retry() {
((${_try:=1}>5)) && exit $? || echo sleep "$((8*_try**3))"
_try=$((++_try)) exec "$BASH" "${BASH_SOURCE[-1]}" "$@"
}
trap 'retry "$@"' ERR
/* https://thelounge.chat/docs/guides/custom-css */
/* Bigger custom CSS field */
textarea#user-specified-css-input {
height: 400px;
width: 600px;
}
/* Compact sidebar */
@paride
paride / build-deb
Last active July 17, 2020 15:56
Build a deb of from the current branch
#!/bin/bash
fail() { echo "$@" 1>&2; exit 1; }
cleanup() {
rm -rf "$tmpd"
git worktree prune
}
if [[ $1 = "-h" || $1 = "--help" ]]; then
cat <<-EOF
@paride
paride / build-deb-prepare
Created July 17, 2020 15:06
Generate debian/ and the .orig tarball from a packaging branch
#!/bin/bash
: "${PACKAGING_BRANCH:=ubuntu/devel}"
: "${RELEASE:=UNRELEASED}"
: "${CLOGVER_DEBIAN:=0ubuntu1}"
: "${DEBFULLNAME:=$(git config user.name)}"
: "${DEBEMAIL:=$(git config user.email)}"
export DEBFULLNAME DEBEMAIL
@paride
paride / github-markdown.css
Created March 8, 2018 18:44 — forked from marcus-at-localhost/github-markdown.css
github-markdown.css for pandoc
/* https://github.com/sindresorhus/github-markdown-css */
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEa

Keybase proof

I hereby claim:

  • I am paride on github.
  • I am paride (https://keybase.io/paride) on keybase.
  • I have a public key whose fingerprint is 1BD8 86F2 46FD 4908 79D4 E150 5A09 B457 6DE8 080E

To claim this, I am signing this object: