start of organization
Browse files- .zshrc +4 -34
- zsh/check4sig.zsh +49 -0
.zshrc
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
alias wordfreq='find ${1:-.} -type f -name "*.txt" -exec cat {} + | tr "," " " | tr " " "\n" | sort | uniq -c | sort -nr | less'
|
2 |
alias wq='wordfreq'
|
3 |
-
alias 🐺=
|
4 |
alias gsa='git submodule add'
|
5 |
|
6 |
deleteorphantags() {
|
@@ -51,35 +51,6 @@ look4orphantxt() {
|
|
51 |
done
|
52 |
}
|
53 |
|
54 |
-
check4sig() {
|
55 |
-
target_dir="$1"
|
56 |
-
if [[ -z "$target_dir" ]]; then
|
57 |
-
echo "Please provide a target directory."
|
58 |
-
return 1
|
59 |
-
fi
|
60 |
-
|
61 |
-
if [[ ! -d "$target_dir" ]]; then
|
62 |
-
echo "The provided target directory does not exist."
|
63 |
-
return 1
|
64 |
-
fi
|
65 |
-
|
66 |
-
found_files=()
|
67 |
-
for file in "$target_dir"/*.caption; do
|
68 |
-
if [[ -f "$file" ]]; then
|
69 |
-
if grep -q -e "signature" -e "watermark" "$file"; then
|
70 |
-
found_files+=("$file")
|
71 |
-
fi
|
72 |
-
fi
|
73 |
-
done
|
74 |
-
|
75 |
-
if [[ ${#found_files[@]} -eq 0 ]]; then
|
76 |
-
echo "No 'signature' or 'watermark' found in any .caption files."
|
77 |
-
else
|
78 |
-
echo "Opening files in nvim: ${found_files[@]}"
|
79 |
-
nvim "${found_files[@]}"
|
80 |
-
fi
|
81 |
-
}
|
82 |
-
|
83 |
alias fuckoff="conda deactivate && rconda"
|
84 |
|
85 |
export GIN_MODE=release
|
@@ -100,8 +71,10 @@ export QT_QPA_PLATFORM=offscreen
|
|
100 |
# Note: The JIT is only available for x86_64 builds of Python in conda.
|
101 |
export PYTHON_JIT=1
|
102 |
|
103 |
-
# Load the custom git wrapper script
|
104 |
source $HOME/toolkit/zsh/git-wrapper.zsh
|
|
|
|
|
|
|
105 |
|
106 |
# Set the path to the Oh My Zsh installation directory
|
107 |
export ZSH="$HOME/.oh-my-zsh"
|
@@ -969,9 +942,6 @@ filePath = '$filePath'
|
|
969 |
print(json.loads(safetensors.safe_open(filePath, 'np').metadata().get('ss_seed', 'Not found')))"
|
970 |
}
|
971 |
|
972 |
-
source ~/toolkit/zsh/install_members.zsh
|
973 |
-
source ~/toolkit/zsh/gallery-dl.zsh
|
974 |
-
|
975 |
# Function: c
|
976 |
# Description:
|
977 |
# This function launches ComfyUI with specific settings tailored to the user's preferences.
|
|
|
1 |
alias wordfreq='find ${1:-.} -type f -name "*.txt" -exec cat {} + | tr "," " " | tr " " "\n" | sort | uniq -c | sort -nr | less'
|
2 |
alias wq='wordfreq'
|
3 |
+
alias 🐺='ollama serve & conda activate openwebui && open-webui serve --port 6969'
|
4 |
alias gsa='git submodule add'
|
5 |
|
6 |
deleteorphantags() {
|
|
|
51 |
done
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
alias fuckoff="conda deactivate && rconda"
|
55 |
|
56 |
export GIN_MODE=release
|
|
|
71 |
# Note: The JIT is only available for x86_64 builds of Python in conda.
|
72 |
export PYTHON_JIT=1
|
73 |
|
|
|
74 |
source $HOME/toolkit/zsh/git-wrapper.zsh
|
75 |
+
source $HOME/toolkit/zsh/check4sig.zsh
|
76 |
+
source $HOME/toolkit/zsh/install_members.zsh
|
77 |
+
source $HOME/toolkit/zsh/gallery-dl.zsh
|
78 |
|
79 |
# Set the path to the Oh My Zsh installation directory
|
80 |
export ZSH="$HOME/.oh-my-zsh"
|
|
|
942 |
print(json.loads(safetensors.safe_open(filePath, 'np').metadata().get('ss_seed', 'Not found')))"
|
943 |
}
|
944 |
|
|
|
|
|
|
|
945 |
# Function: c
|
946 |
# Description:
|
947 |
# This function launches ComfyUI with specific settings tailored to the user's preferences.
|
zsh/check4sig.zsh
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# check4sig - Dataset Caption File Watermark Detection Utility
|
2 |
+
#
|
3 |
+
# Purpose:
|
4 |
+
# This function scans .caption files in a dataset directory to identify and edit
|
5 |
+
# files containing watermark-related text. It's particularly useful for cleaning
|
6 |
+
# image datasets where caption files might indicate the presence of watermarks.
|
7 |
+
#
|
8 |
+
# Usage: check4sig /path/to/dataset
|
9 |
+
#
|
10 |
+
# Function workflow:
|
11 |
+
# 1. Validates the provided directory path
|
12 |
+
# 2. Searches all .caption files for "signature" or "watermark" keywords
|
13 |
+
# 3. Opens any matching files in nvim for manual review/editing
|
14 |
+
#
|
15 |
+
# Parameters:
|
16 |
+
# $1 - Target directory containing .caption files
|
17 |
+
#
|
18 |
+
# Returns:
|
19 |
+
# - 1 if directory is invalid or missing
|
20 |
+
# - Opens nvim if matching files are found
|
21 |
+
# - Prints message if no matches are found
|
22 |
+
check4sig() {
|
23 |
+
target_dir="$1"
|
24 |
+
if [[ -z "$target_dir" ]]; then
|
25 |
+
echo "Please provide a target directory."
|
26 |
+
return 1
|
27 |
+
fi
|
28 |
+
|
29 |
+
if [[ ! -d "$target_dir" ]]; then
|
30 |
+
echo "The provided target directory does not exist."
|
31 |
+
return 1
|
32 |
+
fi
|
33 |
+
|
34 |
+
found_files=()
|
35 |
+
for file in "$target_dir"/*.caption; do
|
36 |
+
if [[ -f "$file" ]]; then
|
37 |
+
if grep -q -e "signature" -e "watermark" "$file"; then
|
38 |
+
found_files+=("$file")
|
39 |
+
fi
|
40 |
+
fi
|
41 |
+
done
|
42 |
+
|
43 |
+
if [[ ${#found_files[@]} -eq 0 ]]; then
|
44 |
+
echo "No 'signature' or 'watermark' found in any .caption files."
|
45 |
+
else
|
46 |
+
echo "Opening files in nvim: ${found_files[@]}"
|
47 |
+
nvim "${found_files[@]}"
|
48 |
+
fi
|
49 |
+
}
|