Malin / rip-imagebam.py
0 likes
0 forks
1 files
Last active
1 | # from: https://www.reddit.com/r/DataHoarder/comments/1d90f3c/nsfw_best_way_to_download_hundreds_of_separate/ |
2 | import requests |
3 | from bs4 import BeautifulSoup |
4 | from datetime import datetime, timedelta |
5 | import os |
6 | from concurrent.futures import ThreadPoolExecutor, as_completed |
7 | |
8 | |
9 | def fetch_webpage(url): |
10 | response = requests.get(url) |
Malin / docker-cleanup.sh
0 likes
0 forks
1 files
Last active
1 | # from: https://docs.docker.com/config/pruning/ |
2 | # get used/available space |
3 | docker system df |
4 | # remove all images without a container associated |
5 | docker image prune -a |
Malin / flush-journal.sh
0 likes
0 forks
1 files
Last active
1 | # from: https://unix.stackexchange.com/questions/139513/how-to-clear-journalctl |
2 | |
3 | journalctl --flush --rotate --vacuum-time=1s |
4 | journalctl --user --flush --rotate --vacuum-time=1s |
5 | journalctl --vacuum-time=2d |
6 | journalctl --vacuum-size=500M |
Malin / remove-PVE-cluster.sh
0 likes
0 forks
1 files
Last active
1 | # from https://www.reddit.com/r/Proxmox/comments/avk2gx/help_cluster_not_ready_no_quorum_500/ |
2 | |
3 | systemctl stop pve-cluster |
4 | systemctl stop corosync |
5 | pmxcfs -l |
6 | rm /etc/pve/corosync.conf |
7 | rm /etc/corosync/* |
8 | killall pmxcfs |
9 | systemctl start pve-cluster |
Malin / get-table-size.sql
0 likes
0 forks
1 files
Last active
1 | // for TFB Database Business Central |
2 | |
3 | SELECT |
4 | t.NAME AS TableName, |
5 | s.Name AS SchemaName, |
6 | p.rows AS RowCounts, |
7 | SUM(a.total_pages) * 8 AS TotalSpaceKB, |
8 | SUM(a.used_pages) * 8 AS UsedSpaceKB, |
9 | (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB, |
10 | CAST(SUM(a.total_pages) * 8 / 1024.0 / 1024.0 AS DECIMAL(18, 2)) AS TotalSpaceGB, |
Malin / gist:a0ec7c24c45f4ee5bf966e25109abac0
0 likes
0 forks
1 files
Last active
1 | // for easycut.es |
2 | |
3 | add_action('woocommerce_after_checkout_validation', 'restrict_shipping_counties_in_spain', 10, 2); |
4 | |
5 | function restrict_shipping_counties_in_spain($data, $errors) { |
6 | // List of restricted counties |
7 | $restricted_counties = array('CE', 'ML', 'GC', 'TF'); |
8 | |
9 | // Get the shipping country and state from the checkout data |
10 | $shipping_country = isset($data['shipping_country']) ? $data['shipping_country'] : ''; |