Skip to content

Instantly share code, notes, and snippets.

@jikamens
jikamens / auto-dnsbl.pl
Last active February 17, 2023 05:07
auto-dnsbl.pl (iptables version)
#!/usr/bin/env perl
=pod
=head1 SUMMARY
auto-dnsbl.py - add DNSBL entries to iptables automatically
=head1 DESCRIPTION
@jikamens
jikamens / auto-dnsbl.pl
Last active February 3, 2023 15:32
auto-dnsbl.py - add DNSBL entries to /etc/hosts.deny automatically
#!/usr/bin/env perl
=pod
=head1 SUMMARY
auto-dnsbl.py - add DNSBL entries to /etc/hosts.deny automatically
=head1 DESCRIPTION
@jikamens
jikamens / wayback-check.py
Last active December 24, 2022 16:10
Script for filtering URLs before submitting them to the Wayback Machine for archiving
#!/usr/bin/env python3
# This script filters a list of URLs to determine which of them should be
# submitted to the Internet Archive's Wayback Machine for archiving because
# they are valid URLs and/or they aren't already archived in the Wayback
# Machine.
#
# To check for and filter out URLs which are invalid, specify --check on the
# command line. To filter out URLs that are already archived in the Wayback
# Machine, specify --check-archive on the command line. You must specify either
// https://bugzilla.mozilla.org/show_bug.cgi?id=128072#c32
// Credit: Alexander Bergmann
"use strict;"
// Toggle Replied and Forwarded
if (location == "chrome://messenger/content/messenger.xhtml") {
let toggleRepliedAndForward = {
#!/usr/bin/bash -e
# Pick the first updatable package that isn't held, and list what was
# updated.
trap "rm /tmp/*.$$" EXIT
cp /var/log/dpkg.log /tmp/dpkg.log.$$
apt-mark showhold | awk -F: '{print $1}' |sort -u > /tmp/held.$$
apt list --upgradable 2>/dev/null | awk -F/ 'NR>1 {print $1}' | sort -u > \
#!/usr/bin/env perl
# Memorable, typeable password generator. See https://blog.kamens.us/?p=5969.
#
# By Jonathan Kamens <jik@kamens.us>.
#
# This script is in the public domain. You are welcome to do whatever you want
# with it, though it would be nice if you'd give me credit somehow or at least
# send me email and let me know how you're using it.
#
@jikamens
jikamens / download-helpscout-mailbox.py
Last active October 27, 2021 16:47
Python script for doanloding conversations, customers, and attachments from a Help Scout mailbox
#!/usr/bin/env python
"""Download conversations, customers, and attachments from a Help Scout mailbox
Written by Jonathan Kamens (jik@kamens.us).
Released into the public domain.
Email me patches if you have enhancements you'd like me to incorporate. Don't
bother emailing me bug reports or suggestions; this script does exactly what I
@jikamens
jikamens / hirsute-510-kernel.sh
Created August 9, 2021 12:58
Script to force Ubuntu 21.04 to use kernel version 5.10
#!/bin/bash -e
# You will probably need to adjust this script if you aren't using
# the generic kernel.
to_install=
to_hold=
pd=/tmp/packages.$$
mkdir $pd