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
from functools import wraps | |
from typing import Callable | |
import typer | |
from asyncio import run | |
class AsyncTyper(typer.Typer): | |
def async_command(self, _func: Callable = None, *args, **kwargs): | |
def decorator(async_func): | |
@wraps(async_func) |
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
dvc init | |
dvc remote add -d storage s3://yyy | |
dvc remote modify storage endpointurl https://xxx.r2.cloudflarestorage.com/ | |
# global | |
dvc remote modify --global storage endpointurl https://xxx.r2.cloudflarestorage.com/ | |
dvc remote modify --local myremote account_name 'myaccount' | |
dvc remote modify --local myremote account_key 'mysecret' |
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
@REM normal copy | |
robocopy "Source Directory" "Destination Directory" /e /w:5 /r:2 /COPY:DATSOU /DCOPY:DAT /MT:24 | |
@REM normal move | |
robocopy "Source Directory" "Destination Directory" /e /w:5 /r:2 /COPY:DATSOU /DCOPY:DAT /MT:24 /MOVE | |
@REM nfs copy | |
robocopy "Source Directory" "Destination Directory" /e /w:5 /r:2 /COPY:DATO /DCOPY:DAT /MT:24 /MOVE |
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
### Keybase proof | |
I hereby claim: | |
* I am wasdee on github. | |
* I am circleoncircles (https://keybase.io/circleoncircles) on keybase. | |
* I have a public key ASB2UB20JJrBpl-ONIch2glYEuGmKrii__0scS1G-y-5bAo | |
To claim this, I am signing this object: |
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
# check if use firewalld | |
if [ -x "$(command -v firewall-cmd)" ]; then | |
firewall-cmd --permanent --add-masquerade | |
fi |
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 bash | |
now=$(date +"%Y_%m_%d-%H_%M_%S") | |
top -b -n 120 > "top-120iters-$now.txt" | |
# this takes 120 iterations of top, which is 120*3 seconds = 6 minutes |
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
# https://docs.conda.io/projects/conda/en/latest/_downloads/843d9e0198f2a193a3484886fa28163c/conda-cheatsheet.pdf | |
conda env export --from-history > environment.yml | |
# to restore, must use with env cmd group https://github.com/conda/conda/issues/6827#issuecomment-365614464 | |
conda env create --file environment.yml | |
conda create -n env_name --file environment.yml #ERROR |
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 bash | |
now=$(date +"%Y_%m_%d-%H_%M_%S") | |
top -b -n 120 > "top-120iters-$now.txt" | |
# this takes 120 iterations of top, which is 120*3 seconds = 6 minutes |
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 bash | |
# https://github.com/protocolbuffers/protobuf/releases | |
PROTOC_VERSION=21.9 | |
PLATFORM=linux-x86_64 | |
wget --output-document protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v21.9/protoc-21.9-linux-x86_64.zip | |
unzip protoc.zip -d protoc | |
sudo mv protoc/bin/protoc /usr/local/bin/ | |
sudo mv protoc/include/google /usr/local/include/ |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"type": "text", | |
"style": "diamond", | |
"leading_diamond": "\ue0b6", |
NewerOlder