Skip to content

Instantly share code, notes, and snippets.

@Ekhoo
Ekhoo / Record.md
Created March 5, 2018 08:26
Record iOS Simulator output

xcrun simctl io booted recordVideo filename.ext

#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@myell0w
myell0w / CGPath Utilities.swift
Last active July 18, 2023 13:14
Some helpers to make working with CGPaths in Swift easier
/*
Copyright 2021 Matthias Tretter
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
@alexrashed
alexrashed / zfs-ext4-docker.sh
Created October 7, 2021 11:48
Creates a new ZFS volume for docker with ext4
#!/bin/bash
# This is just a writeup to build an ext4 FS on top of ZFS to overcome issues with the Docker ZFS storage driver.
# DO NOT EXECUTE THIS SCRIPT IF YOU DO NOT KNOW WHAT YOU'RE DOING!
sudo zfs create -V 100G rpool/docker-overlay
sudo mkfs.ext4 /dev/zvol/rpool/docker-overlay
sudo mount /dev/zvol/rpool/docker-overlay /var/lib/docker-overlay
docker system prune -af
sudo su
cat > /etc/docker/daemon.json << EOF
{
@slowpeek
slowpeek / dropbear-netplan-fix
Last active May 8, 2025 08:07
Clean up netplan stuff after dropbear-initramfs
#!/bin/sh
: <<'README'
This is a fix for a well-known problem [1] with dropbear-initramfs+netplan
combo.
When dropbear starts, it enables networking [2]. This results in netplan configs
for available ifaces created under /run/netplan. After unlocking, the configs
are still there preventing networkmanager from picking ifaces up: by default,