Skip to content

Instantly share code, notes, and snippets.

View JuryA's full-sized avatar

Jiří Altman JuryA

View GitHub Profile
@JuryA
JuryA / default.nix
Created September 8, 2024 13:19 — forked from nmattia/default.nix
Report for runtime dependencies of a derivation
# MIT License, see below
#
# These are some helpers for figuring out the derivations attributes of runtime
# dependencies of a derivation, in particular the function `runtimeReport`. At
# the bottom of the file you can see it used on `hello`. Spoiler: glibc is a
# runtime dependency.
# For more info see
#
# https://nmattia.com/posts/2019-10-08-runtime-dependencies.html
@JuryA
JuryA / encrypt.txt
Created July 28, 2024 01:06 — forked from phrfpeixoto/encrypt.txt
Using SSH public key to encrypt a file or string
# Recently I had to send a password to someone over Skype. Since that's obviously not a good idea, I asked for
# the person's public SSH RSA key, and used it to encrypt the password itself.
# Convert the public key into PEM format
ssh-keygen -f path/to/id_rsa.pub -e -m pem > ~/id_rsa.pub.pem
# Using the public pem file to encrypt a string
echo "sometext" | openssl rsautl -encrypt -pubin -inkey ~/id_rsa.pub.pem > ~/encrypted.txt
@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": "[email protected]",
@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 ""