Skip to content

Instantly share code, notes, and snippets.

View mettamatt's full-sized avatar

Matt Westgate mettamatt

  • mostly on earth
View GitHub Profile
/**
* sunset_light_control.js
*
* Purpose: Automatically controls a Shelly switch based on sunset/sunrise times.
*
* Behavior:
* - Checks if the light is already on - if yes, does nothing
* - If the light is off, checks if it's between sunset and sunrise
* - If it's nighttime, turns on the light with a 5-minute timer
* - Caches sunrise/sunset times to reduce API calls and ensures they are for the current date
@mettamatt
mettamatt / Spotify_Eliminate_Advertisements
Created March 2, 2025 12:48 — forked from opus-x/Spotify_Eliminate_Advertisements
Eliminate Spotify Advertisements + Complete Server List
##################################################################################
# ELIMINATE SPOTIFY ADS (VERSION 1.2 - 8.5) - ABANDONED FOR NOW #
##################################################################################
#
# NOTE: SOMETIMES ONLY ANNOUNCEMENT OF AN AD WHILE USING APP VERSION 7.5-7.9?-8.x.
# USING AN OFFICIAL OLDER VERSION SOLVES THIS. TEST IT (APKMIRROR). THIS WILL NOT
# OCCUR USING CHROMECAST / GOOGLE HOME.
#
# COULD NOT SOLVE THE AUDIO AD INRO/OUTRO IN THE APP.
# SUGGESTIONS? WRITE A COMMENT BELOW.
import requests
from bs4 import BeautifulSoup
import time
import webbrowser
# while this is true (it is true by default),
while True:
url = "https://www.vaccinateri.org/client/registration?clinic_id=1534"
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
response = requests.get(url, headers=headers)
input_device = "GPIO Controller 1"
input_driver = "udev"
input_l_btn = "4"
input_load_state_btn = "4"
input_start_btn = "7"
input_exit_emulator_btn = "7"
input_down_axis = "+1"
input_r_btn = "5"
input_save_state_btn = "5"
input_right_axis = "+0"
# If set to a directory, content which is temporarily extracted
# will be extracted to this directory.
cache_directory = "/tmp/retroarch"
# Path to core options config file.
# This config file is used to expose core-specific options.
# It will be written to by RetroArch.
# A default path will be assigned if not set.
core_options_path = "/opt/retropie/configs/all/retroarch-core-options.cfg"
#!/bin/bash
# Set the ROM folder
BASE="/home/pi/RetroPie/roms"
# List the platforms to scan
PLATFORMS=(arcade snes nes megadrive)
EXTS=(.zip .sfc .7z .md)
MAKE_DIFFS=1
@mettamatt
mettamatt / lighthouse_config.yml
Last active September 17, 2018 18:53
Google Lighthouse integration with Tugboat. In order to use this, you'll need store your GitHub personal access token (GITHUB_TOKEN) as an environment variable on Tugboat. Make sure the token has all access to the repos and gists. You'll also need to upload your repos's SSH key from Tugboat to GitHub. https://developers.google.com/web/tools/ligh…
services:
php:
image: tugboatqa/php:7-apache
default: true
commands:
init:
# Install Node, Google Lighthouse, and jq
- apt-get update
@mettamatt
mettamatt / tenon.io_config.yml
Last active September 10, 2018 13:18
Integration with tenon.io on https://tugboat.qa - install `jq` and `curl` out to tenon.
services:
php:
image: tugboatqa/php:7-apache
commands:
init:
- apt-get update
- apt-get install -y jq
build:
Firewall
Note that in some versions of CentOS, a firewall is installed by default which will block access to port 80, on which Apache runs. The following command will open this port and save the rule to iptables.
iptables -I RH-Firewall-1-INPUT -p tcp --dport http -j ACCEPT
service iptables save
PHP5 Install
Drupal is written in PHP. Let's move on to the PHP5 install. As before, due to using yum to install PHP5, any dependencies are taken care of: