k4d3 commited on
Commit
e416fd9
1 Parent(s): 1d79986

lots of random changes

Browse files

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

Files changed (4) hide show
  1. .gitattributes +1 -0
  2. .zshrc +3 -0
  3. crawl/crawl +2 -2
  4. git-wrapper.zsh +46 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.jxl filter=lfs diff=lfs merge=lfs -text
.zshrc CHANGED
@@ -1,3 +1,5 @@
 
 
1
  export ZSH="$HOME/.oh-my-zsh"
2
 
3
  plugins=(git autojump conda-env)
@@ -38,6 +40,7 @@ export PATH=$PATH:$HOME/source/repos/dataset-tools/target/x86_64-unknown-linux-g
38
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib:/opt/cuda/targets/x86_64-linux/lib
39
  export COMFYUI_MODEL_PATH=/home/kade/ComfyUI/models
40
 
 
41
  alias ls='ls --color=always'
42
  alias ll="ls -lah --color=always"
43
  alias cp='cp --reflink=auto'
 
1
+ source $HOME/toolkit/git-wrapper.zsh
2
+
3
  export ZSH="$HOME/.oh-my-zsh"
4
 
5
  plugins=(git autojump conda-env)
 
40
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib:/opt/cuda/targets/x86_64-linux/lib
41
  export COMFYUI_MODEL_PATH=/home/kade/ComfyUI/models
42
 
43
+ alias upx='/home/kade/.local/bin/upx'
44
  alias ls='ls --color=always'
45
  alias ll="ls -lah --color=always"
46
  alias cp='cp --reflink=auto'
crawl/crawl CHANGED
@@ -124,8 +124,8 @@ def save_result(target_url):
124
  # Choose the appropriate base path based on the operating system
125
  if platform.system() == "Windows":
126
  base_path = "E:\\datasets\\knowledgebase\\Saved Websites\\"
127
- else:
128
- base_path = "/home/kade/saved_websites/"
129
 
130
  save_dir = os.path.join(base_path, sanitized_title)
131
  os.makedirs(save_dir, exist_ok=True)
 
124
  # Choose the appropriate base path based on the operating system
125
  if platform.system() == "Windows":
126
  base_path = "E:\\datasets\\knowledgebase\\Saved Websites\\"
127
+ elsek:
128
+ base_path = "/home/kade/datasets/knowledgebase/Saved Websites"
129
 
130
  save_dir = os.path.join(base_path, sanitized_title)
131
  os.makedirs(save_dir, exist_ok=True)
git-wrapper.zsh ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This function is a wrapper for the 'git' command, providing additional functionality for the 'clone' and 'add' operations.
2
+ #
3
+ # Usage:
4
+ # git <command> [<args>...]
5
+ #
6
+ # Parameters:
7
+ # <command> - The git command to execute (e.g., clone, pull, push, add, etc.).
8
+ # [<args>...] - The arguments to pass to the git command.
9
+ #
10
+ # Functionality:
11
+ # - If the first argument is 'clone', the function executes 'git clone' with the '--recurse-submodules' option.
12
+ # This ensures that all submodules are cloned along with the main repository.
13
+ # - If the first argument is 'add', the function checks if the current directory is inside '~/datasets'.
14
+ # If it is, it checks for the existence of a '.gitattributes' file and runs 'git lfs track "*.jxl"' before executing 'git add'.
15
+ # - For any other git command, the function simply passes all arguments to the 'git' command as-is.
16
+ #
17
+ # Examples:
18
+ # git clone https://github.com/user/repo.git
19
+ # This will execute 'git clone --recurse-submodules https://github.com/user/repo.git', cloning the repository along with its submodules.
20
+ #
21
+ # git add .
22
+ # This will check if the current directory is inside '~/datasets', check for a '.gitattributes' file, and run 'git lfs track "*.jxl"' if the file exists, then execute 'git add .'.
23
+ #
24
+ # git pull origin main
25
+ # This will execute 'git pull origin main', pulling the latest changes from the 'main' branch.
26
+ #
27
+ # Notes:
28
+ # - This function uses 'command' to bypass any other shell functions or aliases named 'git', ensuring that the actual git command is executed.
29
+ # - The use of "${@:2}" in the 'clone' case ensures that all arguments after 'clone' are passed to the 'git clone' command.
30
+ # - The use of "${@:2}" in the 'add' case ensures that all arguments after 'add' are passed to the 'git add' command.
31
+ # - The function checks if the current directory is inside '~/datasets' by comparing the current directory path with the '~/datasets' path.
32
+ function git() {
33
+ if [[ "$1" == "clone" ]]; then
34
+ command git clone --recurse-submodules "${@:2}"
35
+ elif [[ "$1" == "add" ]]; then
36
+ if [[ "$(pwd)" == ~/datasets* ]]; then
37
+ if [[ -f .gitattributes ]]; then
38
+ command git lfs track "*.jxl"
39
+ fi
40
+ fi
41
+ command git add "${@:2}"
42
+ else
43
+ command git "$@"
44
+ fi
45
+ }
46
+