Skip to content

Instantly share code, notes, and snippets.

View sebnyberg's full-sized avatar
🇸🇪

Sebastian Nyberg sebnyberg

🇸🇪
View GitHub Profile
@sebnyberg
sebnyberg / guide.md
Last active March 7, 2024 16:14
Ubuntu installation on iMac 2019 (MacOS 11 - Big Sur)

Ubuntu 20.04 with Wifi on iMac 2019 (MacOS 11 - Big Sur)

The purpose of this document is to summarize some of the things I had to figure out to successfully install Ubuntu on my iMac '19 27" 5K, a.k.a. iMac 19,1.

t2linux

From what I could find, iMac's do not have the t2 security chip. However, it does share hardware (and firmware) with contemporary Macbook Pros. For this reason, the t2linux.org website contains lots of helpful information about how to install Ubuntu on an iMac.

However, the guides on the t2linux website did not work for me when I ran it, so I had to mix and match some old pages from the wiki to make things work. Also, most issues are focused on Macbooks, not iMacs.

alias ls='ls --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Add an "alert" alias for long running commands. Use like so:
@sebnyberg
sebnyberg / README.md
Last active January 10, 2024 04:57
Emacs 29 MacOS setup
@sebnyberg
sebnyberg / README.md
Last active December 25, 2023 18:38
Just some git notes

Git notes

Just a collection of git + magit things that I need to start remembering.

Usual working procedure

git switch -c my-branch

# ... do work
@sebnyberg
sebnyberg / README.md
Last active September 27, 2023 06:42
Mac + Moonlander + EN + SE

EN + SE on the Moonlander

I've been switching back and forth between English and Swedish for programming / chatting since.. forever.

Having bought the ZSA Moonlander, one of the goals was to eliminate switching.

There are two possible routes:

  1. Use a Swedish layout and put EN keys in better positions
  2. Use an English layout and somehow manage to insert åäö
@sebnyberg
sebnyberg / tmp_test.go
Last active June 10, 2023 12:52
Roman To Integer Benchmarks
package main_test
import (
"testing"
)
var res int
func a(x int) int {
return x
@sebnyberg
sebnyberg / .bashrc
Last active May 5, 2023 09:08
Basic .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@sebnyberg
sebnyberg / main.go
Created March 29, 2023 20:27
ChatGPT module thing
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type VpcArgs struct {
Name string
CidrBlock string
@sebnyberg
sebnyberg / Decorators-For-React-Native-Instruction.md
Created September 7, 2017 16:17
How to setup decorators in React Native

Using decorators in React Native

  1. Install babel plugins to enable decorators.

    npm install babel-plugin-transform-decorators-legacy --save-dev
  2. Create or update your .babelrc file in root folder:

@sebnyberg
sebnyberg / go_cpu_memory_profiling_benchmarks.sh
Last active March 6, 2023 11:10 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
FILENAME=$(basename $(pwd))
go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace trace.out
go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
go tool trace trace.out
go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg