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 zsh | |
# Begin Help block | |
my_name=$(basename "$0") | |
display_help() { | |
cat <<EOF | |
*** Open Sphinx reSt file from the project root. *** | |
usage: $my_name <filestem> |
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 zsh | |
display-help() { | |
echo List content of the specified directories. | |
} | |
main() { | |
dir0='/path/to/directory_01' | |
dir1='/path/to/directory_02' | |
dir2='/path/to/directory_03' |
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 zsh | |
# Reference: | |
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html | |
display_help() { | |
cat <<EOF | |
*** Remove the first n characters from the file content. *** | |
Use me when dos2unix nor nkf doesn't work. |
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 | |
import shutil | |
from datetime import datetime | |
from pathlib import Path | |
def backup_a_file(fpath, action='c'): | |
"""Make a backup/copy of a file (NOT a directory) in the subdirectory. | |
Args: | |
fpath (str): Path to the source file. |
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 | |
import re | |
import time | |
from datetime import datetime, timezone | |
class FnameWithEpoch: | |
"""Create a filename with the epoch time / Parse an epoch-filename. | |
Reference: | |
File Naming Conventions |
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 zsh | |
display_help() { | |
printf "\033[93m*** Display git status of the projects under the CWD. ***\033[0m\n" | |
} | |
main() { | |
display_help | |
sleep 3 | |
for project in */; do |
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 zsh | |
display_help() { | |
cat <<EOF | |
parse-outlook: | |
Extracts emails and attachments saved | |
in Microsoft Outlook's .msg files | |
https://github.com/TeamMsgExtractor/msg-extractor | |
-------------------------------------------------------- |
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 zsh | |
# Reset the permissions to the default (755/644). | |
printf '\033[93mReset the permissions to the default (755/644). OK? [y/N] >> \033[0m' | |
read -r res | |
[[ "$res" = [yY] ]] && { | |
find ./ -type d -exec chmod 755 {} \+ | |
find ./ -type f -exec chmod 644 {} \+ |
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 | |
import re | |
from pathlib import Path | |
from time import sleep | |
from urllib.parse import urlsplit | |
import pandas as pd | |
import requests | |
CWD = Path('.') |
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 zsh | |
display_help() { | |
cat <<EOF | |
Download files from the URLs listed in a list (one URL per row). | |
---------------------------------------------------------------- | |
Usage: dlfromalist <filepath of the URL list> | |
EOF |