This file contains 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 is supposed to be a VBA (VB for applications) module, but GitHub does not have a syntax-highlighter for .vba files | |
' | |
' 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/. | |
' REQUIREMENTS: | |
' - You MUST add a reference to "Microsoft VBScript Regular Expressions 5.5" (or any compatible versions) |
This file contains 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 random | |
import secrets |
This file contains 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 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 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 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 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 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 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 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) |
NewerOlder