Skip to content

Instantly share code, notes, and snippets.

@tomoconnor
tomoconnor / ChatGPT Generated Pasta Bake
Created February 17, 2024 16:27
I told ChatGPT what was in my fridge, and it made me this recipe for an *excellent* pasta bake.
### Ingredients:
- 350g pasta (penne, fusilli, or rigatoni work well)
- 2 tablespoons olive oil
- 1 large red bell pepper, diced
- 1 large green bell pepper, diced
- 1 large onion, finely chopped
- 4 cloves garlic, minced
- Salt and freshly ground black pepper, to taste
- 1 teaspoon Italian seasoning
@tomoconnor
tomoconnor / dhcp-event
Created April 20, 2011 17:09
Thingy for updating powerdns backend when stuff changes
#!/usr/bin/env python
import MySQLdb
import os, sys
import pprint
pp = pprint.PrettyPrinter()
mysql_host = "localhost"
mysql_user = "dbusername"
mysql_pass = "dbpassword"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@tomoconnor
tomoconnor / pom.xml
Created July 22, 2011 11:23
Example pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>jpademo</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<scm>
@tomoconnor
tomoconnor / tmp_files
Created February 6, 2011 23:17
Very simple example munin plugin
#!/usr/bin/env python
import os
from munin import MuninPlugin
class TmpFileCount(MuninPlugin):
title = "Number of Files in /tmp"
args = "--base 1000 -l 0"
vlabel = "files"
scaled = False
For a number of years now, work has been proceeding in order to bring perfection to the crudely concieved idea of a container
orchestration platform that would not only supply inverse reactive containerisation
for use in multicameral storage consolidation, but would also be capable of sharding cardinal load balancers.
Such an instrument is the kubernetes turboencabulator operator.
Now basically the only new principle involved is that instead of storage being created via the
relative motion of bits and nibbles, it is produced by the modial interaction of multicameral storage instances.
The original instance had a base image with cross-compiled kernels surmounted
with logarithmic metadata integration in such a way that the two processing sidecars
@tomoconnor
tomoconnor / translate.py
Created January 1, 2015 21:48
Machine Translation of .po files with Google Translate
#### Requires ####
# goslate==1.3.0
# polib==1.0.5
#### / ####
import os, sys
import goslate
import argparse
import polib
@tomoconnor
tomoconnor / dhquery.py
Created November 17, 2011 15:14
Working fork of dhquery.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fileencoding=utf-8
# vim:tabstop=2
from random import Random
from optparse import OptionParser
from pydhcplib.dhcp_packet import DhcpPacket
from pydhcplib.dhcp_network import DhcpClient
from pydhcplib.type_hw_addr import hwmac
@tomoconnor
tomoconnor / govnotify_email_backend.py
Created March 29, 2020 15:46
Django Email Backend for Gov Notify
"""
Backend for Gov.Notify
"""
from django.core import mail
from django.core.mail.backends.base import BaseEmailBackend
from notifications_python_client.notifications import NotificationsAPIClient
from django.conf import settings
@tomoconnor
tomoconnor / check_optimize.py
Created February 14, 2012 11:06
Check/Optimize/Repair for MySQL
#!/usr/bin/enr python
import time
import MySQLdb
import pprint
from optparse import OptionParser
mysql_user = "<USER>"
mysql_host = "localhost"
mysql_pass = "<PASSWORD>"
mysql_db = "<DATABASE>"