sudoku drama
This commit is contained in:
parent
5a081e4ecd
commit
0805b6ab54
@ -2,7 +2,7 @@
|
||||
description = "Nix flake for the activity logging script";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
sudoku-solver.url = "path:./src/sudoku-hs";
|
||||
# sudoku-solver.url = "path:./src/sudoku-hs";
|
||||
};
|
||||
outputs =
|
||||
{ nixpkgs, ... }@inputs:
|
||||
@ -48,7 +48,7 @@
|
||||
citra = pkgs.callPackage ./pkgs/citra/default.nix { branch = "nightly"; };
|
||||
pano = pkgs.callPackage ./pkgs/pano/default.nix { };
|
||||
vdhcoapp = pkgs.callPackage ./pkgs/vdhcoapp/default.nix { };
|
||||
sudoku-solver = inputs.sudoku-solver.packages.${system}.default;
|
||||
# sudoku-solver = inputs.sudoku-solver.packages.${system}.default;
|
||||
}
|
||||
// generatePackages {
|
||||
dir = "pkgs";
|
||||
|
||||
45
src/scripts/generate-gallery-index.sh
Normal file
45
src/scripts/generate-gallery-index.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p bash fd
|
||||
|
||||
SOURCE_DIR="/srv/pool/scrapping/JawZ/gallery-dl/"
|
||||
OUTPUT_DIR="/var/www/gallery"
|
||||
PREVIEW_COUNT=24
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
cd "$SOURCE_DIR" || exit 1
|
||||
|
||||
while IFS= read -r dir; do
|
||||
artist_name="${dir%/}"
|
||||
artist_output="$OUTPUT_DIR/$artist_name"
|
||||
mkdir -p "$artist_output/.preview"
|
||||
|
||||
# Clean any previous preview
|
||||
rm -rf "$artist_output/.preview"/*
|
||||
fd . "$dir" --maxdepth 1 -tf -e jpg -e jpeg -e png |
|
||||
shuf -n "$PREVIEW_COUNT" |
|
||||
while read -r img; do
|
||||
cp "$img" "$artist_output/.preview/"
|
||||
done
|
||||
|
||||
# Generate index.html for the artist
|
||||
{
|
||||
echo "<html><head><title>$artist_name</title>"
|
||||
echo "<style>body{font-family:sans-serif} img{max-width:200px; margin:5px;}</style></head><body>"
|
||||
echo "<h2>$artist_name</h2><div>"
|
||||
for img in "$artist_output/.preview/"*; do
|
||||
img_name="$(basename "$img")"
|
||||
echo "<img src=\".preview/$img_name\" loading=\"lazy\">"
|
||||
done
|
||||
echo "</div><p><a href=\"../index.html\">Back to index</a></p></body></html>"
|
||||
} >"$artist_output/index.html"
|
||||
done < <(fd . -td)
|
||||
|
||||
# Generate master index.html
|
||||
{
|
||||
echo "<html><head><title>Gallery Index</title></head><body><h1>Gallery Index</h1><ul>"
|
||||
for dir in "$OUTPUT_DIR"/*/; do
|
||||
artist="$(basename "$dir")"
|
||||
echo "<li><a href=\"./$artist/index.html\">$artist</a></li>"
|
||||
done
|
||||
echo "</ul></body></html>"
|
||||
} >"$OUTPUT_DIR/index.html"
|
||||
@ -2,8 +2,8 @@
|
||||
#! nix-shell -i bash -p bash
|
||||
|
||||
# Source and destination directories
|
||||
SRC_DIR="/srv/server/pool/scrapping/JawZ/gallery-dl"
|
||||
DEST_DIR="/srv/server/pool/scrapping/JawZ/videos-dl"
|
||||
SRC_DIR="/srv/pool/scrapping/JawZ/gallery-dl"
|
||||
DEST_DIR="/srv/pool/scrapping/JawZ/videos-dl"
|
||||
|
||||
# Create destination directory if it doesn't exist
|
||||
mkdir -p "$DEST_DIR"
|
||||
|
||||
46
src/scripts/sync-keep.sh
Executable file
46
src/scripts/sync-keep.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/etc/profiles/per-user/jawz/bin/bash
|
||||
|
||||
KEEP_DIR="/srv/pool/scrapping/JawZ/keep"
|
||||
SOURCE_DIR="/srv/pool/scrapping/JawZ/gallery-dl"
|
||||
|
||||
shopt -s globstar nullglob
|
||||
|
||||
cd "$KEEP_DIR" || exit 1
|
||||
|
||||
for keep_path in **/; do
|
||||
relative_path="${keep_path%/}"
|
||||
src_path="$SOURCE_DIR/$relative_path"
|
||||
dest_path="$KEEP_DIR/$relative_path"
|
||||
|
||||
if [ ! -d "$src_path" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Processing: $relative_path"
|
||||
mkdir -p "$dest_path"
|
||||
|
||||
for src_file in "$src_path"/*; do
|
||||
filename="$(basename "$src_file")"
|
||||
dest_file="$dest_path/$filename"
|
||||
|
||||
if [ ! -f "$src_file" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ ! -f "$dest_file" ]; then
|
||||
mv "$src_file" "$dest_file"
|
||||
echo "→ Moved: $filename"
|
||||
continue
|
||||
fi
|
||||
|
||||
if cmp -s "$src_file" "$dest_file"; then
|
||||
echo "✓ Duplicate: $filename — deleting source"
|
||||
rm "$src_file"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "⚠ Conflict (not identical): $filename"
|
||||
done
|
||||
done
|
||||
|
||||
fd . "$SOURCE_DIR" -td -te -x rmdir {} \;
|
||||
Loading…
x
Reference in New Issue
Block a user