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
| #!/usr/bin/env python3 | |
| # SPDX-License-Identifier: MPL-2.0 | |
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| from __future__ import annotations | |
| import argparse | |
| import sys | |
| import tempfile |
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 subprocess | |
| import sys | |
| import tempfile | |
| from pathlib import Path | |
| try: | |
| ### PERFORM IMPORTS OF NEEDED MODULE IN THIS try: BLOCK | |
| from rich.traceback import install as rtb_install | |
| rtb_install(show_locals=True) |
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
| #!/bin/bash | |
| for i in $(cut -s -d: -f4 /etc/passwd | sort -u ); do | |
| if ! grep -q -P "^.*?:x:$i:" /etc/group; then | |
| echo "Group $i is referenced by /etc/passwd but does not exist in /etc/group" | |
| fi | |
| 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
| #!/usr/bin/env python3 | |
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| # | |
| # Copyright (C) 2024, Pandu POLUAN | |
| import fileinput | |
| import re |
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
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| # Context: https://stackoverflow.com/a/56701174/149900 | |
| from io import StringIO | |
| WHITESPACE = " \t\r\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
| import pprint | |
| import random | |
| import timeit | |
| MEMBS_COUNT = 100 | |
| indexes = list(range(MEMBS_COUNT)) | |
| random.shuffle(indexes) | |
| orig_dict = {} |
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
| #!/usr/bin/env python3.9 | |
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| import os | |
| import time | |
| import xxhash | |
| from collections import namedtuple |
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
| logger = logging.getLogger() | |
| logger.setLevel(logging.DEBUG) | |
| facility = 23 # local7; see RFC 5424 | |
| formatter = RFC5424Formatter(appname="my-awesome", facility=facility) | |
| syslog_handler = UTF8DatagramHandler("127.0.0.1", 514) | |
| syslog_handler.setFormatter(formatter) | |
| syslog_handler.setLevel(logging.DEBUG) | |
| logger.addHandler(syslog_handler) |
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
| # This code is released to the Public Domain. | |
| # Alternatively, you can use one of the following licenses: Unlicense OR CC0-1.0 OR WTFPL OR MIT-0 OR BSD-3-Clause | |
| # IMPORTANT: | |
| # Please do note that this does NOT attempt to perform complex guessing e.g. CP437 or CP850 or GB18030 or JIS or... | |
| # Well, you get the idea. | |
| # This function will simply try to guess the most common *Unicode* encoding, i.e., UTF-8, UTF-16, and UTF-32 | |
| # More ... 'exotic' unicode encoding such as UCS-1, UCS-2, UTF-7, etc are NOT detected. (They would likely be | |
| # detected as "utf-8" by this function) | |
| # If you need more 'advanced' detection, use the heavyweight "chardet" library instead. |
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
| # This code is released to the Public Domain. | |
| # Alternatively, you can use one of the following licenses: Unlicense OR CC0-1.0 OR WTFPL OR MIT-0 OR BSD-3-Clause | |
| param( | |
| [Parameter(Mandatory=$True,Position=1)] | |
| [string] $server, | |
| [string] $iface = "Wi-Fi", # EDIT AS NEEDED | |
| [string] $dns_service = "dnscrypt-proxy" # EDIT AS NEEDED | |
| ) |