Skip to content

Instantly share code, notes, and snippets.

@RobertYim
RobertYim / DEPSteps.md
Created April 19, 2024 14:51 — forked from c22dev/DEPSteps.md
Remove MDM & DEP from an Apple Sillicon Mac (Sonoma)

How to make an MDM Mac shine like it's brand new ?

Works, as of 14/04/2024, on macOS 14.4.1 and lower (prob higher but idk)

This was made for Apple Sillicon Macs.

Restore Process

You need another Mac for this.

If you don't have one and have recovery locked, it's not possible.

@RobertYim
RobertYim / set-up-chromium-keys.md
Created July 22, 2020 15:29 — forked from cvan/set-up-chromium-keys.md
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the chromium-dev@chromium.org mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium devs.)
  5. Make sur
@RobertYim
RobertYim / Create macOS Recovery Partition.sh
Last active August 31, 2018 17:39 — forked from davidjb/recovery.sh
Create macOS Sierra Recovery Partition Without Reinstalling
# Specify where to configure Recovery partition, or a disk image larger then 5GB
TARGET="/Volumes/Macintosh HD"
# Path to your macOS installer
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")"
# Remaining paths ahead are dependant on OS version
# This *should* support 10.9 and above but is only tested on 10.12
# Download the Recovery Disk image, as of version 10.13.6
curl -C - -O http://swcdn.apple.com/content/downloads/29/03/091-94326/45lbgwa82gbgt7zbgeqlaurw2t9zxl8ku7/RecoveryHDMetaDmg.pkg
@RobertYim
RobertYim / create-iso.sh
Last active January 13, 2019 09:47 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@RobertYim
RobertYim / highsierra_bootable.sh
Last active August 4, 2018 04:38 — forked from agentsim/highsierra_bootable.sh
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@RobertYim
RobertYim / crypto-gcm.js
Created February 1, 2018 17:35 — forked from chris-rock/crypto-gcm.js
Use GCM for authenticated encryption in nodejs
// Nodejs encryption with GCM
// Does not work with nodejs v0.10.31
// Part of https://github.com/chris-rock/node-crypto-examples
var crypto = require('crypto'),
algorithm = 'aes-256-gcm',
password = '3zTvzr3p67VC61jmV54rIYu1545x4TlY',
// do not use a global iv for production,
// generate a new one for each encryption
iv = '60iP0h6vJoEa'
@RobertYim
RobertYim / sinaimg.js
Last active September 5, 2017 02:57 — forked from mysteriouss/sinaimg.js
// ==UserScript==
// @name sinaimg
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*.sinaimg.cn/*
// @grant none
// ==/UserScript==
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@RobertYim
RobertYim / captcha.py
Created April 13, 2017 02:36 — forked from liberize/captcha.py
简单验证码识别
#!/usr/bin/env python
# coding: utf-8
import os
import sys
from PIL import Image, ImageChops
templates = []
@RobertYim
RobertYim / GAME_MASTER_v0_1.protobuf
Created July 18, 2016 03:58 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {