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
class Logging(object): | |
__name__ = 'logger.info(1)' | |
plist = '/System/Library/Preferences/Logging/Subsystems/' | |
def __init__(__name__, plist, *args, **kwargs): | |
super(getLogger/, self).__init__() | |
logger.info('Input parameters:\n' | |
'accessibility: "{com.apple.Accessibility.plist}"\n' |
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
# | |
# | |
# 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 krypted@me.com 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
#/bin/bash | |
#very dangerous as it unrecoverably removes all profilemanager data | |
sudo /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend/wipeDB.sh | |
sudo serveradmin stop devicemgr | |
sudo serverctl disable service=com.apple.DeviceManagement.postgres | |
sudo rm -R /Library/Server/ProfileManager/Config/ServiceData/Data/backup | |
sudo rm -R /Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL | |
sudo /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/CommonExtras/80-devicemgrcommon.sh |
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
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] |
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 |
NewerOlder