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 | |
RETRIES=3 | |
SLEEP=60 | |
TEST_HOST="google.com" | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi |
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 python3 | |
import sys | |
import textwrap | |
if len(sys.argv) != 2: | |
print("Usage: {} <.hcmask>".format(sys.argv[0])) | |
exit(1) | |
with open(sys.argv[1], "r") as f: |
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 python3 | |
import sys | |
import shutil | |
from functools import reduce | |
from bisect import insort | |
try: | |
from os import scandir, walk | |
except ImportError: |
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
extension Optional { | |
func someAnd(_ closure: (Wrapped) -> Bool) -> Bool { | |
if case .some(let v) = self, closure(v) == true { return true } | |
return false | |
} | |
func noneOr(_ closure: (Wrapped) -> Bool) -> Bool { | |
switch self { | |
case .some(let v): | |
return closure(v) |
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/swift | |
import Foundation | |
var keepAlive = true | |
dump(ProcessInfo().arguments) | |
let runLoop = RunLoop.current | |
let distantFuture = Date.distantFuture |
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 python | |
import sys | |
import os | |
from functools import reduce | |
def sized(source, size): | |
m = {} | |
def fileSize(root, path): |
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 | |
# downloads all missing trailers - it goes through all your movies and matchs them up with an entry | |
# in plex, grabs the imdb id from plex, and then parses the trailer url from the imdb site, then passes | |
# that to youtube-dl to download the trailer, it skips entries that dont have a matching imdb entry | |
# or if the trailer already exists | |
# must have 'sqlite3' and 'youtube-dl' packages (apt-get install sqlite3 youtube-dl) | |
# set 'mpath' and 'pms' accordingly | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <media path>" |
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/ruby | |
require 'fileutils' | |
require 'optparse' | |
xcodePath = %x{xcode-select -print-path} | |
puts "Checking simulator devices against Xcode: #{xcodePath}" | |
options = {} | |
OptionParser.new do |opts| |
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
PLIST=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Info.plist | |
OFFSET=300 | |
COUNT=$(expr $(git rev-list HEAD --count) + $OFFSET) | |
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $COUNT" "$PLIST" |
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 [ "${CONFIGURATION}" == "Debug" ]; then | |
/usr/libexec/PlistBuddy -c "Set NSAppTransportSecurity:NSAllowsArbitraryLoads true" ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Info.plist | |
fi |
NewerOlder