Skip to content

Instantly share code, notes, and snippets.

View muffix's full-sized avatar

Björn Marschollek muffix

View GitHub Profile
@muffix
muffix / globalprotect.sh
Created November 11, 2019 09:15
Script to start/stop/restart the GlobalProtect agent
#!/bin/bash
usage() {
echo "Usage: $0 {start|stop|restart}"
}
start() {
echo "Starting GlobalProtect..."
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
@muffix
muffix / unifi_scrape.py
Created November 29, 2021 11:04
Quick-and-dirty scraper that checks for the availability of a product in the Unifi store
"""
Quick-and-dirty scraper that checks for the availability of a product in the Unifi store
Checks the link in the TARGET_URL variable every 30 seconds and calls the webhook in WEBHOOK_URL if the product
is available.
Requirements:
beautifulsoup4==4.10.0
requests==2.26.0
requests_html==0.10.0
@muffix
muffix / check_ubiquiti_dream_router_availability.sh
Created December 1, 2021 11:13
Checks the Ubiquiti store for availability of the Dream Router
#!/bin/zsh
# Fill in your webhook here
WEBHOOK=https://httpbin.org/get
STORE_URL=https://eu.store.ui.com
while true; do
AVAILABLE=$(curl --silent ${STORE_URL}/products.json | jq '.products[] | select(.handle=="dream-router-ea").variants[0].available')
if [[ "${AVAILABLE}" == "true" ]]; then