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
# Run this from the root directory of your project. It takes the list of outdated packages, skips the first row (since that will be | |
# the header row), and runs a loop on the package names that updates and saves them. | |
for i in $(npm outdated | awk 'FNR > 1 {print $1}'); do npm update --save $i; 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/sh | |
# Replace the website for your own, and you can extract all sitemap files from a parent sitemap file. | |
# | |
# Into their own individual sitemap section files: | |
number=1; | |
for i in $(curl https://website.com/sitemap.xml | sitemap-urls); | |
do curl -s -N $i | sitemap-urls > ~/Desktop/sitemap-output/map-$number.txt; | |
number=$(($number+1)); | |
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
To see the list before deleting: | |
find -E . -regex '.*\-[0-9]{1,4}\x[0-9]{1,4}\.(png|gif|jpg)$' > ./duplicates.txt | |
To delete: | |
find -E . -regex '.*\-[0-9]{1,4}\x[0-9]{1,4}\.(png|gif|jpg)$' -delete | |
Run a find/replace on your mysqldump backup (and create a backup of that) to remove references to alternate wordpress files: | |
sed -i .bak -E 's#\-[0-9]{1,4}\x[0-9]{1,4}##g' backup.sql | |
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
# Add the following to the bottom of /etc/ssh/sshd_config | |
# This makes it so any user with the group sftponly only has access to | |
# their chrooted home directory and forces internal-sftp. In this situation, | |
# we're going to make the home directory the chroot. We'll also | |
# comment out PasswordAuthentication so that we don't run into issues there. | |
# This setup will prevent shell access as long as you use the script over here: | |
# https://gist.github.com/hisnameisjimmy/a3cbc5c7c925ce8854afa350cb01cfe4 | |
# |
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 | |
# | |
# Use this guide for initial setup: | |
# https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04 | |
# | |
# Install fail2ban | |
# apt install fail2ban | |
# | |
# Disable Root Login | |
# sudo vim /etc/ssh/sshd_config |
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/sh | |
# | |
# This script stands on the shoulders of giants. | |
# | |
# You can always find the most recent version here: https://gist.github.com/hisnameisjimmy/56f9414076ca39a79bfa07eefa89759e | |
# | |
# It is written and tested for Ubuntu 16.04 on Digital Ocean using a 1GB droplet. | |
# Anything less than 1GB of memory may cause issues with anything memory intensive | |
# like imports/exports. | |
# |