This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import pathlib | |
| import datetime | |
| # print(datetime.datetime.now().timestamp()) | |
| # >>> 1778932457.833973 # 2026-05-16 07:54 | |
| file = pathlib.Path("tmp.txt") | |
| with file.open('rb') as fo: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Go to whereever "/data" is mounted localled, create/append to nginx/custom/http.conf | |
| upstream myweb { | |
| # ip_hash; | |
| server 192.168.1.100:8000 weight=5 max_fails=3 fail_timeout=10s; #Nginx | |
| server 192.168.1.101:80 weight=1 max_fails=3 fail_timeout=10s; #UM | |
| } | |
| # in NPM, edit the Proxy Host, Forward Hostname and port no longer matter, fill in with garbage 127.0.0.1 80 | |
| # go to the Advanced tab or the cog in the top right of the proxy host editor and add |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pathlib | |
| # pip install vobject | |
| import vobject | |
| input_file = pathlib.Path("cache/contacts-bad.vcf") | |
| output_file = pathlib.Path("cache/contacts-fixed.vcf") | |
| with input_file.open() as input_fo, output_file.open('w', newline="") as output_fw: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -type f -exec stat --format '%A|%U:%G|%F|%n' {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sed '1!G;h;$!d' "/boot/config/plugins/dockerMan/userprefs.cfg" | while read line || [[ -n $line ]]; | |
| do | |
| # do something with $line here | |
| tmp=${line#*\"} # Remove everything up to and including first = | |
| container_name=${tmp::-1} | |
| echo "Stopping $container_name" | |
| docker stop -t 30 $container_name | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Map Name="Convergence (public)" Length="180" Start="90" id="wtcon"> | |
| <Event Name="Convergence" Length="10" Color="8042C8D7"/> | |
| <Event Name="" Length="170" Color="008AEAF4"/> | |
| </Map> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Google Crap Filter | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Highlight bad sites in Google search results. | |
| // @author carcigenicate | |
| // @match https://www.google.com/search* | |
| // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import base64 | |
| from libnacl import crypto_secretbox_KEYBYTES as KEYLEN | |
| from libnacl.secret import SecretBox | |
| def decrypt_payload(payload): | |
| key = 'abcedf'.encode('utf-8') | |
| key = key.ljust(KEYLEN, b'\0') | |
| ciphertext = base64.b64decode(payload) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.apps import apps | |
| from django.contrib import admin | |
| from django.contrib.admin.sites import AlreadyRegistered | |
| app_models = apps.get_app_config("app-name-here").get_models() | |
| for model in app_models: | |
| try: | |
| admin.site.register(model, admin.ModelAdmin) | |
| except AlreadyRegistered: # pragma: no cover | |
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # firefox userChrome.js changes | |
| /*** Tighten up drop-down/context/popup menu spacing (8 Sep 2021) | |
| toolkit.legacyUserProfileCustomizations.stylesheets = True | |
| ***/ | |
| menupopup:not(.in-menulist) > menuitem, | |
| menupopup:not(.in-menulist) > menu { | |
| padding-block: 2px !important; | |
| min-height: unset !important; /* v92.0 - for padding below 4px */ | |
| } |
NewerOlder