Skip to content

Instantly share code, notes, and snippets.

@daleysoftware
daleysoftware / remove-duplicates.py
Created January 2, 2018 22:06
Delete duplicate photos in a large collection.
import glob
import sys
import os
import hashlib
import collections
def log(message):
print(message)
@daleysoftware
daleysoftware / hackathon.html
Created November 23, 2015 19:40
Hack Week Display
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var target_date = new Date("Nov 25, 2015 3:30 pm").getTime();
var days, hours, minutes, seconds;
var countdown = document.getElementById("countdown");
setInterval(function () {
@daleysoftware
daleysoftware / index.html
Last active October 28, 2015 03:38
Simple flask app that takes input HTML and removes all the span tags.
<!doctype html>
<form>
HTML with span tags:
<br><br>
<input type="text" name="html">
<br><br>
<input type="submit" value="Remove ALL the spans!">
</form>
{% if html %}
@daleysoftware
daleysoftware / set-mysql-password.sh
Last active October 28, 2015 03:35
Set the AeroFS MySQL database password
#!bin/bash
set -eu
# Revoke old open grants, add new password protected local-only grants.
mysql --user=root << EOF
revoke all privileges on \`polaris\`.* from 'aerofsdb'@'%';
revoke all privileges on \`bifrost\`.* from 'aerofsdb'@'%';
revoke all privileges on \`aerofs_sp\`.* from 'aerofsdb'@'%';
revoke all privileges on \`aerofs_ca\`.* from 'aerofsdb'@'%';
grant all privileges on \`polaris\`.* to 'aerofsdb'@'localhost' identified by 'your-db-password-here';
@daleysoftware
daleysoftware / delete_large_gmail_folder.py
Last active March 22, 2019 04:01
Script to delete large folder in gmail.
"""
Script to delete large folder in gmail.
Adapted from: http://ae.ro/1upv7rt
Notes:
1. For this to work with gmail, you will need to adjust into your IMAP settings
so that they look like this:
* IMAP: enabled
@daleysoftware
daleysoftware / check_appliance_ports.sh
Created January 14, 2015 00:50
Check AeroFS Appliance ports.
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: $0 <appliance_host>"
exit 1
fi
appliance_host=$1
@daleysoftware
daleysoftware / ProxyTest.java
Created December 11, 2014 22:06
Test system proxy server settings.
import java.util.*;
import java.io.*;
import java.net.*;
public class ProxyTest
{
public static void main(String[] args) {
System.setProperty("java.net.useSystemProxies", "true");
List<Proxy> list = null;
try