First we need to abstract using aws with sts AssumeRole. Put this file anywhere in your $PATH
~.local/bin/sts-aws
#!/usr/bin/env bash
set -euo pipefail
aws-sts() {
local account=$1| # Source this file in bash: source /path/to/aws-sts.bash | |
| # Provides: | |
| # - aws-sts-activate (alias for aws_sts_activate) | |
| # - aws-sts-deactivate (alias for aws_sts_deactivate) | |
| # Behavior mirrors your Fish version: | |
| # * Loads/writes a cache file with credentials | |
| # * Assumes role when cache is missing/near expiry | |
| # * Shows the active profile in your prompt (left side, bash has no RPROMPT) | |
| # * Auto-refreshes creds when <=30m to expiry (pre-exec and pre-prompt) |
First we need to abstract using aws with sts AssumeRole. Put this file anywhere in your $PATH
~.local/bin/sts-aws
#!/usr/bin/env bash
set -euo pipefail
aws-sts() {
local account=$1This is instruction how to run multi level compression for zram swap
The idea is that we want to be able to quickly swap memory away when we need memory, but cold pages should be compressed further.
This instruction also includes traditional block storage for uncompressible pages that would not decrease otherwise any memory usage.
Zstd have nice property that decompression speed is basically independend from compression level, so using higher levels will only participate in compression speed.
Using zstd for default compresor causes some ui lags when memory need to be paged out, therefore is okay, but not great solution.
Using zstd for recompression in the background have very little effect assuming you do not use every cpu cycle, and compressing old pages make it failry safe that they will not be needed anytime soon.
This might consume 1 cpu core during recompression (accounted for recompress-idle-ram script) but otherwise allows best from both worlds, fast memory reclaim, fast swap read and very good com
| """Virtual Environment Manager for Python Scripts. | |
| This module provides automatic virtual environment management for Python scripts, | |
| with cross-platform support for Linux, macOS, and Windows. It handles creation, | |
| updating, and execution of scripts within isolated virtual environments. | |
| Features: | |
| - Automatic venv creation and management | |
| - Cross-platform compatibility (Linux, macOS, Windows) | |
| - Version-pinned dependencies |
| #!/usr/bin/env python3 | |
| import argparse | |
| import itertools | |
| from rich import print | |
| from rich.table import Table | |
| def format_resistor_value(number): | |
| formatted_number = format(number, ".1f").rstrip('0').rstrip('.') | |
| return formatted_number |
Note: Currently this only works via Steam client
Usage:
Trace single function/method
@trace
function something() {
}| #!/usr/bin/env bash | |
| sudo -v | |
| trap 'echo "Something went wrong, restart script to retry"' ERR | |
| set -ex | |
| export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
| downloadPkg() { | |
| echo "Downloading $1..." |
| #!/usr/bin/env bash | |
| CR="\e[0m" | |
| CBAD="\e[41m" | |
| CWRN="\e[33m" | |
| COK="\e[32m" | |
| CINF="\e[34m" | |
| isPcidPresent() { | |
| grep -q pcid /proc/cpuinfo |
| (function(){ | |
| function styleAllBoxes() { | |
| var cnt = $('.gm-style-iw'); | |
| cnt.each(function(index){ | |
| styleBox($(cnt[index])); | |
| }); | |
| } | |
| function styleBox(item) { |
| #include <mpidatatypebuilder.h> | |
| #include <mpi.h> | |
| using namespace std; | |
| struct DataSet { | |
| double vectorA[131072]; | |
| double vectorB[131072]; | |
| double arg1; |