Skip to content

Instantly share code, notes, and snippets.

@Lotusshaney
Lotusshaney / appify.sh
Created June 12, 2018 09:06 — forked from oubiwann/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@Lotusshaney
Lotusshaney / gist:4048c4339e7e99d5461357729979ad61
Created February 17, 2019 11:58 — forked from tinogomes/gist:771704
Backing Up Your Wii Game Overview with MAC OS X
Extracted from http://chris-fletcher.com/2009/05/17/backup-and-burn-wii-games-on-a-mac/
1. Insert the Wii Game disc into your DVD drive.
2. Click Ignore
3. Open Terminal ( Applications -> Utilities -> Terminal
4. Type drutil status ( Get the Name i.e. /dev/disk1 )
5. Type dd if=/path_to_dvd of=/game_name.iso and wait 15 min
6. Type drutil eject to eject your game.
To copy
@Lotusshaney
Lotusshaney / fancy_defaults_read.py
Created April 16, 2019 11:10 — forked from gregneagle/fancy_defaults_read.py
fancy_defaults_read.py: Reads a preference, prints its value, type, and where it is defined.
#!/usr/bin/python
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
CFPreferencesCopyAppValue,
CFPreferencesCopyValue,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost,
@Lotusshaney
Lotusshaney / Manage App Notifications.bash
Created October 10, 2019 10:41 — forked from talkingmoose/Manage App Notifications.bash
Similar to User Approved Kernel Extensions (UAKEL) and Privacy Preferences Policy Control (PPPC) in earlier macOS versions, Catalina will now prompt users to allow Notifications from each app. Administrators can manage these prompts using a Configuration Profile. These profiles do not require User Approved MDM.
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/9faf50deaaefafa9a147e48ba39bb4b0
@Lotusshaney
Lotusshaney / kextidentifiers.py
Created December 12, 2019 21:34 — forked from erikng/kextidentifiers.py
kextidentifiers.py
#!/usr/bin/python
# For mojave only
# In order for this to work, you will need to go to System Preferences in Mojave -> Security & Privacy -> Privacy -> Full Disk Access and grant Terminal.app permissions
import sqlite3
conn = sqlite3.connect('/var/db/SystemPolicyConfiguration/KextPolicy')
c = conn.cursor()
query = 'SELECT * FROM kext_policy'
c.execute(query)
@Lotusshaney
Lotusshaney / haproxy.cfg
Created April 5, 2020 11:09 — forked from urodoz/haproxy.cfg
Multiple SSL certificates in HAProxy configuration
global
maxconn 2048
defaults
mode http
timeout connect 5000ms
timeout client 90000ms
timeout server 90000ms
frontend secure-http-in

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@Lotusshaney
Lotusshaney / modelinfo.py
Created August 17, 2020 14:15 — forked from scriptingosx/modelinfo.py
Get the localized "Marketing Name" for a Mac
#!/usr/bin/python
import sys
import plistlib
import subprocess
from Cocoa import NSBundle
if (len(sys.argv) == 2):
model = sys.argv[1]
else:

Disable Device Enrollment Program (DEP) notification on macOS Catalina.md

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

   c. It will then show a remaining time of about 10-15 minutes

@Lotusshaney
Lotusshaney / defaultbrowser.py
Created June 2, 2021 08:40 — forked from miketaylr/defaultbrowser.py
Set default browser on OSX with Python
#/usr/bin/env python
from LaunchServices import LSSetDefaultHandlerForURLScheme
from LaunchServices import LSSetDefaultRoleHandlerForContentType
# 0x00000002 = kLSRolesViewer
# see https://developer.apple.com/library/mac/#documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html#//apple_ref/c/tdef/LSRolesMask
LSSetDefaultRoleHandlerForContentType("public.html", 0x00000002, "com.operasoftware.operanext")
LSSetDefaultRoleHandlerForContentType("public.xhtml", 0x00000002, "com.operasoftware.operanext")
LSSetDefaultHandlerForURLScheme("http", "com.operasoftware.operanext")
LSSetDefaultHandlerForURLScheme("https", "com.operasoftware.operanext")