Skip to content

Instantly share code, notes, and snippets.

View airtower-luna's full-sized avatar

Airtower airtower-luna

View GitHub Profile
@airtower-luna
airtower-luna / github-clear-notifications.py
Created June 20, 2023 11:11
Mark GitHub notifications as read
import json
import os
import requests
from datetime import datetime, timezone
NOTIFICATIONS = 'https://api.github.com/notifications'
token = os.environ['GH_TOKEN']
s = requests.Session()
s.headers.update({
@airtower-luna
airtower-luna / sha256check.py
Created August 20, 2020 16:44
Example of how to verify an SHA-256 checksum file using Python
#!/usr/bin/python3
# Example of how to verify an SHA-256 checksum file using Python.
# Usage: python sha256check.py sha256sum.txt
import hashlib
import re
import sys
# This regular expression matches a line containing a hexadecimal
# hash, spaces, and a filename. Parentheses create capturing groups.
r = re.compile(r'(^[0-9A-Fa-f]+)\s+(\S.*)$')
@airtower-luna
airtower-luna / gbp.conf
Created October 24, 2017 05:45
git-buildpackage conf for mod_gnutls
[DEFAULT]
debian-branch = for-debian
upstream-tag = mod_gnutls/%(version)s
[import-orig]
filter = aclocal.m4
filter = config/*
filter = config.in
filter = configure
filter = m4/libtool.m4
@airtower-luna
airtower-luna / return_caller_bug.bash
Created March 5, 2017 17:09
Example script: Bash caller builtin lists wrong lineno/function in ERR trap triggered by return
#!/bin/bash -E
function commanderr
{
false
}
function returnerr
{
return 1