Skip to content

Instantly share code, notes, and snippets.

View Qalthos's full-sized avatar

Kate Case Qalthos

View GitHub Profile
@Qalthos
Qalthos / timestamp.py
Created October 14, 2024 18:25
Automatic Discord timestamp generator
import sys
from datetime import datetime
from dateparser import parse
def main():
date = parse(" ".join(sys.argv[1:]))
now = datetime.now()
@Qalthos
Qalthos / hexball.js
Last active January 24, 2023 15:29
Blaseball Hexdecimal Innings
// ==UserScript==
// @name Blaseball Hex Innings
// @namespace http://linkybook.com
// @version 0.3
// @description Rewrite extra innings in hexdecimal
// @author Qalthos
// @match https://blaseball.com/*
// @match https://www.blaseball.com/*
// ==/UserScript==
#!/usr/bin/env python
def slurp_file(filename):
with open(filename) as file_obj:
return file_obj.readlines()
def main():
lines = slurp_file("tests/sanity/ignore-2.9.txt")
# lines = slurp_file("tests/sanity/ignore-2.10.txt")
@Qalthos
Qalthos / read_minutes.py
Last active February 13, 2020 14:14
Meetbot Minutes Metastasizer
#!/usr/bin/env python3
import argparse
import requests
TEMPLATE = """
{date}
==========
{content}
from __future__ import unicode_literals, print_function
from ansible.module_utils.basic import AnsibleModule, return_values
DOCUMENTATION = '''
---
module: napalm_cli
author: "Charlie Allom"
version_added: "2.2"
short_description: "Executes network device CLI commands and returns response using NAPALM"

With connection: network_cli, the provider dictionary is no longer necessary. Here is a quick rundown of provider keys and their variable and commandline equivalents

provider inventory variable commandline
host ansible_host N/A
port ansible_port N/A
@Qalthos
Qalthos / backup
Last active August 29, 2015 14:09
Backup all the things
#!/bin/bash
BACKUP=/data/backup/$(hostname)
DATE="$(date '+%Y-%m-%d--%H-%M')"
OPTS='-amxHAX --partial --delete --delete-excluded --exclude-from=.exclude --rsh=ssh --link-dest=../current'
IGNORE_ERROR=(0 23 24)
if [ "$1" == "-v" ]; then
OPTS="$OPTS -vh --progress"
fi
pushd ~ > /dev/null
# Mount drive here
dd if=/dev/zero of=/path/to/mount/zero
# Unmount drive here
sudo dd if=/dev/whatever bs=4k | pv | 7za a -si -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z -bd
@Qalthos
Qalthos / gist:9128758
Created February 21, 2014 04:27
re-organize music
#!/usr/bin/env python
from __future__ import unicode_literals, print_function
import os
import re
import mutagen
for path, dirs, files in os.walk('old'):
@Qalthos
Qalthos / gist:6889584
Last active December 25, 2015 00:39
eventbrite grab attendees
import eventbrite
eb_tokens = dict(app_key='APPLICATION_KEY')
eb_cl = eventbrite.EventbriteClient(eb_tokens)
response = eb_cl.event_list_attendees(dict(id='8645022495',
only_display='first_name,last_name,answers'))
attendees = list()
for a_dict in response['attendees']:
a_dict = a_dict['attendee']