Skip to content

Instantly share code, notes, and snippets.

@Lotusshaney
Lotusshaney / install-coreutils-from-src-mac
Created May 10, 2024 15:46 — forked from byronmansfield/install-coreutils-from-src-mac
Install coreutils from source Mac OS X
# Install coreutils from source on Mac OS X
# prepare workspace
mkdir -p ~/code/build-from-src/ && cd $_
# download source code
curl -LO https://ftp.gnu.org/gnu/coreutils/coreutils-8.31.tar.xz
# expand
tar -xJvf coreutils-8.31.tar.xz
@Lotusshaney
Lotusshaney / windows_and_office_kms_setup.adoc
Created November 30, 2023 09:24 — forked from jerodg/windows_and_office_kms_setup.adoc
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@Lotusshaney
Lotusshaney / Create User Account.zsh
Created November 8, 2023 16:26 — forked from talkingmoose/Create User Account.zsh
Simple script to create a new macOS user account. Will not provide a SecureToken.
#!/bin/zsh
# new user account details
username="lapsadmin"
displayName="LAPS Admin"
password="P@55w0rd"
admin="yes"
hidden="yes"
# determine next available UID
@Lotusshaney
Lotusshaney / computer_icon.py
Created February 25, 2022 22:08 — forked from pudquick/computer_icon.py
A variation on https://scriptingosx.com/2018/01/get-an-icon-for-your-mac/ that doesn't attempt to contact WindowServer / trigger errors
#!/usr/bin/python
from Foundation import NSZeroRect, NSMakeRect, NSMakeSize
from AppKit import NSPNGFileType, NSCompositeCopy, NSGraphicsContext, NSCalibratedRGBColorSpace, NSBitmapImageRep, NSImage, NSImageNameComputer
dimension = 512
size = NSMakeSize(dimension, dimension)
rect = NSMakeRect(0, 0, dimension, dimension)
image = NSImage.imageNamed_(NSImageNameComputer)
image.setSize_(size)
@Lotusshaney
Lotusshaney / DefaultBrowser.ps1
Created June 2, 2021 08:43 — forked from TylerLeonhardt/DefaultBrowser.ps1
Get and Set the default browser on macOS. Also is an example at how to leverage other scripting languages within PowerShell
# NOTE: This still pops a dialog... I can't seem to figure out how to -Force it to not show.
function Set-DefaultBrowser {
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[Parameter(Mandatory = $true)]
$BrowserId
)
$pythonScript = @"
from LaunchServices import LSSetDefaultHandlerForURLScheme
@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")

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 / 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:

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 / 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