• Mar 20, 2023 •C S
0 likes • 0 views
// check version node -v || node --version // list installed versions of node (via nvm) nvm ls // install specific version of node nvm install 6.9.2 // set default version of node nvm alias default 6.9.2 // switch version of node nvm use 6.9.1
• Sep 9, 2023 •LeifMessinger
0 likes • 3 views
#!/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
• Sep 23, 2024 •AustinLeath
0 likes • 6 views
CLIENT_VPN_ID="cvpn-endpoint-xxxxxxxxxxxx" for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); do echo "Searching in region: $region" aws ec2 describe-client-vpn-endpoints --region $region --query "ClientVpnEndpoints[?ClientVpnEndpointId=='$CLIENT_VPN_ID']" --output table done
• Sep 29, 2021 •LeifMessinger
0 likes • 29 views
#!/bin/bash #cpcmd.sh [file1 [file2...]] #Prints out the commands needed to copy the file to your local machine #This will work on any server that also has the same hostname as in your hosts file. #I should update this to detect if a file is a directory, and enable recursion for those commands. If you do it now, it will probably just warn you. if [ -n "$1" ]; then for arg; do recursive=$(if [[ -d $arg ]]; then printf " -r"; fi) printf "scp$recursive \"$(whoami)@$(hostname):" printf `readlink -f $arg` printf "\" .\n" done else echo "scp \"$(whoami)@$(hostname):$PWD/*\" ." fi #-----------EDIT: #On the UNT cell machines, you have to do this script instead ##!/bin/bash #if [ -n "$1" ]; then # for arg; do # recursive=$(if [[ -d $arg ]]; then printf " -r"; fi) # printf "scp$recursive $(whoami)@$(hostname).eng.unt.edu:" # printf `readlink -f $arg` # printf " .\n" # done #else # echo "scp $(whoami)@$(hostname).eng.unt.edu:$PWD/* ." #fi
• Nov 23, 2021 •LeifMessinger
#!/bin/bash #Makes a directory ./monkeys and puts every single bored bored ape yacht club monkey in there #Leif Messinger let OFFSET=0 let BATCHSIZE=50 let LIMIT=100 mkdir monkeys function parseResults(){ sed 'y/,/\n/' | sed -e '/storage.opensea/d' -e '/https:\/\/lh3.googleusercontent.com\/Ju9CkWtV-1Okvf45wo8UctR-M9He2PjILP0oOvxE89AyiPPGtrR3gysu1Zgy0hjd2xKIgjJJtWIc0ybj4Vd7wv8t3pxDGHoJBzDB=s120/d' | egrep '"image_url":"(.*)"' | tr -d '\"' | sed 's/image_url://' } function downloadMonkeys(){ while read -r line; do name=`echo "$line" | sed 's/https:\/\/lh3.googleusercontent.com\///'` wget -q -O "./monkeys/$name.png" "$line" & done } function queryMonkeys(){ let progress=($OFFSET*100)/$LIMIT echo "Progress: $progress%" result=`curl -s --request GET --url "https://api.opensea.io/api/v1/assets?order_direction=desc&offset=$OFFSET&limit=$BATCHSIZE&collection=boredapeyachtclub"` if [[ "$result" =~ "Request was throttled" ]] || [ "$result" == "" ]; then #Retry download sleep 10 else #Download Monkeys echo "$result" | parseResults | downloadMonkeys let OFFSET+=$BATCHSIZE fi #If not out of bounds, recurse if [ "$OFFSET" -lt "$LIMIT" ] || [[ "$result" =~ '"assets":[]' ]]; then queryMonkeys fi } echo "Downloading your monkeys into ./monkeys asynchronously." queryMonkeys
• Nov 18, 2022 •AustinLeath
0 likes • 9 views
#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"