k4d3 commited on
Commit
3869cde
1 Parent(s): 13a561f

almost fix zsh

Browse files

Signed-off-by: Balazs Horvath <acsipont@gmail.com>

Files changed (1) hide show
  1. .zshrc +82 -93
.zshrc CHANGED
@@ -1,9 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # ⚠️ TODO: This needs to be benched but I'm too bad at this!
2
  export NUMEXPR_MAX_THREADS=24
3
  export VECLIB_MAXIMUM_THREADS=24
4
  export MKL_NUM_THREADS=24
5
  export OMP_NUM_THREADS=24
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  display_git_help() {
8
  echo "Git"
9
  echo "---"
@@ -17,13 +97,6 @@ display_git_help() {
17
  }
18
  display_git_help
19
 
20
- export CLICOLOR=126
21
-
22
- alias gc="git commit -avs --verbose"
23
- alias dir="dir --color=always"
24
- alias ll="ls -lah --color=always"
25
- alias ezc="nvim ~/.zshrc && source ~/.zshrc"
26
-
27
  # This function, rejiggle_captions, takes two arguments: a tag and a directory.
28
  # It searches for all .txt files in the specified directory and its subdirectories.
29
  # If a file contains the specified tag, the function removes the tag from its original position
@@ -46,7 +119,6 @@ rejiggle_captions() {
46
  done
47
  }
48
 
49
-
50
  # This function, `update_conda`, automates the process of upgrading all packages in every conda environment.
51
  # It performs the following steps:
52
  # 1. Retrieves the list of all conda environments using `conda env list` and extracts their names.
@@ -77,9 +149,6 @@ update_conda() {
77
  echo "All environments have been upgraded."
78
  }
79
 
80
- export LANG=ja_JP.UTF-8
81
- export LC_ALL=ja_JP.UTF-8
82
-
83
  list_word_freqs() {
84
  local target_dir=$1
85
  if [[ -z "$target_dir" ]]; then
@@ -248,8 +317,6 @@ display_custom_help() {
248
  echo "----------------------------------------------------------------------------------------------------------------------"
249
  }
250
 
251
- export RUST_BACKTRACE=1
252
-
253
  # This function `nv` retrieves the version of the NVIDIA CUDA Compiler (nvcc) installed on the system.
254
  # It extracts the version number from the `nvcc --version` command output.
255
  # The version number is then formatted by removing the dot (e.g., 12.6 becomes 126).
@@ -268,15 +335,13 @@ nv() {
268
  echo $result
269
  }
270
 
271
- export BNB_CUDA_VERSION=126
272
-
273
  # Function to remove consecutive repeated words in text files within a directory
274
  remove_repetition() {
275
  local dir=$1 # The directory to search for text files
276
  # Find all .txt files in the specified directory and process each file
277
  find "$dir" -type f -name "*.txt" | while read -r file; do
278
  # Use awk to process each line of the file
279
- awk
280
  {
281
  n = split($0, words, " ") # Split the line into words
282
  for (i = n; i > 1; i--) { # Iterate from the last word to the second word
@@ -286,18 +351,10 @@ remove_repetition() {
286
  printf "%s%s", words[j], (j == i ? ORS : OFS) # Print the word followed by a space or newline
287
  }
288
  }
289
-
290
- # Save the processed content to a temporary file and replace the original file
291
- "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
292
  done
293
  }
294
 
295
- # This alias 'pie' is a shortcut for installing a Python package in editable mode
296
- # using the pip command with the --use-pep517 option.
297
- alias pie='pip install -e . --use-pep517'
298
-
299
- export DOTNET_CLI_TELEMETRY_OPTOUT=1
300
-
301
  # Organizes a sample prompt file from the current directory to datasets/furry.
302
  # It moves the file named sample-prompts.txt to either
303
  # ~/datasets/furry/sample_prompts/pony or ~/datasets/furry/sample_prompts/compass based on the content.
@@ -382,7 +439,6 @@ copy_matching_caption_files() {
382
  done
383
  }
384
 
385
-
386
  # This script performs a text replacement operation in all .txt files within a specified directory.
387
  # It takes three arguments:
388
  # 1. target_dir: The directory containing the .txt files where the text replacement will occur.
@@ -464,12 +520,6 @@ update_dir() {
464
  fi
465
  }
466
 
467
- export TOKENIZERS_PARALLELISM=false
468
-
469
- alias grabber="Grabber-cli"
470
-
471
- #export force_color_prompt=yes
472
-
473
  chop_lora() {
474
  local input_file="$1"
475
  local base_name="${input_file:r}" # Remove extension
@@ -505,21 +555,6 @@ swch() {
505
  git clean -fxd && git pull && git checkout $branchname
506
  }
507
 
508
- export COMFYUI_PATH="$HOME/ComfyUI"
509
- export ZSH="$HOME/.oh-my-zsh"
510
-
511
- ZSH_THEME="kade"
512
- # CASE_SENSITIVE="true"
513
- # HYPHEN_INSENSITIVE="true"
514
- # DISABLE_MAGIC_FUNCTIONS="true"
515
- # DISABLE_LS_COLORS="true"
516
- # DISABLE_AUTO_TITLE="true"
517
- # ENABLE_CORRECTION="true"
518
- # COMPLETION_WAITING_DOTS="true"
519
- # DISABLE_UNTRACKED_FILES_DIRTY="true"
520
-
521
- plugins=(git autojump conda-env)
522
-
523
  extract_iframes() {
524
  # Assign input arguments
525
  input_file="$1"
@@ -557,7 +592,6 @@ convert_to_jxl() {
557
  echo "Conversion complete."
558
  }
559
 
560
-
561
  convert_pxl_to_png() {
562
  local target_directory="$1"
563
 
@@ -583,7 +617,6 @@ convert_pxl_to_png() {
583
  echo "Conversion complete."
584
  }
585
 
586
-
587
  seed() {
588
  local filePath="$1"
589
  python3 -c "
@@ -597,13 +630,6 @@ png2mp4() {
597
  -c:v libx264 -pix_fmt yuv420p out.mp4
598
  }
599
 
600
-
601
- source $ZSH/oh-my-zsh.sh
602
-
603
- export PATH=$PATH:$HOME/source/repos/dataset-tools/target/x86_64-unknown-linux-gnu/release:$HOME/.cargo/bin:$HOME/miniconda3/bin:$HOME/toolkit:$HOME/db/redis-stable/src:$HOME/db/postgresql/bin:$HOME/.local/bin:/opt/cuda/bin
604
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib:/opt/cuda/targets/x86_64-linux/lib
605
- export COMFYUI_MODEL_PATH=/home/kade/ComfyUI/models
606
-
607
  c_old() {
608
  cd ~/ComfyUI &&
609
  python3.12 main.py --listen 0.0.0.0 --preview-method taesd --use-pytorch-cross-attention --disable-xformers --fast
@@ -615,43 +641,6 @@ c() {
615
  python main.py --listen 0.0.0.0 --preview-method taesd --use-pytorch-cross-attention --disable-xformers --front-end-version Comfy-Org/ComfyUI_frontend@latest --fast
616
  }
617
 
618
- alias cp='cp --reflink=auto'
619
- alias t="tensorboard --logdir=$HOME/output_dir/logs"
620
- alias rt="vim ~/.tmux.conf && echo \"Reloading tmux config\" && tmux source ~/.tmux.conf"
621
- alias zr="vim ~/.zshrc && echo \"Reloading zsh config\" && source ~/.zshrc"
622
- alias ta="tmux att"
623
- alias ga="git add . && git commit -avs && git push"
624
- alias gs="git status"
625
- alias wd="git diff --word-diff-regex='[^,]+' --patience"
626
- alias vim="nvim"
627
- alias vi="nvim"
628
- alias v="nvim"
629
- alias grh='git reset --hard'
630
- alias gcs='git clone --recurse-submodules'
631
-
632
- source /home/kade/.config/broot/launcher/bash/br
633
-
634
- [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
635
-
636
- alias ls='ls --color=always'
637
-
638
- # >>> conda initialize >>>
639
- # !! Contents within this block are managed by 'conda init' !!
640
- __conda_setup="$('/home/kade/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
641
- if [ $? -eq 0 ]; then
642
- eval "$__conda_setup"
643
- else
644
- if [ -f "/home/kade/miniconda3/etc/profile.d/conda.sh" ]; then
645
- . "/home/kade/miniconda3/etc/profile.d/conda.sh"
646
- else
647
- export PATH="/home/kade/miniconda3/bin:$PATH"
648
- fi
649
- fi
650
- unset __conda_setup
651
- # <<< conda initialize <<<
652
-
653
- unset CONDA_CHANGEPS1
654
-
655
  conda_prompt_info() {
656
  if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
657
  echo "(${CONDA_DEFAULT_ENV})"
 
1
+ export ZSH="$HOME/.oh-my-zsh"
2
+
3
+ plugins=(git autojump conda-env)
4
+
5
+ ZSH_THEME="kade"
6
+ # CASE_SENSITIVE="true"
7
+ # HYPHEN_INSENSITIVE="true"
8
+ # DISABLE_MAGIC_FUNCTIONS="true"
9
+ # DISABLE_LS_COLORS="true"
10
+ # DISABLE_AUTO_TITLE="true"
11
+ # ENABLE_CORRECTION="true"
12
+ # COMPLETION_WAITING_DOTS="true"
13
+ # DISABLE_UNTRACKED_FILES_DIRTY="true"
14
+
15
+ export LANG=ja_JP.UTF-8
16
+ export LC_ALL=ja_JP.UTF-8
17
+
18
+ export COMFYUI_PATH="$HOME/ComfyUI"
19
+ export BNB_CUDA_VERSION=126
20
+
21
+ export RUST_BACKTRACE=1
22
+
23
+ export DOTNET_CLI_TELEMETRY_OPTOUT=1
24
+ export CLICOLOR=126
25
+
26
  # ⚠️ TODO: This needs to be benched but I'm too bad at this!
27
  export NUMEXPR_MAX_THREADS=24
28
  export VECLIB_MAXIMUM_THREADS=24
29
  export MKL_NUM_THREADS=24
30
  export OMP_NUM_THREADS=24
31
 
32
+ export TOKENIZERS_PARALLELISM=false
33
+
34
+ source $ZSH/oh-my-zsh.sh
35
+
36
+ export PATH=$PATH:$HOME/source/repos/dataset-tools/target/x86_64-unknown-linux-gnu/release:$HOME/.cargo/bin:$HOME/miniconda3/bin:$HOME/toolkit:$HOME/db/redis-stable/src:$HOME/db/postgresql/bin:$HOME/.local/bin:/opt/cuda/bin
37
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib:/opt/cuda/targets/x86_64-linux/lib
38
+ export COMFYUI_MODEL_PATH=/home/kade/ComfyUI/models
39
+
40
+ alias ls='ls --color=always'
41
+ alias ll="ls -lah --color=always"
42
+ alias cp='cp --reflink=auto'
43
+ alias t="tensorboard --logdir=$HOME/output_dir/logs"
44
+ alias rt="vim ~/.tmux.conf && echo \"Reloading tmux config\" && tmux source ~/.tmux.conf"
45
+ alias zr="vim ~/.zshrc && echo \"Reloading zsh config\" && source ~/.zshrc"
46
+ alias ta="tmux att"
47
+ alias ga="git add . && git commit -avs && git push"
48
+ alias gs="git status"
49
+ alias wd="git diff --word-diff-regex='[^,]+' --patience"
50
+ alias vim="nvim"
51
+ alias vi="nvim"
52
+ alias v="nvim"
53
+ alias grh='git reset --hard'
54
+ alias gcs='git clone --recurse-submodules'
55
+ alias grabber="Grabber-cli"
56
+
57
+ # 'pie' is a shortcut for installing a Python package in editable mode
58
+ # using the pip command with the --use-pep517 option.
59
+ alias pie='pip install -e . --use-pep517'
60
+ alias gc="git commit -avs --verbose"
61
+ alias dir="dir --color=always"
62
+
63
+ alias ezc="nvim ~/.zshrc && source ~/.zshrc"
64
+
65
+ source /home/kade/.config/broot/launcher/bash/br
66
+
67
+ [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
68
+
69
+ # >>> conda initialize >>>
70
+ # !! Contents within this block are managed by 'conda init' !!
71
+ __conda_setup="$('/home/kade/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
72
+ if [ $? -eq 0 ]; then
73
+ eval "$__conda_setup"
74
+ else
75
+ if [ -f "/home/kade/miniconda3/etc/profile.d/conda.sh" ]; then
76
+ . "/home/kade/miniconda3/etc/profile.d/conda.sh"
77
+ else
78
+ export PATH="/home/kade/miniconda3/bin:$PATH"
79
+ fi
80
+ fi
81
+ unset __conda_setup
82
+ # <<< conda initialize <<<
83
+
84
+ unset CONDA_CHANGEPS1
85
+
86
+
87
  display_git_help() {
88
  echo "Git"
89
  echo "---"
 
97
  }
98
  display_git_help
99
 
 
 
 
 
 
 
 
100
  # This function, rejiggle_captions, takes two arguments: a tag and a directory.
101
  # It searches for all .txt files in the specified directory and its subdirectories.
102
  # If a file contains the specified tag, the function removes the tag from its original position
 
119
  done
120
  }
121
 
 
122
  # This function, `update_conda`, automates the process of upgrading all packages in every conda environment.
123
  # It performs the following steps:
124
  # 1. Retrieves the list of all conda environments using `conda env list` and extracts their names.
 
149
  echo "All environments have been upgraded."
150
  }
151
 
 
 
 
152
  list_word_freqs() {
153
  local target_dir=$1
154
  if [[ -z "$target_dir" ]]; then
 
317
  echo "----------------------------------------------------------------------------------------------------------------------"
318
  }
319
 
 
 
320
  # This function `nv` retrieves the version of the NVIDIA CUDA Compiler (nvcc) installed on the system.
321
  # It extracts the version number from the `nvcc --version` command output.
322
  # The version number is then formatted by removing the dot (e.g., 12.6 becomes 126).
 
335
  echo $result
336
  }
337
 
 
 
338
  # Function to remove consecutive repeated words in text files within a directory
339
  remove_repetition() {
340
  local dir=$1 # The directory to search for text files
341
  # Find all .txt files in the specified directory and process each file
342
  find "$dir" -type f -name "*.txt" | while read -r file; do
343
  # Use awk to process each line of the file
344
+ awk '
345
  {
346
  n = split($0, words, " ") # Split the line into words
347
  for (i = n; i > 1; i--) { # Iterate from the last word to the second word
 
351
  printf "%s%s", words[j], (j == i ? ORS : OFS) # Print the word followed by a space or newline
352
  }
353
  }
354
+ ' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
 
 
355
  done
356
  }
357
 
 
 
 
 
 
 
358
  # Organizes a sample prompt file from the current directory to datasets/furry.
359
  # It moves the file named sample-prompts.txt to either
360
  # ~/datasets/furry/sample_prompts/pony or ~/datasets/furry/sample_prompts/compass based on the content.
 
439
  done
440
  }
441
 
 
442
  # This script performs a text replacement operation in all .txt files within a specified directory.
443
  # It takes three arguments:
444
  # 1. target_dir: The directory containing the .txt files where the text replacement will occur.
 
520
  fi
521
  }
522
 
 
 
 
 
 
 
523
  chop_lora() {
524
  local input_file="$1"
525
  local base_name="${input_file:r}" # Remove extension
 
555
  git clean -fxd && git pull && git checkout $branchname
556
  }
557
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558
  extract_iframes() {
559
  # Assign input arguments
560
  input_file="$1"
 
592
  echo "Conversion complete."
593
  }
594
 
 
595
  convert_pxl_to_png() {
596
  local target_directory="$1"
597
 
 
617
  echo "Conversion complete."
618
  }
619
 
 
620
  seed() {
621
  local filePath="$1"
622
  python3 -c "
 
630
  -c:v libx264 -pix_fmt yuv420p out.mp4
631
  }
632
 
 
 
 
 
 
 
 
633
  c_old() {
634
  cd ~/ComfyUI &&
635
  python3.12 main.py --listen 0.0.0.0 --preview-method taesd --use-pytorch-cross-attention --disable-xformers --fast
 
641
  python main.py --listen 0.0.0.0 --preview-method taesd --use-pytorch-cross-attention --disable-xformers --front-end-version Comfy-Org/ComfyUI_frontend@latest --fast
642
  }
643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  conda_prompt_info() {
645
  if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
646
  echo "(${CONDA_DEFAULT_ENV})"