Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile

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 / 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)
@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.
##
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Identifier</key>
<string>local.jss.Spotify-AllManagedClients</string>
<key>Input</key>
<dict>
<key>CATEGORY</key>
<string>Music</string>
<policy>
<general>
<name>Install Latest %PROD_NAME%</name>
<enabled>true</enabled>
<frequency>Ongoing</frequency>
<category>
<name>%POLICY_CATEGORY%</name>
</category>
</general>
<scope>
@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 / userChrome.css
Created June 9, 2020 03:53
Fix Firefox 77's ridiculous URL bar and some other QOL items
/*** Megabar Styler General - version 2020-04-19 ***/
/* SOURCES:
https: //www.userchrome.org/megabar-styling-firefox-address-bar.html
https: //www.userchrome.org/how-create-userchrome-css.html */
/*** General Preferences ***/
:root {
/* Number of pixels of enlargement when URL bar is focused */
@pythoninthegrass
pythoninthegrass / dosbox.conf
Created July 6, 2020 03:16
Windows & macOS dosbox.conf tailored to DOS 6.22 + Windows 3.1 + Write Camera Action game
# This is the configurationfile for DOSBox 0.74. (Please use the latest version of DOSBox)
# Lines starting with a # are commentlines and are ignored by DOSBox.
# They are used to (briefly) document the effect of each option.
[sdl]
# fullscreen: Start dosbox directly in fullscreen. (Press ALT-Enter to go back)
# fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox.
# fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# Using your monitor's native resolution with aspect=true might give the best results.
# If you end up with small window on a large screen, try an output different from surface.
@pythoninthegrass
pythoninthegrass / 21-ethtool
Created July 16, 2020 03:37
`ethtool` script to mitigate Plex buffering specifically on LAN with direct play
#!/usr/bin/env bash
# SOURCES
# https://forums.plex.tv/t/massive-buffering-solved/155491/11
# https://serverfault.com/a/779496
# USAGE
# vim /etc/NetworkManager/dispatcher.d/21-ethtool
# sudo chmod 751 /etc/NetworkManager/dispatcher.d/21-ethtool
# chown root:root /etc/NetworkManager/dispatcher.d/21-ethtool
@pythoninthegrass
pythoninthegrass / passpass.py
Created August 16, 2020 21:23
Python credentials boilerplate with decouple and getpass
from decouple import config
from getpass import getpass
import os
# Dynamic prompt for creds stored as tuple
# 0: eml_addr
# 1: passwd
# print(dyn_creds[0:]) # ('nopez@no.com', 'yesnononoyes')
def hardcode_death():
eml_addr = input('Please enter your email address: ')