Skip to content

Instantly share code, notes, and snippets.

View barezina's full-sized avatar

Bob Arezina barezina

  • Brisbane Australia
View GitHub Profile
barezina / usb-unlock
Last active April 1, 2024 21:57
a script to initramfs that allows for keyfiles on USB drives to be used to unlock 22.04 disks
set -e
if [ -e ${file} ]; then
count=$(cat ${file})
barezina / remove.php
Last active June 30, 2021 04:49
Bulk remove collaborator from all repos
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
* Remove the specified user from all repositories
* that we are authenticated to see and manage.
barezina /
Last active March 8, 2022 06:00
Install docker and docker compose, add ubuntu user to docker group.
apt update;
apt install -y ca-certificates curl gnupg lsb-release;
curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg;
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null;
apt update;
apt install -y docker-ce docker-ce-cli;
usermod -aG docker ubuntu;
sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose;
barezina / asciitable.php
Last active February 24, 2020 03:30
PHP ascii table from 2D array
function generateAsciiTable($data)
// Generate row widths
$rowWidths = [];
foreach ($data as $row) {
foreach ($row as $index => $cell) {
if (!isset($rowWidths[$index])) {
$rowWidths[$index] = strlen($cell) + 2;
} else {
barezina /
Last active March 13, 2021 05:30
ios backup extractor - restores an iTunes backup to it's original files
import sqlite3
import os
import uuid
import shutil
import re
print('ios backup python script for linux (ubuntu)')
# this function helps traverse the returned results from the db
def dict_factory(cursor, row):
barezina / singleton.m
Created April 4, 2017 22:45
Singleton for making get-post requests (passing in external block, completion handler)
// singleton.m
#import "singleton.h"
typedef void(^ CompletionBlock)(NSData*, NSURLResponse*, NSError*);
@implementation singleton
@synthesize vData;