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
| #!/usr/bin/python | |
| # Simple script to turn off roku. Send it an ip address of your roku and it'll turn it off. | |
| # This script is so green and earth friendly it basically refrigerates the polar ice caps. | |
| # Schedule this with cron to turn your roku and most likely TV off. | |
| # | |
| # crontab -e | |
| # ex. shut off my roku at 8 am every day if roku is on 192.168.1.2 | |
| # 0 8 * * * ./rokuoff.py 192.168.1.2 |
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
| If you are considering making a network change and don't want to risk a down machine that you would then have to console into... here's what to do. | |
| 1. Copy your working network configuration | |
| cp /etc/network/interfaces /etc/network/interfaces.working.bak | |
| 2. Make your changes to the network connection | |
| cat /etc/network/interfaces.withchanges > /etc/network/interfaces | |
| 3. Create a script to undo the change | |
| vi /root/reset_net.sh |
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 | |
| # run this as root | |
| # This is basically stolen from digital ocean's guide, just made to be a bit more automated. | |
| # This will install and configure fail2ban for a centos7 system using firewalld. | |
| # No iptables were injured in the making of this gist. | |
| # Install fail2ban. | |
| yum -y install epel-release |
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 | |
| ########################################################################################################################## | |
| # This will update plex libraries manually from the command line. # | |
| # This will work on centos 7 but I can't make any guarantees about other OSes or platforms. # | |
| # If you're running plex on mac os x or windows, get a real OS. # | |
| # # | |
| # The exports below are important because if you don't have all of them set, you will get no result when you go to list # | |
| # ./Plex\ Media\ Scanner --list # | |
| # This will show you all of your libraries and their numbers. # |
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 | |
| ########################################################################################################################## | |
| # This is a template for a script that only runs when it's not already running. The first thing this will do is to check # | |
| # to make sure that it is not running. # | |
| # # | |
| # Then this script will check to see if the latest file it has processed is its 'touched' file which is compares the MAC # | |
| # times to ensure it only runs if there is work to be done. # | |
| # # | |
| # The idea is that you should schedule this in a cron job. Here is my example of how I scheduled my script. # |