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 random | |
import string | |
fromt pathlib import Path | |
def file_that_does_not_exist() -> Path: | |
def _randname() -> str: | |
return "".join( |
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
# NO NEED to make a script | |
# Just choose any one variant, and copy that one line | |
# Then paste in a new session | |
#1 Green hostname, bold white command | |
export PS1="\n"'\[\033[0m\][\u@\[\033[1;32m\]\h\[\033[0m\] \W]\$ \[\033[1m\]'; export PS0='\[\033[0m\]' | |
#2 Green hostname, bold cyan command | |
export PS1="\n"'\[\033[0m\][\u@\[\033[1;32m\]\h\[\033[0m\] \W]\$ \[\033[1;96m\]'; export PS0='\[\033[0m\]' |
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 = {} |
NewerOlder