Skip to content

Instantly share code, notes, and snippets.

View JuryA's full-sized avatar

Jiří Altman JuryA

View GitHub Profile
@JuryA
JuryA / autoload.sh
Created January 17, 2023 10:03 — forked from sergioro9/autoload.sh
Bash autoload
# autoload bash scripts. Much faster than `source script.sh`
# usage: autoload script.sh
autoload() {
[ -f "$1" ] || { echo "Usage ${FUNCNAME[0]} <filename>"; return 1;}
filename="$1"
loadname="$(sed 's:\..*::' <<< $(basename $filename))"
if [ -z "$(eval echo \${${loadname}_loaded})" ]; then
functions=$(command grep -o "^[a-zA-Z0-9_:]* *()" $filename | sed 's/()//')
for f in $functions; do
eval "
@JuryA
JuryA / NOTES.sh
Last active February 28, 2022 07:46
k8s cheatsheet
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# get k8s contexts
kubectl config get-contexts -o name --no-headers
# get k8s current context
kubectl config current-context
# generate self signed SSL cert - oneliner

Removing a Mac's Firmware Password By Reflashing EFI ROM

According to Apple, the only way to remove an unknown firmware password from a MacBook (2011 and later) is to take it to the Apple Store with the original proof-of-purchase. However, I've found that there is another way, which I've been successful with for the unibody MacBook Pro--it's essentially just modifying a couple bytes in the EFI ROM, which should be simple. What's not simple, however, is figuring out how to read and write to the EFI chip. In this post, I'll talk about the process that I figured out and what worked for me.

The Official Method

Apple's method of resetting the firmware password is not reproducible, as Apple generates an SCBO file that unlocks the EFI using their private key. You can read more about this process here. The problem with this system is that, if you are in the unfortunate situation of neither having the firmware unlock pass

@JuryA
JuryA / resume.json
Last active January 18, 2022 11:47
CV
{
"meta": {
"theme": "kendall"
},
"basics": {
"name": "Jiří Altman",
"label": "Senior System Engineer",
"picture": "",
"email": "altman.jiri@gmail.com",
@JuryA
JuryA / cfgutil
Created October 10, 2020 16:04 — forked from AloPress/cfgutil
Command-line iOS device management, cfgutil performs various management tasks on one or more attached iOS devices. It can be used manually and as part of automated workflows. Source: https://configautomation.com/cfgutil-man-page.html
CFGUTIL(1) BSD General Commands Manual CFGUTIL(1)
NAME
cfgutil -- Command-line iOS device management
SYNOPSIS
cfgutil [-C ] [-K ]
[-e | -f | --foreach]
[--format JSON | plist | text] [-v] command [ ...]
@JuryA
JuryA / linkedin.clj
Created August 7, 2020 17:40 — forked from piotr-yuxuan/linkedin.clj
LinkedIn scraper to get contact infos for some compay current or former employees
(ns scraper.linkedin
"This is meant to be a very simple sktech on how to scrap some LinkedIn network with etaoin, enlive, and Google Chrome. This is by no mean the more efficient, or elegant way to do so."
(:require [scraper.utils :refer [email password some-company-id]]
[net.cgrand.enlive-html :as html]
[etaoin.api :refer :all]
[clojure.string :as str]))
(defonce driver (chrome))
(defn former-company-employees
@JuryA
JuryA / linkedin.clj
Created August 7, 2020 17:40 — forked from piotr-yuxuan/linkedin.clj
LinkedIn scraper to get contact infos for some compay current or former employees
(ns scraper.linkedin
"This is meant to be a very simple sktech on how to scrap some LinkedIn network with etaoin, enlive, and Google Chrome. This is by no mean the more efficient, or elegant way to do so."
(:require [scraper.utils :refer [email password some-company-id]]
[net.cgrand.enlive-html :as html]
[etaoin.api :refer :all]
[clojure.string :as str]))
(defonce driver (chrome))
(defn former-company-employees
@JuryA
JuryA / foo.sh
Created May 26, 2020 18:28 — forked from waylan/foo.sh
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""
@JuryA
JuryA / add-voice.ps
Created April 5, 2020 12:56 — forked from hiepxanh/add-voice.ps
Add microsoft core voice to any application can use
$sourcePath = 'HKLM:\software\Microsoft\Speech_OneCore\Voices\Tokens' #Where the OneCore voices live
$destinationPath = 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens' #For 64-bit apps
$destinationPath2 = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens' #For 32-bit apps
cd $destinationPath
$listVoices = Get-ChildItem $sourcePath
foreach($voice in $listVoices)
{
$source = $voice.PSPath #Get the path of this voices key
copy -Path $source -Destination $destinationPath -Recurse
copy -Path $source -Destination $destinationPath2 -Recurse
@JuryA
JuryA / example.ign
Last active March 24, 2020 13:16
eample.ign
{
"ignition": {
"config": {
"replace": {
"source": null,
"verification": {}
}
},
"security": {
"tls": {}