This file contains hidden or 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
#!/bin/bash | |
# Enhanced cleanup_cache.sh for Ubuntu 24.04 | |
# Security and efficiency improvements | |
# Enable error handling and safety features | |
set -e # Exit on error | |
set -u # Exit on undefined variables | |
set -o pipefail # Exit on pipe failures |
This file contains hidden or 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
#!/bin/bash | |
# Define the directory where Open-WebUI is located | |
OPEN_WEBUI_DIR="$HOME/GitHub/open-webui" | |
# Define the port to run Open-WebUI on | |
WEBUI_PORT=7860 # Replace this with your desired port number | |
# Navigate to the Open-WebUI directory | |
if cd "$OPEN_WEBUI_DIR"; then |
This file contains hidden or 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
#!/bin/bash | |
# Define the directory where ComfyUI is located | |
COMFYUI_DIR="$HOME/GitHub/ComfyUI" | |
# Check if Conda is installed | |
if ! command -v conda &> /dev/null; then | |
echo "Error: Conda is not installed. Please install Conda and try again." | |
exit 1 | |
fi |
This file contains hidden or 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
#!/bin/bash | |
# Source Conda environment script to make 'conda' available in WSL | |
if [ -f "/home/username/anaconda3/etc/profile.d/conda.sh" ]; then | |
source "/home/username/anaconda3/etc/profile.d/conda.sh" | |
else | |
echo "Conda initialization script not found. Please check your Conda installation." | |
exit 1 | |
fi |
This file contains hidden or 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
# Unreal Engine specific content (optimized for WSL) | |
*.uasset filter=lfs diff=lfs merge=lfs -text | |
*.umap filter=lfs diff=lfs merge=lfs -text | |
# Source code and text files (with explicit line endings) | |
*.cpp text eol=lf | |
*.h text eol=lf | |
*.ini text eol=lf | |
*.uproject text eol=lf | |
*.txt text eol=lf |
This file contains hidden or 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 | |
# Enhanced Ubuntu Cleanup Script | |
# This script performs comprehensive system cleanup while maintaining security and robustness | |
# Configuration variables (can be moved to a separate config file) | |
CONFIG_FILE="${HOME}/.config/ubuntu_cleanup.conf" | |
LOG_DIR="/var/log/system_cleanup" | |
LOG_FILE="${LOG_DIR}/cleanup_$(date +%Y%m%d_%H%M%S).log" | |
DRY_RUN=0 |
This file contains hidden or 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 Algorithmic Design Workbook with Houdini https://app.gumroad.com/d/782fb33b45a3bbc40fdc24d9196cb6ec | |
// https://www.tokeru.com/cgwiki/index.php?title=HoudiniVex#Attributes_vs_variables | |
int npnt = nearpoint(1,@P); | |
vector targetpos = point(1, 'P', npnt); | |
float dist = distance(@P, targetpos); |
This file contains hidden or 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
import requests | |
def DownloadImage(pic_url_prefix, pic_name): | |
with open(pic_name, 'wb') as handle: | |
response = requests.get(pic_url_prefix+pic_name, stream=True) | |
if not response.ok: | |
print(pic_url_prefix+pic_name, response) | |
for block in response.iter_content(1024): |
This file contains hidden or 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
# First, you should install flickrapi | |
# pip install flickrapi | |
import flickrapi | |
import urllib | |
from PIL import Image | |
# Flickr api access key | |
flickr=flickrapi.FlickrAPI('c6a2c45591d4973ff525042472446ca2', '202ffe6f387ce29b', cache=True) |