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
import random | |
card_colors=['red','black','blue','green','white'] | |
op_hp = 20 | |
player_hp = 20 | |
while op_hp >0 and player_hp >0: | |
run_or_attack = input('Do you want to run (run) or use a magic card (use)?') | |
if run_or_attack == 'run': | |
random_run = random.random() | |
if random_run > .3: | |
print ('You run away from the battle.') |
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 | |
curl -s -u myuser:mypassword https://myserver.jamfcloud.com/JSSResource/computers | sed -n -e 's/.*<size>\(.*\)<\/size>.*/\1/p' curl -s -u myuser:mypassword https://myserver.jamfcloud.com/JSSResource/mobiledevices | sed -n -e 's/.*<size>\(.*\)<\/size>.*/\1/p' |
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
mkdir pkg | |
cp -a source/. pkg/ | |
while read lib; do | |
pip3 install $lib -t ./pkg | |
done <installedlibraries.txt | |
chmod -R +x ./pkg/ | |
cd pkg | |
zip -r ../function.zip * |
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
# | |
# | |
# Exports the contents of a flat sql dump to csv files with the name of the table.csv and a xls representation of the database | |
# Requires Python 3.7 (from a Mac, first - brew install python3) | |
# Prior to running python3 -m pip install pandas | |
# Prior to running python3 -m pip install openpyxl | |
# Usage python3 sqlcsvxlsexport.py <sql dump file> <target directory> | |
# Send accolades for the script to [email protected] or hatemail to <devnull> | |
# | |
# |
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
import re | |
import csv | |
import sys | |
import os.path | |
import argparse | |
# allow large content in the dump | |
csv.field_size_limit(sys.maxsize) | |
def is_insert(line): |
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
<?php | |
ini_set("error_log", "error.log"); | |
error_reporting(E_ALL); | |
class IFTTT | |
{ | |
protected $key = null; | |
protected $headers = array(); | |
protected $input = null; | |
protected $params = array(); |
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
if [[ $(/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep usrnode | |
) ]]; then | |
echo "<result>WindTail Detected</result>" | |
else | |
echo "<result>Not Detected</result>" | |
fi |
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 # # # #Jamf Pro Extension Attribute to return the UID of a device in Splashtop # # | |
result=`defaults read ~/Library/Preferences/com.splashtop.stb.macosx.plist uniqueIdentifier` | |
echo "<result>$result</result>" |
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
tell application "Calendar" | |
set allEvents to events of calendar "SOURCE" | |
repeat with theEvent in allEvents | |
copy theEvent to end of events of calendar "TARGET" | |
delete theEvent | |
end repeat | |
end tell |
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
import requests | |
from xml.etree import ElementTree as ET | |
import sys | |
print("Script Starting...") | |
print("") | |
# Set the following constants specific to Salesforce Environment | |
username = sys.argv[1] | |
password = sys.argv[2] |
NewerOlder