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 command finds all `.otf` font files in the current directory and subdirectories, | |
| # sorts them alphabetically by path, and outputs each as: `font "Folder/File.otf"` | |
| # | |
| # Step by step: | |
| # 1. `find . -type f -name "*.otf"` → locate all `.otf` files | |
| # 2. `sort` → order results alphabetically | |
| # 3. `sed 's|^\./|font "|; s|$|"|'` → remove leading "./", add 'font "' prefix, and closing '"' | |
| find . -type f -name "*.otf" \ | |
| | sort \ | |
| | sed 's|^\./|font "|; s|$|"|' |
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
| link_subfolders() { | |
| if [ $# -ne 2 ]; then | |
| echo "Usage: link_subfolders <source_dir> <target_dir>" | |
| return 1 | |
| fi | |
| local src="$1" | |
| local dst="$2" | |
| # Ensure target exists | |
| mkdir -p "$dst" | |
| # Link only immediate subdirectories of source into target |
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
| # See https://exiftool.org/forum/index.php?topic=11977.0 | |
| strip_video_metadata() { | |
| local infile="$1" # First argument: input filename | |
| local outfile="${2:-$infile}" # Second argument: output filename (defaults to input if not given) | |
| local ext="${infile##*.}" # Extract file extension from input (everything after last '.') | |
| local tmpfile # Will hold the temporary filename | |
| if [[ "$outfile" == "$infile" ]]; then # If output is same as input (in-place operation)... | |
| tmpfile="${infile}.tmp.${ext}" # ...use a temp file with proper extension | |
| ffmpeg -i "$infile" -vcodec copy -acodec copy "$tmpfile" -y -loglevel error |
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
| ncu --import <input.ncu-rep> --export <output.csv> --csv --page details --quiet |
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 d -exec chmod g+x {} + |
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
| USERNAME=newadmin | |
| REALNAME="New Admin" | |
| PASSWORD=yourpassword | |
| UNIQUEID=501 # Must be unique and >500 | |
| dscl . -create /Users/$USERNAME | |
| dscl . -create /Users/$USERNAME UserShell /bin/zsh | |
| dscl . -create /Users/$USERNAME RealName "$REALNAME" | |
| dscl . -create /Users/$USERNAME UniqueID $UNIQUEID | |
| dscl . -create /Users/$USERNAME PrimaryGroupID 80 |
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
| nsys launch --trace=cuda,cudnn,cublas,mpi,nvtx julia --color=yes --banner=no --depwarn=yes |
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 https://discourse.julialang.org/t/41169/7 | |
| offdiag(A::AbstractMatrix) = [A[ι] for ι in CartesianIndices(A) if ι[1] ≠ ι[2]] |
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
| # https://docs.e3sm.org/polaris/main/users_guide/machines/chicoma.html | |
| sacctmgr list user $USER # Which is my default account? | |
| # https://hpc-unibe-ch.github.io/slurm/partitions.html | |
| # Within these partitions, QoS are used to distinguish different job limits. In each partition there is a default QoS. Each QoS has specific limits that can be viewed directly on the cluster: | |
| sacctmgr show qos format=name%20,maxwall,maxsubmitpu,maxtrespu%80 | |
| # Note, that you might not have access to all of the QoS shown in the output. To see for which QoS your account has valid associations you can use: | |
| sacctmgr show assoc where user=$USER format=account,partition,qos%80 |
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
| \usepackage{xcolor} | |
| \definecolor{tancolor}{RGB}{251, 240, 217} | |
| \pagecolor{tancolor} % Set the background to Tan |
NewerOlder