This file contains 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 | |
if [ "$#" -lt 2 ]; then | |
echo "./`basename $0` <write url here> <write your site directory here> [second] [\"title\"] [\"html code or txt\"]"; | |
exit 1; | |
fi | |
url=$1 | |
directory=$2 | |
if [ "$#" -gt 1 ]; then |
This file contains 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 | |
#Written by @keraattin | |
CURRENT_DATE=$(date +"%Y-%m-%d") | |
CREATE_TODAY_FILE=$(touch /tmp/today_banned.txt) | |
TODAY_BANNED=$(cat /var/log/fail2ban.log | grep $CURRENT_DATE | grep Ban | gawk '{print $8}' >> /tmp/today_banned.txt) | |
COUNT=$(sort /tmp/today_banned.txt | uniq -c) |
This file contains 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 | |
# a little update to: https://gist.github.com/rosiba/d9c06fe15a661094d4da4565355225a8 | |
# | |
# define replacements | |
declare -a repls=( | |
"Ğg" | |
"ğg" | |
"Çc" |
This file contains 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 | |
# | |
# Change the PDF title. | |
function guide() { | |
echo -e "usage: `basename $0` \"PDF Title\" \"Author Name\" pdfFileName.pdf"; | |
exit 1; | |
} | |
This file contains 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 | |
#add code to hugo project dir. | |
find static/images/uploads/ \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) -print0 | xargs -0 -P8 -n2 mogrify -strip -thumbnail '1000>' -format jpg |
This file contains 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 | |
function one() { | |
echo "one > $1" | |
} | |
function two() { | |
echo "two > $1" | |
} |
This file contains 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 | |
cd /root/cf | |
curl https://www.cloudflare.com/ips-v4 > ips-v4 | |
curl https://www.cloudflare.com/ips-v6 > ips-v6 | |
for i in `<ips-v4`; do ufw allow from $i proto tcp to any port 80,443; done | |
for i in `<ips-v6`; do ufw allow from $i proto tcp to any port 80,443; done |
This file contains 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 | |
if [ "$#" -lt 4 ]; then | |
echo "`basename $0` <db name> <db user> <ip> <db password> [sql]"; | |
exit 1; | |
fi | |
mysql <<EOF | |
CREATE DATABASE $1; | |
CREATE USER $2@localhost IDENTIFIED BY '$4'; | |
GRANT ALL PRIVILEGES ON $1.* TO $2@localhost identified by '$4'; | |
CREATE USER $2@$3 IDENTIFIED BY '$4'; |
This file contains 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 -ex | |
if [ "$#" -lt 2 ]; then | |
echo "`basename $0` <site> <wp.zip>"; | |
exit 1; | |
fi | |
SITE=$1 | |
WPZIP=$PWD/$2 | |
cd /var/www/$SITE/public_html |
This file contains 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 | |
if [ "$#" -lt 1 ]; then | |
echo "`basename $0` <8-92>"; | |
exit 1; | |
fi | |
PASS=`date +%s | sha256sum | base64 | head -c $1` | |
echo "$PASS"; |
OlderNewer