• Nov 4, 2023 •LeifMessinger
0 likes • 7 views
#!/bin/bash git status echo "Do you want to add all changed files?" select yn in "Yes" "No"; do case $yn in Yes ) break;; No ) exit 1;; esac done git add -u git status echo "Does this look right?" select yn in "Yes" "No"; do case $yn in Yes ) break;; No ) exit 2;; esac done git commit echo "Do you want to push?" select yn in "Yes" "No"; do case $yn in Yes ) break;; No ) exit 2;; esac done git push
• 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"
• Jul 8, 2024 •C S
0 likes • 17 views
#!/bin/bash # Set the directory to search DIRECTORY="src" # Set the output file OUTPUT_FILE="testids.txt" # Clear the output file > "$OUTPUT_FILE" # Find all .tsx files in the specified directory and its subdirectories find "$DIRECTORY" -type f -name "*.tsx" | while read -r FILE do # Search for instances of 'data-testid="testid"' and append them to the output file grep -o 'data-testid="[^"]*"' "$FILE" >> "$OUTPUT_FILE" # Search for instances of "'data-testid': 'testid'" and append them to the output file grep -o "'data-testid': '[^']*'" "$FILE" >> "$OUTPUT_FILE" done echo "Search complete. Test IDs written to $OUTPUT_FILE."
• May 13, 2023 •LeifMessinger
0 likes • 8 views
#!/bin/bash # Turns 4 spaces into tabs. # Mostly stolen from AI # Define the directory to process DIRECTORY=$1 TabCount=${2:-'4'} #Defaults to 4 # Check if directory is specified if [ -z "$DIRECTORY" ]; then echo "Error: Directory not specified." exit 1 fi # Check if directory exists if [ ! -d "$DIRECTORY" ]; then echo "Error: Directory does not exist." exit 1 fi # Find all files in directory and subdirectories FILES=$(find "$DIRECTORY" -type f) # Loop through each file and unexpand it for FILE in $FILES; do unexpand -t "$TabCount" "$FILE" > "$FILE.tmp" mv "$FILE.tmp" "$FILE" done echo "Done!"
0 likes • 1 view
# # Austin Leath # checks for /Desktop symlink. Creates the symlink if it doesnt already exist # #Fetch the target user if desired, otherwise use the currently logged in user. if [ "$4" != "" ]; then TARGET_USER=$4 else TARGET_USER=$3 fi if [ "$5" != "" ]; then DIRECTORY_NAME=$5 else TARGET_USER="$3 Desktop" fi # Functions CHECK_SYMLINK() { if test -f "/Desktop"; then echo "/Desktop exists" else echo "/Desktop does not exist" fi } CHECK_SYNTHETIC_CONF() { if test -f "/etc/synthetic.conf"; then echo "/etc/synthetic.conf exists" else echo "/etc/synthetic.conf does not exist" fi } CREATE_SYMLINK() { if [[ $(CHECK_SYNTHETIC_CONF) != "/etc/synthetic.conf exists" ]]; then echo "/etc/synthetic.conf does not exist. creating.." touch /etc/synthetic.conf chown -R root:wheel /etc/synthetic.conf fi if grep -q "$DIRECTORY_NAME" /etc/synthetic.conf; then echo "$DIRECTORY_NAME already exists" exit 1 else echo "$DIRECTORY_NAME\t/Users/$TARGET_USER/Desktop" >> /etc/synthetic.conf fi echo "/Desktop symbolic link created" } if [[ $(CHECK_SYMLINK) != "/Desktop exists" ]]; then CREATE_SYMLINK fi exit 0
• Sep 30, 2021 •LeifMessinger
touch /tmp/login1.txt /tmp/login2.txt while [ true ] do who | gawk '{ print $1 }' > /tmp/login2.txt comm -13 /tmp/login1.txt /tmp/login2.txt #Just a bit easier to read #diff /tmp/login1.txt /tmp/login2.txt cat /tmp/login2.txt > /tmp/login1.txt sleep 1 done