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/env ruby | |
| # ___ | |
| # /\ \ | |
| # \ \ \ loginfortune | |
| # \ \ \ Created by redperadot@darkgem.net | |
| # _____\_\ \ ___________ | |
| # /\ _____ \/\ _____ \ | |
| # \ \ \___/\ \ \ \___/\ \ If you're running OS X and are tired of your boring | |
| # \ \ \__\_\ \ \ \__\_\ \ lock screen message this is the script for you! | |
| # \ \__________\ \________ \ Using the fortune command this script will change |
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/env bash | |
| # redperadot@darkgem.net | |
| # plex_list.sh | |
| [[ $(uname) != "Darwin" ]] && echo "OS X Only" && exit 1 | |
| cd /Users/redperadot/Library/Application\ Support/Plex\ Media\ Server/Metadata/Movies | |
| for file in $(find ./ -name '*.bundle'); do | |
| file=$(echo "$file" | rev | cut -c 1- | rev) | |
| title=$(cat "$file/Contents/com.plexapp.agents.localmedia/info.xml" | grep "<title>" | sed -e 's,.*<title>\([^<]*\)</title>.*,\1,g') | |
| echo "$title" |
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/env bash | |
| # redperadot@darkgem.net | |
| # host_down.sh | |
| [[ $1 == "-a" ]] && audible='\a' && shift || audible= | |
| address_1=$1 | |
| address_2=$2 | |
| [[ -z $address_1 ]] && read -p "Address #1 to ping: " address_1 | |
| [[ -z $address_2 ]] && read -p "Address #2 to ping: " address_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
| #!/usr/bin/env bash | |
| # | |
| # mac_vendor.sh - Get the vendor for a mac address from the terminal. | |
| # Made with ❤︎ by redperadot@darkgem.net | |
| # Set Functions | |
| usage() | |
| { | |
| echo "MAC Vendor Help" | |
| echo "mac_vendor -a 'MAC Address' | Get the vendor of the specified address." |
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/env ruby | |
| # | |
| # raffle.rb - Raffle off items with ruby. Version 0.2 | |
| # Made with ❤︎ by redperadot@darkgem.net | |
| # | |
| # To use cd into a directory with a 'tickets.txt' | |
| # file and a 'items.txt' file. Then just run the | |
| # script. Items in the files should be separated | |
| # by new lines. |
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 | |
| [[ $(uname) != "Darwin" ]] && echo "OS X Only" && exit 1 | |
| sudo -v | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \ | |
| | while read i; do | |
| sudo rm /usr/local/${i} | |
| 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
| #!/usr/bin/env ruby | |
| require 'uri' | |
| pb = ( (/darwin/ =~ RUBY_PLATFORM) != nil ? true : false ) | |
| ## Get Options | |
| if ARGV[0] == "-h" | |
| puts "#{$0} -e [STRING] (Encode String)" | |
| puts "#{$0} -d [STRING] (Decode String)" | |
| exit 0 | |
| end |
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/env ruby | |
| require 'etc' | |
| def as_user(user = Etc.getlogin, &block) | |
| u = (user.is_a? Integer) ? Etc.getpwuid(user) : Etc.getpwnam(user) | |
| puts "Running child process as the user #{user}(#{u.uid})." | |
| pid = Process.fork do | |
| Process.uid = u.uid | |
| block.call(user) | |
| end |
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/env ruby | |
| # | |
| # grsp.rb - Get remote OS X system profile. Version 0.1 | |
| # Made with ❤︎ by redperadot@darkgem.net | |
| require 'optparse' | |
| require 'io/console' | |
| require 'net/ssh' | |
| Signal.trap("INT") { puts; exit 0 } |
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/env ruby | |
| # | |
| # auto-ssh.rb - Setup SSH login without a password. | |
| # Made with ❤︎ by redperadot@darkgem.net | |
| ## Gem Installer | |
| def require_gems(*gems) | |
| gems.each do |_gem| | |
| begin require _gem | |
| rescue LoadError |
OlderNewer