Compare commits

..

3 Commits

Author SHA1 Message Date
825a159c3e m 2025-07-09 10:33:35 +03:00
55293daf81 m 2025-07-09 10:29:28 +03:00
4ef3a5e102 Merge branch 'main' of https://git.galoz.site/galoz/proxy 2025-06-30 19:30:42 +03:00
3 changed files with 48 additions and 1 deletions

View File

@@ -10,4 +10,4 @@ bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads
example:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/code_server.sh)"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/galoz11/proxy/refs/heads/main/docker_portainer.sh)"
bash -c "$(curl -fsSL https://git.galoz.site/galoz/proxy/raw/branch/main/set_ps1.sh)"

23
pct_public_key.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Define the public key to add
PUBLIC_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb2LEZS8zM3Pd2irwMOmrMhUB6ZMcIwyC0aWJIqTVIQVxEm3FIgN8ugJDqyv9vE6efwrAmbTxwi/bcXqKbo+ci2CRBrryvSzZDBsBMQYbDc3zervduLt9MQSjOHKxHlBH73G7qs0cyXBroO+Rpe+5t0WtJkR5MPNQf7+s07Y83viBF31oh5a3rGYvbxaLd0hOW622o/2/thVQS9Q1FlMtILA9Hn5PAWp/LZcTzFnqeVbstznzBvSmjfvvLxF9Ujeldm2cPUD8OXKjfMX4K5gGaGp+p8vI5rijUTdX1Yj7iKAM+NGXpjh90o4PCRfOSW5mP2mf31jhsFRJRxiKxPZAJ rsa-key-20250707" # <--- REPLACE THIS WITH YOUR ACTUAL PUBLIC KEY
# Define file paths
SSH_DIR="$HOME/.ssh"
AUTHORIZED_KEYS_FILE="$SSH_DIR/authorized_keys"
# Create .ssh directory and set permissions if it doesn't exist
mkdir -p "$SSH_DIR" && chmod 700 "$SSH_DIR" || { echo "Error: Could not create or set permissions for $SSH_DIR. Exiting."; exit 1; }
# Create authorized_keys file and set permissions if it doesn't exist
touch "$AUTHORIZED_KEYS_FILE" && chmod 600 "$AUTHORIZED_KEYS_FILE" || { echo "Error: Could not create or set permissions for $AUTHORIZED_KEYS_FILE. Exiting."; exit 1; }
# Check if the key already exists to prevent duplicates
if grep -qF "$PUBLIC_KEY" "$AUTHORIZED_KEYS_FILE"; then
echo "Key already exists in $AUTHORIZED_KEYS_FILE. No changes made."
else
# Add the key
echo "$PUBLIC_KEY" >> "$AUTHORIZED_KEYS_FILE"
echo "Key successfully added to $AUTHORIZED_KEYS_FILE."
fi

24
set_ps1.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Define the new PS1 string
# Example: [User@Host CurrentDir]$
# This example uses colors: green for user@host, blue for directory.
# \u: username
# \h: hostname (short)
# \w: current working directory (basename only)
# \$: # if root, $ otherwise
NEW_PS1='\[\e[1m\]\[\e[90m\]0\[\e[0;32m\]\u@\[\e[36m\]\h\[\e[90m\]:\[\e[33m\]\w\[\e[90m\]$ \[\e[m\]'
# The line to be added to .bashrc
PS1_LINE="PS1='${NEW_PS1}'"
# Check if the line already exists in .bashrc to prevent duplicates
if grep -qE "^PS1=" ~/.bashrc; then
echo "PS1 setting already exists in ~/.bashrc. No changes made."
else
# Append the PS1 line to .bashrc
echo -e "\n" >> ~/.bashrc # Ensure there's a newline before adding
echo "${PS1_LINE}" >> ~/.bashrc
echo "PS1 setting has been added to ~/.bashrc."
echo "Please open a new terminal or run 'source ~/.bashrc' for changes to take effect."
fi