diff --git a/cf b/cf old mode 100644 new mode 100755 diff --git a/ddns b/ddns old mode 100644 new mode 100755 diff --git a/sij b/sij deleted file mode 100755 index 9efd0bf..0000000 --- a/sij +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/zsh -# #!/bin/bash -source /Users/sij/.zshrc - -# Kill the existing tmux server -tmux kill-server -sleep 2 - -# Create the main session and windows -tmux new-session -d -s sijapi -n 'Main' - -# Split the main window into three vertical panes -tmux split-window -v -t sijapi:Main -#tmux split-window -v -t sijapi:Main -tmux select-layout even-vertical - -# Configure API pane (top pane) -tmux select-pane -t 0 -tmux send-keys "cd ~/workshop" C-m -tmux send-keys "source ~/.zshrc; sleep 1" C-m -tmux send-keys "mamba activate sijapi; while true; do python -m sijapi; sleep 1; done" C-m - -# Configure Khoj (middle pane) -tmux select-pane -t 1 -tmux send-keys "source ~/.zshrc" C-m -tmux send-keys "mamba activate khoj; export KHOJ_DOMAIN=ai.sij.ai && export KHOJ_ADMIN_EMAIL=sij@env.esq && export KHOJ_ADMIN_PASSWORD='Synchr0!-K' && export KHOJ_DEBUG=True && export DEBUG=true && while true; do khoj --anonymous-mode; sleep 1; done" C-m - -# Configure Ollama (bottom pane) -tmux select-pane -t 1 -tmux send-keys "cd ~/sync/sijapi/api" C-m -tmux send-keys "source ~/.zshrc; sleep 1" C-m -tmux send-keys "while true; do export OLLAMA_HOST='0.0.0.0:11434' && export OLLAMA_ORIGINS='*' && ollama serve; sleep 1; done" C-m - -# Create separate session for Syncthing -# tmux new-session -d -s syncthing -n 'Syncthing' -# tmux send-keys "source ~/.zshrc" C-m -# tmux send-keys "while true; do /opt/homebrew/bin/syncthing; done" C-m - -# Attach to the main tmux session -tmux attach-session -t sijapi diff --git a/ssh-scrape b/ssh-scrape deleted file mode 100755 index 4ef35c7..0000000 --- a/ssh-scrape +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -if [ "$#" -lt 2 ]; then - echo "Error: No command provided." - exit 1 -fi - -variant=$1 -shift # Remove the first argument, which is now stored in 'variant' -additional_params="$@" # Remaining arguments - -quoted_params="" -for param in "$@"; do - quoted_params+="\"$param\" " -done - -session_name="scrape-$(date +%Y%m%d%H%M%S)" -tailscale up -tmux new-session -d -s "$session_name" -ssh_command="ssh -t sij@vm 'tmux new-session -d -s \"$session_name\" \"/usr/local/bin/scrape ${variant} ${quoted_params}\"; tmux attach-session -t \"$session_name\"'" -tmux send-keys -t "$session_name" "$ssh_command" C-m -tmux attach-session -t "$session_name" - diff --git a/st b/st deleted file mode 100755 index 212dbf7..0000000 --- a/st +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -tmux new-session -d -s syncthing -n syncthingpane -tmux select-pane -t 0 -tmux send-keys -t 0 "/opt/homebrew/bin/syncthing" C-m diff --git a/ts-info b/ts-info deleted file mode 100755 index 7c7b942..0000000 --- a/ts-info +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Function to get exit node details -# get_exit_node_details() { -# echo $(/Applications/Tailscale.app/Contents/MacOS/Tailscale exit-node list | awk '/'"$1"'/ {print $4", "$3" ("$2")"}') -# } - -# Get the current exit node details and public IP -# CURRENT_NODE=$(get_exit_node_details 'selected') -# CURRENT_IP=$(curl -s ifconfig.me) -# DNS_SERVER=$(python3 ~/.dns-info.py) - -# echo "IP address: $CURRENT_IP" -# echo "DNS server: $DNS_SERVER" -# echo "Exit node: ${CURRENT_NODE:-None}" -# echo "" - -READOUT=$(python3 /Users/sij/Scripts/Raycast\ Scripts/vpn-dns-info.py) -echo "$READOUT" diff --git a/ts-new-node b/ts-new-node deleted file mode 100755 index 779582a..0000000 --- a/ts-new-node +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# TSBINARY=$(which tailscale || echo "tailscale") -TSBINARY='/Applications/Tailscale.app/Contents/MacOS/Tailscale' -VERBOSE=0 - -# Check for -v argument -while getopts "v" option; do - case $option in - v) - VERBOSE=1 - ;; - esac -done - -# Function to get exit node details -get_exit_node_details() { - if [[ $VERBOSE -eq 1 ]]; then - echo "$($TSBINARY exit-node list | awk '/'"$1"'/ {print $4", "$3" ("$2")"}')" - fi -} - -if [[ $VERBOSE -eq 1 ]]; then - # Get the current exit node details and public IP - CURRENT_NODE=$(get_exit_node_details 'selected') - CURRENT_IP=$(curl -s ifconfig.me) - DNS_SERVER=$(python3 ~/.dns-info.py) - - # Print the current node and IP - echo "IP address: $CURRENT_IP" - echo "DNS server: $DNS_SERVER" - echo "Exit node: ${CURRENT_NODE:-None}" - echo "" -fi - -# Select a new exit node -SELECTED_NODE=$($TSBINARY exit-node list | grep -v -f ~/.vpnblacklist | awk 'BEGIN {srand()} {print rand() " " $0}' | sort -k1,1n | cut -d ' ' -f2- | awk '{print $2}' | head -n 1) - -# Set the selected node as the exit node -$TSBINARY set --exit-node="$SELECTED_NODE" - -if [[ $VERBOSE -eq 1 ]]; then - # Wait for the network to update - sleep 1 - - # Get the new public IP - NEW_IP=$(curl -s ifconfig.me) - - # Get the new exit node details - NEW_NODE=$(get_exit_node_details "$SELECTED_NODE") - - NEW_DNS=$(python3 ~/.dns-info.py) - - # Print the new node and IP - echo "New Public IP address: $NEW_IP" - echo "New DNS server: $NEW_DNS" - echo "Exit node: ${NEW_NODE:-None}" - echo "" -fi diff --git a/ts-new-node-minimalist b/ts-new-node-minimalist deleted file mode 100755 index 34f9caf..0000000 --- a/ts-new-node-minimalist +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# Define the path to your Tailscale binary -tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale" - -# Check if Tailscale is running -if ! pgrep "Tailscale" > /dev/null; then - echo "Tailscale is not running. Starting Tailscale..." - open -a "/Applications/Tailscale.app" - # Wait for Tailscale to initialize - sleep 5 - $tailscale up -fi - -# Select a new exit node from the whitelist and set it -selected_exit_node=$($tailscale exit-node list | grep -f ~/.vpnwhitelist | awk '{print $2}' | shuf -n 1) -if [ -n "$selected_exit_node" ]; then - # Set the new exit node - $tailscale set --exit-node=$selected_exit_node -else - echo "No valid exit node found." - exit 1 -fi - diff --git a/ts-start b/ts-start deleted file mode 100755 index 248f21f..0000000 --- a/ts-start +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -export PATH=/opt/local/bin:/opt/local/sbin:/Users/sangye/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.11/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/ -sudo /opt/homebrew/bin/tailscaled --state=/var/lib/tailscale/tailscaled.state diff --git a/ts-tmux b/ts-tmux deleted file mode 100755 index ccefe2a..0000000 --- a/ts-tmux +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -export PATH=/opt/local/bin:/opt/local/sbin:/Users/sangye/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.11/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/Users/sangye/.local/bin -sudo tmux new-session -d -s tailscale 'ts-start' diff --git a/tts copy b/tts similarity index 100% rename from tts copy rename to tts diff --git a/txt-line-merge-abc b/txt-line-merge-abc old mode 100644 new mode 100755 diff --git a/update_calendar b/update_calendar deleted file mode 100755 index e517f85..0000000 --- a/update_calendar +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# Check if a date parameter is passed -if [ -z "$1" ]; then - echo "Usage: $0 " - exit 1 -fi - -DATE=$1 - -# Convert the date to a format that AppleScript expects (MM/DD/YYYY) -formatted_date=$(date -j -f "%Y-%m-%d" "$DATE" +"%A, %B %e, %Y at 00:00:00") - -osascript <