Skip to content

Instantly share code, notes, and snippets.

@sparanoid
sparanoid / speedtest.sh
Last active February 24, 2018 20:09
Speedtest.net Auto Update Script
#!/usr/bin/env bash
# Speedtest.net Auto Update Script
# Usage: Download the latest SpeedTest script monthly as in 1st of every month at 00:00
# 0 0 1 * * nice -n 19 bash /srv/www/speedtest.sh >/dev/null 2>&1
# Make sure speedtest.sh is executable
# chmod +x /srv/www/speedtest.sh
DES_PATH=/usr/share
PUB_PATH=/srv/www/speedtest.tokyo.sparanoid.com/public_html
ST_DIR=speedtest
@marcanuy
marcanuy / apache_error_log_parser.sh
Last active April 1, 2024 15:25
Apache error log list ordered by most common errors
#!/bin/bash
sed 's^\[.*\]^^g' error.log | sed 's^\, referer: [^\n]*^^g' | sort | uniq -c | sort -n
@harperreed
harperreed / DownloadStationAPI.py
Last active January 4, 2022 08:13
example script to sync/download/etc put.io downloads to your synology download station
import time
import requests
import json
class DownloadStationAPI():
def __init__(self, host=None, username=None, password=None):
self.name = 'DownloadStation'
@johngrimes
johngrimes / date.sql
Created May 21, 2010 07:03
MySQL Date Dimension Build Script
/* Adapted from Tom Cunningham's 'Data Warehousing with MySql' (www.meansandends.com/mysql-data-warehouse) */
###### small-numbers table
DROP TABLE IF EXISTS numbers_small;
CREATE TABLE numbers_small (number INT);
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
###### main numbers table
DROP TABLE IF EXISTS numbers;
CREATE TABLE numbers (number BIGINT);