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 | |
OUTPUT_FILE=/home/ben/speedtest-results.csv | |
HEADER='"timestamp","server name","server id","latency","jitter","packet loss","download","upload","download bytes","upload bytes","share url","download server count"' | |
START_TS=$(date --iso-8601=s) | |
SPEEDTEST_LINE=$(/usr/local/bin/speedtest --format=csv) | |
if [ ! -f "$OUTPUT_FILE" ]; then | |
echo "$HEADER" > $OUTPUT_FILE |
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 email | |
import os | |
import smtplib | |
import ssl | |
import uuid | |
from email import encoders | |
from email.mime.base import MIMEBase |
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
/* | |
* Copyright Benjamin Howe 2018 | |
* This code is released under the CC0 license | |
* See: https://creativecommons.org/publicdomain/zero/1.0/ | |
*/ | |
package uk.bh96; | |
import java.awt.AWTException; | |
import java.awt.Color; | |
import java.awt.Graphics2D; |
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
import re | |
import requests | |
import shutil | |
magazine_url = "https://loopwifi.co.uk/magazines/magazine_assets/TopGear_1801" | |
# below: from the source of the magazine on the loop website (line 29) | |
pages = """ <li>publication/ff5d7f958ccbaee04c5757444271f48e/459cf714845df91869e46745465b55f8.jpg</li> | |
<li>publication/ff5d7f958ccbaee04c5757444271f48e/684b60c1160f9edf97f0f562a5118347.jpg</li> | |
<li>publication/ff5d7f958ccbaee04c5757444271f48e/419c95840894cd32fe7f3bea098c5e7c.jpg</li> | |
<li>publication/ff5d7f958ccbaee04c5757444271f48e/45aa32e2261e865d74c8d01aa41e24cc.jpg</li> |
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
import operator # https://stackoverflow.com/a/18591859 | |
from fractions import Fraction | |
from time import time | |
from transmaths import Transreal | |
def timed_op(a, op, b, repetitions): | |
start = time() | |
for i in range(repetitions): | |
op(a, b) |
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
<?php | |
function check_isic($number) { | |
$url = 'https://www.isic.org/verify/'; | |
$data = array('verify_card_number' => $number); | |
$options = array( | |
'http' => array( | |
'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
'method' => 'POST', | |
'content' => http_build_query($data), | |
) |
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/python3 | |
import re | |
import requests | |
import urllib.parse | |
print("Setting up...") | |
ascii_printable = [] | |
for i in range(32, 127): # source: https://stackoverflow.com/a/5891478 | |
ascii_printable += chr(i) |
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/python3 | |
import re | |
import requests | |
import sys | |
from datetime import datetime | |
def download_file(url, filename): # source: https://stackoverflow.com/a/16696317 | |
r = requests.get(url, stream=True) |
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
import os, shutil | |
from PIL import Image | |
outputs = { | |
"drawable-mdpi": 1, | |
"drawable-hdpi": 1.5, | |
"drawable-xhdpi": 2, | |
"drawable-xxhdpi": 3} | |
for directory in outputs: |
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/python3 | |
# Parse LINX Data v1.0 | |
# Designed for use with Get LINX Data v1.0 | |
# A script to parse statistical data from the London Internet Exchange | |
# (C) Benjamin Howe 2017, licensed under the MIT License | |
# https://opensource.org/licenses/MIT | |
from datetime import datetime |
NewerOlder