This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# =========================================================================== | |
# File Combiner - Combines multiple files into a single file with path headers | |
# =========================================================================== | |
# | |
# Description: | |
# This script recursively combines files from a directory into a single file, | |
# adding the file path as a comment before each file's content. Useful for | |
# preparing codebases for AI analysis or documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if API key is provided | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <VULTR_API_KEY>" | |
exit 1 | |
fi | |
# Vultr API key from command-line argument | |
VULTR_API_KEY="$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(sudo -u www-data wp site list --field=url); \ | |
do | |
echo ${i}; \ | |
a="$(sudo -u www-data wp user list --url=${i} --role=SuperUser --field=user_login)"; \ | |
if [[ ! -z "${a}" ]]; then \ | |
sudo -u www-data wp user --url="${i}" update "${a}" --role "administrator"; \ | |
echo "User ${a} updated for site ${i}."; \ | |
fi; \ | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo file -s /dev/xvd* | |
/dev/xvda: DOS/MBR boot sector | |
/dev/xvda1: Linux rev 1.0 ext4 filesystem data, UUID=651cda91-e465-4685-b697-67aa07181279, volume name "cloudimg-rootfs" (needs journal recovery) (extents) (64bit) (large files) (huge files) | |
sudo growpart /dev/xvda 1 | |
sudo resize2fs /dev/xvda1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pat='([0-9]{2}/[0-9]{2}/[0-9]{2}).(.*)\ (-?[0-9,]+\.[0-9]{2})' | |
while IFS= read -r line; do | |
[[ $line =~ $pat ]] && | |
echo "${BASH_REMATCH[1]}|${BASH_REMATCH[2]}|${BASH_REMATCH[3]}" | |
done <file.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOKEN="" | |
REPO="" # format: username/repository | |
EVENT_TYPE="" | |
curl -H "Accept: application/vnd.github.everest-preview+json" \ | |
-H "Authorization: token ${TOKEN}" \ | |
--request POST \ | |
--data '{"event_type": "${EVENT_TYPE}"}' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find includes that start with escape character | |
grep -R '@include \"\\' | |
# Find files that end with ico and have a random 8 character filename. | |
find . | egrep "\.[0-9a-z]{8}.ico" | |
# Find files with ico code include injected at the top. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(find ./wp-content/plugins -maxdepth 1 ! -path . -type d) | |
do | |
sudo mv ${i} ${i}.old | |
echo "Disabled ${i}" | |
read -p "Press enter to continue" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker inspect -f "{{.Path}} {{.Args}} ({{.Id}})" $(docker ps -a -q) | |
Source: https://stackoverflow.com/questions/30441035/how-to-find-the-cmd-command-of-a-docker-image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# (c) Wolfgang Ziegler // fago | |
# | |
# Inotify script to trigger a command on file changes. | |
# | |
# The script triggers the command as soon as a file event occurs. Events | |
# occurring during command execution are aggregated and trigger a single command | |
# execution only. | |
# | |
# Usage example: Trigger rsync for synchronizing file changes. |
NewerOlder