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. |
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
// 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
#!/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
#!/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 | |
echo "Opening $@" | |
nxmlink="$@" | |
/usr/bin/playonlinux --run "nxmhandler" "$nxmlink" | |
sleep 5 |
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
// ==UserScript== | |
// @name NoAssign | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description WebAssign Auto Try-Again | |
// @author CC | |
// @match https://www.webassign.net/v4cgi/student/practice.tpl* | |
// @grant none | |
// ==/UserScript== |
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
<VirtualHost *:80> | |
ServerName YOUR.DOMAIN.HERE | |
Redirect permanent / https://YOUR.DOMAIN.HERE/ # Redirect all nonsecure requests to use HTTPS | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName YOUR.DOMAIN.HERE | |
SSLProxyEngine On | |
SSLCertificateFile /etc/letsencrypt/live/YOUR.DOMAIN.HERE/cert.pem |
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
# From https://github.com/certbot/certbot/issues/2164 | |
<IfModule mod_proxy.c> # If Proxy is installed | |
ProxyPass "/.well-known/acme-challenge" "!" # Do not proxy the acme verification | |
</IfModule> | |
Alias /.well-known/acme-challenge /var/www/html/.well-known/acme-challenge # Send all requests for the acme verification to this location | |
<Directory "/var/www/html/.well-known/acme-challenge"> # Allow any requests for it | |
Options None | |
AllowOverride None | |
Require all granted | |
AddDefaultCharset off |
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
[CENTER][B][SIZE=7][IMG]https://cravatar.eu/helmhead/e6505ed0eacb4bbca6f6adc2b753f02a.png[/IMG][/SIZE] | |
[FONT=Courier New][SIZE=7]HeroCC's Super SysAdmin Shop[/SIZE][/FONT] | |
[SIZE=7][COLOR=#006600]OPEN[/COLOR][/SIZE][/B][/CENTER] | |
[IMG]https://ga-beacon.appspot.com/UA-83941472-1/spigotmc-thread?pixel&useReferer[/IMG] | |
Hello, [COLOR=#ff8000]SpigotMC[/COLOR]! I am [COLOR=#006600]HeroCC[/COLOR], a Minecraft Server admin for 3[I]+ years[/I], and Linux SysAdmin for 2.5[I]+ years[/I] from the USA. I love configuring and setting up anything and everything. Some of my services are below, but if you have any special requests please drop me a line! I often will do small jobs for Vouches if you are a reputable member. I have the most experience in Ubuntu Server / Debian, but I should be able to use any OS, including BSD and Windows! I prefer working on services and backend stuff rather than simple plugin/world configs, but can do both (just not build, you don't want to see that ;)). I'll even explain what I'm doing live if |
NewerOlder