Skip to content

Instantly share code, notes, and snippets.

View krypted's full-sized avatar

Charles Edge krypted

View GitHub Profile
if [[ $USER != "root" ]]; then
echo "This script must be run as root"
else
echo "You are root"
exit 1
fi
@krypted
krypted / changeadforestmode.powershell
Last active May 7, 2016 22:09
Changes the Active Directory Forest Mode to Windows2008Forest and Domain Mode to Windows2008Domain
Import-Module -Name ActiveDirectory
Set-ADForestMode –Identity “krypted.com” –ForestMode Windows2008Forest
Set-ADDomainMode –Identity “krypted.com” –DomainMode Windows2008Domain
Get-ADForest | Format-Table Name , ForestMode
@krypted
krypted / MaMi.sh
Last active February 8, 2018 14:45
#!/bin/bash
#Get our list of DNS servers
servers=`networksetup -getdnsservers Wi-Fi`
#Start with this set to False - we'll change it to true if needed
foundInfected=false
#For each item in $servers
for ser in $servers; do
#If the current IP matches this IP
if [ $ser == '82.163.143.135' ]; then
import requests
import json
import sys
print("Script Starting...")
print("")
access_token_url = 'https://login.salesforce.com/services/oauth2/token'
data = {
let request = require('request');
console.log("Connecting to Salesforce");
console.log("");
let access_token_url = 'https://login.salesforce.com/services/oauth2/token';
let username = 'enter user name here';
let password = 'enter password here';
let client_id = 'enter client id here';
let client_secret = 'enter client secret here';
import requests
import json
import sys
print("Connecting to Salesforce")
print("")
access_token_url = 'https://login.salesforce.com/services/oauth2/token'
data = {
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
#!/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();