Skip to main content

Symlink Desktop

0 likes • Nov 18, 2022 • 0 views
Shell
Loading...

More Shell Posts

getDependencies.sh

0 likes • Oct 30, 2020 • 2 views
Shell
#!/bin/bash
#getDependencies.sh by Leif Messinger
grep -Po '#include\s*"\K.+(?=")' | while read -r line ; do
echo -n " $line"
./getDependencies.sh < $line
done

Delete Git Branches

0 likes • Mar 10, 2023 • 0 views
Shell
#!/bin/bash
for branch in $(git branch | cut -c 3-); do
read -p "Delete local branch $branch? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
git branch -D $branch
fi
done

githubSetSSH.sh

0 likes • Sep 9, 2023 • 2 views
Shell
#!/bin/bash
#Changes the remote url from https to ssh.
#Only works for github, because I'd have to store a dictionary of every https to ssh url otherwise.
#Made using Bing Chat
# Get the remote URL from the console
REPO_URL=$(git config --get remote.origin.url)
# Check that REPO_URL contains https://github.com
if [[ $REPO_URL == *"https://github.com"* ]]; then
# Replace https with ssh in the URL
REPO_URL=${REPO_URL/https:\/\/github.com\//[email protected]:}
# Change the remote URL to the SSH version
git remote set-url origin "$REPO_URL"
else
echo "Error: REPO_URL does not contain https://github.com" >&2
exit 1
fi

upload_key.sh

0 likes • Jan 12, 2023 • 0 views
Shell
#!/bin/bash
#Originally made by Isaac Cook https://gist.github.com/icook/5400173
#Modified by Leif Messinger
#upload_key.sh [server_ip [server2_ip [...]]]
#To be run locally on a linux computer
if [ -e ~/.ssh/id_rsa.pub ];
then
echo "SSH Key already exists on local machine"
else
echo "Generating SSH key on local machine"
ssh-keygen -t rsa #generates id_rsa and id_rsa.pub
chmod -R 700 ~/.ssh #Sets permissions of ssh folder
ssh-add #Adds keys (and passwords?) to ssh_agent. (hopefully doesn't require password)
fi
echo "Loading client public key into memory"
pubKey=$(<~/.ssh/id_rsa.pub)
for server
do
echo "Adding client public key to $server remote server authorized keys"
#Idiot Isaac Cook didn't know about ssh-copy-id
#ssh-copy-id even checks if your key already exists
#In fairness, I didn't either until researching ssh-add
ssh-copy-id -i ~/.ssh/id_rsa.pub $server #In theory, this should prompt for a username
#ssh $server "mkdir -p ~/.ssh; #Make the folder if not already made
# echo \"$pubKey\" >> ~/.ssh/authorized_keys; #Append your public key to the server's authorized_keys
# chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" #Set the correct permissions of those files
#echo "Adding server public key to local authorized keys"
#ssh $server "ssh-copy-id -i ~/.ssh/id_rsa.pub \$SSH_CLIENT" #this might need some awk, as $SSH_CLIENT spits out clientip portnumber
echo "Displaying server public key"
ssh $server "cat ~/.ssh/id_rsa.pub"
#Though, he did give me a good idea
echo "Displaying keys authorized on $server (you can paste them in your authorized_keys file)"
ssh $server "cat ~/.ssh/authorized_keys"
#echo "Appending keys authorized on $server to your local authorized_keys"
#ssh $server "cat ~/.ssh/authorized_keys" >> ~/.ssh/authorized_keys
done
echo "SSH keys schronized successfully!"

abuseipdb config

0 likes • Nov 18, 2022 • 0 views
Shell
#for ssh abuse attempts
action = %(action_)s
%(action_abuseipdb)s[abuseipdb_apikey="", abuseipdb_category="18,22"]
actionban = curl --fail --ciphers ecdhe_ecdsa_aes_256_sha --data 'key=<abuseipdb_apikey>' --data-urlencode 'comment=<matches>' --data 'ip=<ip>' --data 'category=<abuseipdb_category>' "https://www.abuseipdb.com/report/json"

installVulkanUbuntu.sh

0 likes • Jul 16, 2023 • 2 views
Shell
#!/bin/bash
sudo apt install build-essential vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools libglfw3-dev libglm-dev libtinyobjloader-dev
#The rest of this downloads the Vulkan Tutorial project and its dependencies.
#Comment this out to keep going
exit
sudo apt install git cmake cmake-gui
sudo mkdir /usr/lib/stb
pushd /usr/lib/stb
sudo wget https://raw.githubusercontent.com/nothings/stb/master/stb_image.h
popd
cd ~/Documents
git clone https://github.com/Overv/VulkanTutorial.git
cd VulkanTutorial/code
cmake -S . -B build -DCMAKE_INSTALL_PREFIX:PATH="/usr/local" -DSTB_INCLUDEDIR:PATH="/usr/lib/stb"
cd build
make