This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import csv | |
import requests | |
from bs4 import BeautifulSoup | |
# WHY DO THE <TD>s LACK CLOSING BRACKETS!?! | |
CS_TABLE_URL = "https://web.cs.umass.edu/csinfo/autogen/cmpscicoursesfull.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# This is a hack since Metricbeat doesn't support importing templates through LogStash, only a direct elastic connection | |
# This script checks to see if there is a newer version of Metricbeat avaliable, and if there is, runs it so the new template gets installed. | |
# This works around the issue I described here https://discuss.elastic.co/t/illegal-argument-exception-when-metricbeat-begins-new-index/243269 | |
# You should only run this script on the machine running elasticsearch | |
# ALWAYS run this BEFORE using a new version of metricbeat | |
# Requires Docker (or podman) and jq. Tweak as you may. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go to https://script.google.com/home | |
// Create a new script, pase all of this, and click run | |
// The first run will ask you for permissions, and it may time-out before trashing all the emails, so run it again as necessary | |
// Optionally, create a time based trigger to run the script periodically (when first clearing my email I had it run every ~15 mins, but now once a day) | |
function purgeGmail() { | |
// Paste this query in your gmail search bar BEFORE running the script, and make sure nothing you need is matched | |
const search = "category:promotions older_than:1y -is:important -is:starred -has:attachment"; | |
Logger.log("Removing messages matching: " + search); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getEmailStatistics() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var startRow = 2; // Starting row for data (excluding header) | |
var token = PropertiesService.getUserProperties().getProperty('TOKEN'); | |
const query = "in:inbox"; | |
var senderStats = JSON.parse(PropertiesService.getUserProperties().getProperty('SenderStats')) || {}; | |
var processedCount = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
OlderNewer