Skip to content

Instantly share code, notes, and snippets.

@teward
teward / dnsquery.pl
Created September 19, 2019 00:08
A rough perl script to wrap around a DNS resolver, to resolve domains passed into it via args and produces a list of A and AAAA records.
#!/usr/bin/env perl
use Net::DNS;
my $uri; # preinitialize $uri for use later
if (@ARGV <= 0 || @ARGV > 1) {
my $arglen = @ARGV || 0;
warn "We require ONE argument to be provided, " +
"you provided ", $arglen, ".\n";
@teward
teward / imap_login_test.py
Last active July 10, 2020 12:44
A script for testing IMAP logins. Simply edit SSL_ENABLED to determine if you need SSL or not, IMAP_PORT if you aren't using a standard IMAP or IMAPS port, USERNAME, PASSWORD, and IMAP_SERVER to all suit your own setup. Then run the script. It'll tell you if login worked or not.
#!/usr/bin/python3
import imaplib
# If you need to use SSL/TLS encrypted secure connections,
# then set this to True
SSL_ENABLED = False
# Change this to be your IMAP server hostname.
IMAP_SERVER = 'hostname'
@teward
teward / randommp3
Last active March 3, 2017 02:36
Play a random MP3 file in a specified media player
#!/usr/bin/python
import getpass
import subprocess as sp
import os
import glob
import random
import argparse
if __name__ == "__main__":
@teward
teward / keybase.md
Created February 11, 2016 00:37
keybase.md

Keybase proof

I hereby claim:

  • I am teward on github.
  • I am teward (https://keybase.io/teward) on keybase.
  • I have a public key ASByIImZ48E8hE9KsZw3KqqiqOK6PT4A5twbC8Saf_bWoAo

To claim this, I am signing this object:

@teward
teward / add-restrictions-to-servers-and-networks.patch
Created December 10, 2014 19:31
ZNC-Restrict: Restrict Add/Remove Network and Servers options (Patch includes DEP3 headers for Ubuntu/Debian Packaging)
Description: Add restrictions to prevent users from adding/removing servers and networks, both via *status and the webadmin.
Author: Thomas Ward <teward@ubuntu.com>
Index: b/src/ClientCommand.cpp
===================================================================
--- a/src/ClientCommand.cpp
+++ b/src/ClientCommand.cpp
@@ -466,6 +466,12 @@
PutStatus("Total: " + CString(vChans.size()) + " - Joined: " + CString(uNumJoined) +
" - Detached: " + CString(uNumDetached) + " - Disabled: " + CString(uNumDisabled));
@teward
teward / tumblr-likes-downloader.rb
Last active August 29, 2015 14:08 — forked from joshwand/tumblr-likes-downloader.rb
Updated version that fixes a couple bugs
require 'tumblr_client'
require 'mechanize'
require 'date'
require 'yaml'
require 'uri'
=begin
To configure:
1) Go to this URL: https://www.tumblr.com/oauth/apps