Skip to content

Instantly share code, notes, and snippets.

View rderewianko's full-sized avatar

Ross Derewianko rderewianko

View GitHub Profile
@opragel
opragel / cipher.sh
Last active August 29, 2015 14:25
Updates ciphers in Tomcat server.xml for JSS 9.73
#!/bin/bash
# It's your funeral
LINUX_TOMCAT_USER="tomcat7"
LINUX_TOMCAT_GROUP="tomcat7"
LINUX_SERVER_XML_PATH="/usr/local/jss/tomcat/conf/server.xml"
LINUX_SERVER_XML_BACKUP_PATH="/usr/local/jss/tomcat/conf/server.xml.bak"
MAC_TOMCAT_USER="_appserver"
MAC_TOMCAT_GROUP="_appserveradmin"
MAC_SERVER_XML_PATH="/Library/JSS/Tomcat/conf/server.xml"
MAC_SERVER_XML_BACKUP_PATH="/Library/JSS/Tomcat/conf/server.xml.bak"
@dderusha
dderusha / Cache_Cleaner.sh
Last active May 31, 2016 18:56
Clean OS X caches
#!/bin/sh
#created By Dan De Rusha modified 10-8-14
### DELETE UTC CACHES
rm -r /Library/Extensis
mkdir /Library/Extensis
chmod 777 /Library/Extensis
### DELETE MICROSOFT CACHES
rm /Users/*/Library/Preferences/Microsoft/Office\ Font\ Cache*
rm /Users/*/Library/Preferences/Microsoft/Office\ 2008/Office\ Font\ Cache*
@devdazed
devdazed / slack-pagerduty-oncall.py
Last active April 18, 2024 10:28
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@devStepsize
devStepsize / slack_webhook_post.py
Last active August 7, 2023 09:28
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@JonasGroeger
JonasGroeger / sync-projects
Last active May 15, 2024 01:44
Gitlab: Clone / Pull all projects in a group
#!/usr/bin/env bash
# Documentation
# https://docs.gitlab.com/ce/api/projects.html#list-projects
NAMESPACE="YOUR_NAMESPACE"
BASE_PATH="https://gitlab.example.com/"
PROJECT_SEARCH_PARAM=""
PROJECT_SELECTION="select(.namespace.name == \"$NAMESPACE\")"
PROJECT_PROJECTION="{ "path": .path, "git": .ssh_url_to_repo }"
@pcapriotti
pcapriotti / allrepos
Last active May 14, 2018 15:22
List all personal repositories from git hosting services
#!/bin/bash
set -e
usage() {
echo "Usage: $0 USERNAME" 2>&1
exit 1
}
username="$1"
[ -z "$username" ] && usage
@pudquick
pudquick / sip_config.py
Created December 22, 2016 22:31
Querying active SIP status directly from the kernel, bypassing nvram and csrutil, via python on macOS
# An overly complicated SIP config checker
# This is a technically interesting implementation because it does not rely on csrutil
# Instead it queries the kernel directly for the current configuration status
# This means, for example, in environments where SIP has been disabled and csrutil has
# been removed or modified (say, with DYLD_LIBRARY_PATH), as long as python can run you
# can still check status
# Additionally, checking the nvram csr-active-config setting isn't accurate now with
# 10.12.2+, since running "sudo csrutil clear" deletes the variable until reboot,
@opragel
opragel / google_drivefs_update_checker.py
Last active October 4, 2017 22:55 — forked from bruienne/google_chrome_update_checker.py
Fork of Chrome update query for DriveFS
#!/usr/bin/python
import xml.etree.ElementTree as ET
import requests
import uuid
params = {'cup2hreq': 'foo', 'cup2key': 'bar'}
platform = 'mac'
os_version = '10.12'
@brysontyrrell
brysontyrrell / create_jss_account.py
Last active November 21, 2023 23:00
Create a JSS admin account
import getpass
import sys
import xml.etree.ElementTree as Et
import requests
try:
NEW_USERNAME = sys.argv[1]
except IndexError:
print('No username provided!')