Skip to content

Instantly share code, notes, and snippets.

View cmacrae's full-sized avatar
🌱

Calum MacRae cmacrae

🌱
View GitHub Profile
@rain-1
rain-1 / LLM.md
Last active May 3, 2024 10:05
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@caksoylar
caksoylar / zen-display-improvements.md
Last active April 12, 2024 09:33
Corne-ish Zen display improvements

Display improvements for the Corne-ish Zen keyboard

This note details the changes made to the Zen and ZMK codebase to improve the experience of e-ink displays.

Getting the changes

You can test out below changes using your Zen config repo by modifying your config/west.yml file, following ZMK instructions:

manifest:
  remotes:
 - name: caksoylar
@jerblack
jerblack / 1. Dark Mode in OSX with Go.md
Last active April 29, 2024 17:22
Golang: Detect dark mode change in OSX

I wanted to be able to detect when Dark mode was turned on or off in my Go program so I can swap icons in my tray app, but the Apple-blessed methods all use Swift and ObjectiveC. To work around this I figured out the following:

  • When dark mode is set, a property called "AppleInterfaceStyle" is set to "Dark" for the user.
  • When dark mode is disabled, that property is removed.
  • You can see this by running "defaults read -g AppleInterfaceStyle"
// Dark Mode On  
defaults read -g AppleInterfaceStyle  
 Dark 
@northox
northox / iked.conf
Last active September 10, 2021 17:42
OpenBSD's OpenIKEd roadwarrior VPN config for Ipad and such
ikev2 "inet" passive ipcomp esp \
from 0.0.0.0/0 to 10.0.1.0/24 \
from 10.0.0.0/24 to 10.0.1.0/24 \
local egress peer any \
srcid egress \
psk "strong-password" \
config protected-subnet 0.0.0.0/0 \
config address 10.0.1.0/24 \
config name-server 10.0.0.1 \
tag IKED
@tuukka
tuukka / gist:7a81112ef161ee77eccb
Created August 13, 2014 10:55
steps to create new btrfs filesystem for a Jolla phone
1. On a phone that's still working:
mount -o subvolid=0 /dev/mmcblk0p28 /mnt/
2. On a Linux laptop:
ssh jolla tar c /mnt/factory-@ >factory.tar
ssh jolla tar c /mnt/factory-@home >factory-home.tar
3. On the working phone again:
umount /mnt
@jperkin
jperkin / tools-packages.txt
Last active August 29, 2015 14:03
Tools package set
Date: Wed, 2 Jul 2014 20:07:53 +0100
From: Jonathan Perkin <jperkin@joyent.com>
To: smartos-discuss@lists.smartos.org
Subject: Tools package set now available
Message-ID: <20140702190753.GB77263@joyent.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Hi all,
A while back we discussed providing a separate bootstrap and package
@MattSurabian
MattSurabian / PackerPolicy.json
Last active May 27, 2022 21:46
Minimum IAM policy required by AWS for Packer to do its thing. https://github.com/mitchellh/packer Permissions are broken out by API functionality and a resource array has been defined with a wild card for each group. For tighter security resource level permissions can be applied per this documentation: http://aws.typepad.com/aws/2013/07/resourc…
{
"Statement": [
{
"Sid": "PackerSecurityGroupAccess",
"Action": [
"ec2:CreateSecurityGroup",
"ec2:DeleteSecurityGroup",
"ec2:DescribeSecurityGroups",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress"
@sax
sax / smartos.erb
Last active December 16, 2015 15:39
SmartOS Chef bootstrap template
# Wanelo Universal Bootstrap Script (W.U.B.S.)
bash -c '
# Linux Distros:
if [ $(uname -s | grep Linux) ]; then
true && curl -s -L https://www.opscode.com/chef/install.sh | bash
# Illumos Distros:
elif [ $(uname -s | grep SunOS) ]; then
@jperkin
jperkin / README.md
Last active September 11, 2018 15:09
Creating a NetBSD VM on SmartOS

Instructions for building a NetBSD VM

Install

vmadm create < netbsd-install.json
vmadm list
zoneuuid=...
cp NetBSD-6.0-amd64.iso /zones/$zoneuuid/root/netbsd.iso

vmadm boot $zoneuuid order=cd,once=d cdrom=/netbsd.iso,ide

@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`