aly / a script to get daily prices for things, sent to a discord webhook
0 likes
0 forks
1 files
Last active
| 1 | #!/usr/bin/env python3 |
| 2 | from requests import Session, get, post |
| 3 | from bs4 import BeautifulSoup as Soup |
| 4 | |
| 5 | # Config |
| 6 | webhook = "" # discord webhook |
| 7 | |
| 8 | shop = { |
| 9 | # add entries for things you want to track |
| 10 | # copy the numeric IDs from urls |
aly / gnome implementation of win+shift+s
0 likes
0 forks
1 files
Last active
add as custom keyboard shortcut
| 1 | #!/bin/bash |
| 2 | SCREENSHOTS="$(xdg-user-dir PICTURES)/Screenshots" |
| 3 | mkdir -p "$SCREENSHOTS" |
| 4 | fn="$SCREENSHOTS/$(date +%Y-%m-%d-%H%M%S).png" |
| 5 | gnome-screenshot -a -f "$fn" |
| 6 | xclip -selection clipboard -t image/png "$fn" |
aly / montyhall.py
0 likes
0 forks
1 files
Last active
adapted from https://scipython.com/book/chapter-4-the-core-python-language-ii/examples/the-monty-hall-problem/
| 1 | import random |
| 2 | |
| 3 | def run_trial(switch_doors, ndoors=3): |
| 4 | """ |
| 5 | Run a single trial of the Monty Hall problem, with or without switching |
| 6 | after the gameshow host reveals a goat behind one of the unchosen doors. |
| 7 | (switch_doors is True or False). The car is behind door number 1 and the |
| 8 | gameshow host knows that. |
| 9 | |
| 10 | """ |
aly / pico timekeeper
0 likes
0 forks
1 files
Last active
https://blahaj.zone/notes/9mehzr6pjs5zsfs8
| 1 | import machine |
| 2 | import utime |
| 3 | |
| 4 | class Notes: |
| 5 | B3 = 247 |
| 6 | E4 = 330 |
| 7 | FS4 = 370 |
| 8 | GS4 = 415 |
| 9 | A4 = 440 |
| 10 | D6 = 1174 |
aly / offline-check/maintenance mode
0 likes
0 forks
4 files
Last active
a script to touch/rm a file based on ping result, and an nginx conf
| 1 | #!/bin/bash |
| 2 | # offline-check [ip number of host] |
| 3 | # e.g `offline-check 2` generates /var/www/html/offline.check.2 |
| 4 | # example crontab: * * * * * $HOME/.local/bin/offline-check |
| 5 | ping -w1 -c1 10.8.0.$1 | grep "64 bytes from" 2>&1 >/dev/null && rm -f /var/www/html/offline.check.$1 2>/dev/null || touch /var/www/html/offline.check.$1 |
