R Script Fix
This commit is contained in:
20
.zsh_aliases
20
.zsh_aliases
@@ -72,3 +72,23 @@ if grep -qEi "(Microsoft|WSL)" /proc/version &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
alias local-stt="python ~/Application/STT/stt.py"
|
||||||
|
|
||||||
|
# Vault
|
||||||
|
alias vl="vault login -method=userpass username=mangopig"
|
||||||
|
alias vs="vault status"
|
||||||
|
alias vkv="vault kv get"
|
||||||
|
alias vkvl="vault kv list"
|
||||||
|
|
||||||
|
# Proxy
|
||||||
|
proxy_on() {
|
||||||
|
export ALL_PROXY=socks5h://192.168.1.26:1080
|
||||||
|
export HTTP_PROXY=socks5h://192.168.1.26:1080
|
||||||
|
export HTTPS_PROXY=socks5h://192.168.1.26:1080
|
||||||
|
echo "Proxy ON (Mullvad NL)"
|
||||||
|
}
|
||||||
|
proxy_off() {
|
||||||
|
unset ALL_PROXY HTTP_PROXY HTTPS_PROXY
|
||||||
|
echo "Proxy OFF (direct)"
|
||||||
|
}
|
||||||
14
.zshenv
14
.zshenv
@@ -1 +1,15 @@
|
|||||||
# ENV File
|
# ENV File
|
||||||
|
|
||||||
|
export GOGC=500
|
||||||
|
|
||||||
|
# CodeGraphContext defaults
|
||||||
|
export CGC_RUNTIME_DB_TYPE=kuzudb
|
||||||
|
export KUZUDB_PATH="$HOME/.codegraphcontext/kuzudb"
|
||||||
|
|
||||||
|
export PATH=/home/mangopig/.opencode/bin:$PATH
|
||||||
|
export OPENCHAMBER_HOST=0.0.0.0
|
||||||
|
export AZURE_COGNITIVE_SERVICES_RESOURCE_NAME="$AZURE_URL"
|
||||||
|
export VAULT_ADDR="http://192.168.30.53:8200"
|
||||||
|
export OPENCHAMBER_UI_PASSWORD="$VM_SUDO_PASS"
|
||||||
|
export AZURE_RESOURCE_NAME="$AZURE_URL"
|
||||||
|
export PLANNOTATOR_PORT=9999
|
||||||
8
.zshrc
8
.zshrc
@@ -66,3 +66,11 @@ eval "$(zoxide init --cmd cd zsh)"
|
|||||||
# Add to PATH
|
# Add to PATH
|
||||||
export PATH="$HOME/.local/bin:$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.local/bin:$CARGO_HOME/bin:$PATH"
|
||||||
export PATH="$GOPATH/bin:$PATH"
|
export PATH="$GOPATH/bin:$PATH"
|
||||||
|
|
||||||
|
# opencode
|
||||||
|
if ! pgrep -f "openchamber.*7891" > /dev/null; then
|
||||||
|
openchamber --port 7891 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
|||||||
@@ -16,3 +16,7 @@ sudo chown -R $USER:$USER /mnt/nvme
|
|||||||
echo "NVMe mounted at /mnt/nvme"
|
echo "NVMe mounted at /mnt/nvme"
|
||||||
|
|
||||||
df -h /mnt/nvme
|
df -h /mnt/nvme
|
||||||
|
|
||||||
|
# rclone sync -P --transfers=16 hetzner-box:models/Qwen3-30B-A3B-Instruct-2507 /mnt/nvme/Qwen3-30B-A3B-Instruct-2507
|
||||||
|
|
||||||
|
# rclone sync -P --transfers=16 /mnt/nvme/Qwen3-70B-Instruct-2024-12-04 hetzner-box:models/Qwen3-70B-Instruct-2024-12-04
|
||||||
48
scripts/r.sh
48
scripts/r.sh
@@ -32,45 +32,43 @@ elif [ "$OS" == "ubuntu" ] || [ "$OS" == "debian" ]; then
|
|||||||
|
|
||||||
echo -e "${BLUE} LOG:${YELLOW} Installing Debian build dependencies...${NC}"
|
echo -e "${BLUE} LOG:${YELLOW} Installing Debian build dependencies...${NC}"
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get update
|
sudo DEBIAN_FRONTEND=noninteractive apt-get update
|
||||||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gfortran curl tar
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gfortran curl tar ca-certificates
|
||||||
|
|
||||||
export RIG_HOME="$HOME/.programming/r"
|
if ! command -v rig >/dev/null 2>&1; then
|
||||||
export RIG_BIN="$RIG_HOME/bin"
|
echo -e "${BLUE} LOG:${YELLOW} Installing Rig for Debian/Ubuntu...${NC}"
|
||||||
export PATH="$RIG_BIN:$PATH"
|
|
||||||
|
|
||||||
if [ ! -f "$RIG_BIN/rig" ]; then
|
DEB_ARCH=$(dpkg --print-architecture)
|
||||||
echo -e "${BLUE} LOG:${YELLOW} Downloading Rig binary...${NC}"
|
case "$DEB_ARCH" in
|
||||||
mkdir -p "$RIG_BIN"
|
amd64|arm64)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "${RED} ERROR:${NC} Unsupported Debian architecture for Rig: $DEB_ARCH"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
LATEST_REL_DATA=$(curl -s https://api.github.com/repos/r-lib/rig/releases/latest)
|
LATEST_REL_DATA=$(curl -fsSL https://api.github.com/repos/r-lib/rig/releases/latest)
|
||||||
RIG_URL=$(echo "$LATEST_REL_DATA" | grep -o 'https://[^"]*rig-linux-[^"]*\.tar\.gz' | head -n 1)
|
RIG_URL=$(echo "$LATEST_REL_DATA" | grep -o "https://[^\"]*r-rig_[^\"]*_${DEB_ARCH}\.deb" | head -n 1)
|
||||||
|
|
||||||
if [ -z "$RIG_URL" ]; then
|
if [ -z "$RIG_URL" ]; then
|
||||||
echo -e "${RED} ERROR:${NC} Could not find Rig download URL."
|
echo -e "${RED} ERROR:${NC} Could not find Rig .deb download URL for architecture: $DEB_ARCH"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TEMP_EXTRACT=$(mktemp -d)
|
TEMP_DEB=$(mktemp --suffix=.deb)
|
||||||
curl -L -s "$RIG_URL" | tar -xz -C "$TEMP_EXTRACT"
|
curl -fLsS "$RIG_URL" -o "$TEMP_DEB"
|
||||||
FOUND_BIN=$(find "$TEMP_EXTRACT" -name "rig" -type f | head -n 1)
|
sudo apt-get install -y "$TEMP_DEB"
|
||||||
|
rm -f "$TEMP_DEB"
|
||||||
if [ -f "$FOUND_BIN" ]; then
|
|
||||||
mv "$FOUND_BIN" "$RIG_BIN/rig"
|
|
||||||
chmod +x "$RIG_BIN/rig"
|
|
||||||
else
|
|
||||||
rm -rf "$TEMP_EXTRACT"; exit 1
|
|
||||||
fi
|
|
||||||
rm -rf "$TEMP_EXTRACT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TARGET_VER="release"
|
TARGET_VER="release"
|
||||||
if ! "$RIG_BIN/rig" list | grep -q "release"; then
|
if ! rig list | grep -q "release"; then
|
||||||
echo -e "${BLUE} LOG:${YELLOW} Installing R (${TARGET_VER})...${NC}"
|
echo -e "${BLUE} LOG:${YELLOW} Installing R (${TARGET_VER})...${NC}"
|
||||||
sudo "$RIG_BIN/rig" add "$TARGET_VER" --without-cran-mirror
|
sudo rig add "$TARGET_VER" --without-cran-mirror
|
||||||
sudo "$RIG_BIN/rig" default "$TARGET_VER"
|
sudo rig default "$TARGET_VER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
R_BIN="$RIG_BIN/rig run"
|
R_BIN="rig run"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${BLUE} LOG:${YELLOW} Installing 'renv' package globally...${NC}"
|
echo -e "${BLUE} LOG:${YELLOW} Installing 'renv' package globally...${NC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user