Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / jcds_upload.py
Created May 20, 2020 20:41
A quick-and-dirty script for uploading packages to a Jamf Cloud Distribution Server
#!/usr/bin/python
'''
JCDS package upload script
by G Pugh
Developed from an idea posted at
https://www.jamf.com/jamf-nation/discussions/27869#responseChild166021
Usage:
@pythoninthegrass
pythoninthegrass / secure_bash_passwords.sh
Created April 26, 2020 20:42
Store and use secure passwords in bash
#!/bin/bash
# Mixing in python with bash we can easily retrieve our passwords securely in our shell scripts.
# Read this first: https://live.gnome.org/GnomeKeyring/SecurityPhilosophy
# Make sure your distro has gnome-keyring-daemon installed and running at login,
# as well as python-keyring installed (sudo apt-get install python-keyring)
##
# Follow these steps to see what it does. Verify by looking in Seahorse for your password.
##
@pythoninthegrass
pythoninthegrass / create_iso.sh
Last active April 4, 2020 02:12 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/usr/bin/env bash
# SOURCE:
# https://gist.github.com/julianxhokaxhiu/6ed6853f3223d0dd5fdffc4799b3a877
# TODO: error handling
# activate verbose standard output (stdout)
set -v
# activate debugging (execution shown)

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@pythoninthegrass
pythoninthegrass / scp-aws.md
Created March 25, 2020 22:52 — forked from stephaniemdavis/scp-aws.md
Syntax for using scp to to download a file from AWS to local disk

The following line uses the secure copy protocol to copy a file from an aws instance to the current (".") folder of a local machine.

scp -i aws.pem username@awsip(or ALIAS):/path/to/file .

aws.pem is the key AWS provides you to gain access to the AWS instance you want to copy from.

awsip is the IP address or DNS alias of the AWS instance.

path/to/file is the file's path on aws.

It is extremely important to add the period after the /path/to/file. Note the blank space between the /path/to/file and the period.

https://stackoverflow.com/questions/9441008/how-can-i-download-a-file-from-ec2

The obverse is true too; to upload FROM local folder to aws:

@pythoninthegrass
pythoninthegrass / scp-aws.md
Created March 25, 2020 22:52 — forked from stephaniemdavis/scp-aws.md
Syntax for using scp to to download a file from AWS to local disk

The following line uses the secure copy protocol to copy a file from an aws instance to the current (".") folder of a local machine.

scp -i aws.pem username@awsip(or ALIAS):/path/to/file .

aws.pem is the key AWS provides you to gain access to the AWS instance you want to copy from.

awsip is the IP address or DNS alias of the AWS instance.

path/to/file is the file's path on aws.

It is extremely important to add the period after the /path/to/file. Note the blank space between the /path/to/file and the period.

https://stackoverflow.com/questions/9441008/how-can-i-download-a-file-from-ec2

The obverse is true too; to upload FROM local folder to aws:

@pythoninthegrass
pythoninthegrass / reinit-sound.sh
Created March 25, 2020 21:37 — forked from akorobov/reinit-sound.sh
Fix(audio subsystem reinitialization) for no sound in osx 10.9(.2?) after sleep with headphones in
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext
sudo killall -9 coreaudiod
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@pythoninthegrass
pythoninthegrass / jamfpro-docker-compose.yml
Created March 19, 2020 01:48 — forked from brysontyrrell/jamfpro-docker-compose.yml
A Docker Compose file for launching Jamf Pro
version: "3"
services:
mysql:
image: "mysql:5.7"
networks:
- jamfnet
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: "jamfsw03"