Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(:5.34);
use experimental qw(signatures);
use Algorithm::Combinatorics qw(permutations combinations);
# solve BUNNY + BUNNY = RABBIT
my @var = split '', 'BUNYRAIT';
@waltman
waltman / cant_pay.txt
Created March 14, 2022 00:38
I've got a feeling we're going to be seeing more of this.
19:08 < Aloveth> Hi, Linode. Can i pay by JCB or UnionPay card?
19:09 -!- bencc1 [~bencc1@2a00:a040:197:3af:b3ae:86f:9c41:32fd] has quit [Ping timeout: 480 seconds]
19:11 < file> payment methods are on the site, https://www.linode.com/docs/guides/how-linode-billing-works/#payment-methods
19:11 < file> JCB or UnionPay are not directly in that list
19:15 -!- Aloveth [~oftc-webi@85.140.93.69] has quit [Remote host closed the connection]
19:20 -!- Aloveth [~oftc-webi@85.140.93.69] has joined #linode
19:20 < Aloveth> Hi, Linode. Can i pay by UnionPay card?
19:21 < file> payment methods are on the site, https://www.linode.com/docs/guides/how-linode-billing-works/#payment-methods
19:21 < file> JCB or UnionPay are not directly in that list
19:21 < Aloveth> Will you update list?)
@waltman
waltman / gnome-crash.txt
Last active February 12, 2021 01:11
/var/log/syslog when gnome crashed after apt upgrade of libgnome-autoar-0-0 libgnome-autoar-gtk-0-0 libsqlite3-0 libsqlite3-dev sqlite3 wpasupplicant
Feb 11 19:42:41 scruffy dbus-daemon[1908]: [system] Reloaded configuration
Feb 11 19:42:41 scruffy dbus-daemon[1908]: message repeated 2 times: [ [system] Reloaded configuration]
Feb 11 19:42:41 scruffy systemd[1]: Reloading.
Feb 11 19:42:41 scruffy systemd[1]: /lib/systemd/system/plymouth-start.service:17: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed.
Feb 11 19:42:41 scruffy systemd[1]: /lib/systemd/system/dbus.service:12: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed.
Feb 11 19:42:41 scruffy systemd[1]: /lib/systemd/system/rpc-statd.serv
@waltman
waltman / wrap-tex-region.el
Created March 1, 2020 20:19
Wrapping a region with a TeX command in elisp
(defun wrap-tex-region (cmd)
"Wraps the region in a TeX command"
(interactive "*")
(exchange-point-and-mark)
(insert "\\" cmd "{")
(exchange-point-and-mark)
(insert "}")
)
(defun emph-region ()
@waltman
waltman / sieve.py
Created December 12, 2019 00:31
Find all the 4-digit primes containing only the digits 1,3,7
import math
import re
def sieve(upto):
primes = set(range(2,upto+1))
for i in range(2, int(math.sqrt(upto)+1)):
if i in primes:
primes -= set(range(i**2, upto, i))
return list(primes)
@waltman
waltman / watch-http.pl
Created September 6, 2019 18:48
Script to check list of websites and report if any have changed
#!/usr/local/bin/perl -w
# $Id: watch-http,v 1.3 2007/03/26 11:58:59 waltman Exp $
use strict;
use LWP::Simple;
my $dir = "$ENV{HOME}/.watch-http";
chdir $dir
or die "Can't chdir to $dir: $!\n";
@waltman
waltman / plug-announce.pl
Created June 11, 2019 00:23
cronjob script to warn me to send out a plug-announce email
#!/usr/local/bin/perl
# send out a warning email if it's $N days before a PLUG meeting
use strict;
use warnings;
use feature qw(:5.30);
use experimental qw(signatures);
use Date::Manip;
my $N = 3;
#!/usr/bin/env python3
# PLUG North is on the 2nd Tueday of the month, and PLUG Central
# is on the 1st Wednesday of the month. North is always the Tuesday
# after Central unless, like in May 2019, the first of the month is
# a Wednesday. I argued that this only happens 1/7 of the time. This
# is an attempt to demonstrate it programmatically.
def months_starting_on_wed(jan1, year):
days_in_month = [
@waltman
waltman / keybase.md
Created September 30, 2018 14:44
Keybase proof

Keybase proof

I hereby claim:

  • I am waltman on github.
  • I am waltman (https://keybase.io/waltman) on keybase.
  • I have a public key ASBmlP3AbWwn5b1LUG7KyAX-0QZ3Sv-mfkbZjaxWbvwcPAo

To claim this, I am signing this object:

@waltman
waltman / gist:ae243980acfd575bfc3caa8554837f1a
Created May 1, 2018 18:55
Error using perlbrew to install 5.26.2 on macOS 10.13.4
../cpan/Digest-SHA/t/sha224.t ...................................... ok
Use of uninitialized value $value in string eq at t/db-hash.t line 224.
Use of uninitialized value $values[0] in string eq at t/db-hash.t line 224.
Use of uninitialized value $value in lc at t/db-hash.t line 224.
Use of uninitialized value $h{""} in string eq at t/db-hash.t line 243.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.
Use of uninitialized value in numeric eq (==) at t/db-hash.t line 252.