Skip to content

Instantly share code, notes, and snippets.

View thecb4's full-sized avatar
🏳️‍🌈
All the things

thecb4 thecb4

🏳️‍🌈
All the things
View GitHub Profile
@utkonos
utkonos / edit_ubuntu_autoinstall.py
Last active May 21, 2024 13:18
Simple Python Script to Edit an Ubuntu ISO to Add Automated Server Install Capability
import io
import pathlib
import pycdlib
ubuntu = pathlib.Path('ubuntu-22.04.1-live-server-amd64.iso')
new_iso_path = pathlib.Path('ubuntu-22.04.1-live-server-amd64-auto.iso')
iso = pycdlib.PyCdlib()
iso.open(ubuntu)
@gsf
gsf / ubu-on-mac.md
Last active April 15, 2024 12:47
Ubuntu VM on macOS with QEMU

Ubuntu VM on macOS with QEMU

For work I have an Intel Core i5 MacBook. With the Docker Desktop license changes I looked into minikube and Multipass but both failed when I got on our VPN with Cisco AnyConnect due to bridged networking in hyperkit (see links at bottom).

I realized I would be happy SSHing into a local Linux VM but passed on VirtualBox to avoid depending on legacy system extensions. I landed on libvirt for the VM, then realized I could remove libvirt from the equation to finally end up at this quick, simple setup for an Ubuntu VM on macOS with QEMU.

First, install QEMU (see https://wiki.qemu.org/Hosts/Mac for other o

@dbkinghorn
dbkinghorn / user-data-server
Created September 28, 2021 21:49
Ubuntu 20.04 user-data files for autoinstall ISO
#cloud-config
autoinstall:
version: 1
refresh-installer: # start with an up-to-date installer
update: yes
interactive-sections: # Install groups listed here will wait for user input
- storage
storage: # should set the interactive default but doesn't seem to work??
layout:
name: direct
@kepano
kepano / obsidian-web-clipper.js
Last active May 22, 2024 10:51
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@nrjdalal
nrjdalal / QEMU-Silicon-Mac-Virtualization.md
Last active February 1, 2024 05:31
Create Virtual Machines using QEMU on Silicon based Apple Macs

Install QEMU on Silicon based Apple Macs (June 2021)

Option 1 - Automatically

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nrjdalal/silicon-virtualizer/master/install-qemu.sh)"

Option 2 - Manually

  • Install Xcode command line tools

xcode-select --install
@davidteren
davidteren / nerd_fonts.md
Last active May 24, 2024 08:16
Install Nerd Fonts via Homebrew [updated & fixed]
@freak4pc
freak4pc / Combine+WithLatestFrom.swift
Last active February 19, 2024 15:35
withLatestFrom for Apple's Combine
//
// Combine+WithLatestFrom.swift
//
// Created by Shai Mishali on 29/08/2019.
// Copyright © 2019 Shai Mishali. All rights reserved.
//
import Combine
// MARK: - Operator methods
@pakLebah
pakLebah / launch.json
Last active May 19, 2021 14:57
My VS Code tasks for Apple's Swift programs on Mac.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"name": "LLDB",
"cwd" : "${workspaceFolder}",
@vzsg
vzsg / 1_JSONTag.swift
Last active November 25, 2020 13:06
Automatically encoding data to JSON with Leaf (for embedding into scripts)
import Leaf
import Foundation
final class JSONTag: TagRenderer {
private let encoder = JSONEncoder()
func render(tag: TagContext) throws -> EventLoopFuture<TemplateData> {
try tag.requireNoBody()
try tag.requireParameterCount(1)
let json = try encoder.encode(tag.parameters[0])
@illuzor
illuzor / .gitlab-ci.yml
Last active April 25, 2024 05:22
Config for gitlab ci android with unit tests and instrumented tests
image: ubuntu:22.04
variables:
ANDROID_COMPILE_SDK: "33"
ANDROID_BUILD_TOOLS: "33.0.2"
EMULATOR_IMAGE: "24"
SDK_TOOLS: "9477386" # from https://developer.android.com/studio/#command-tools
before_script: