Skip to content

Instantly share code, notes, and snippets.

View krypted's full-sized avatar

Charles Edge krypted

View GitHub Profile
#!/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>"
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
@krypted
krypted / gist:876b67b0d43469c11c245f1ad10e6ca1
Created January 23, 2019 20:31
jamf_smart_group_to_IFTTT_php
<?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();
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):
#
#
# 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>
#
#
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 *
#! /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'
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.')