Skip to content

Instantly share code, notes, and snippets.

View codeliger's full-sized avatar

Ben codeliger

  • Canada
View GitHub Profile
@codeliger
codeliger / introspection-query.graphql
Created August 28, 2024 00:06 — forked from craigbeck/introspection-query.graphql
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
package test
import (
"bytes"
"crypto/rand"
"io"
"testing"
)
func generateRandomFile() io.Reader {
@codeliger
codeliger / instructions.md
Last active November 25, 2022 21:57
VS Code using id_rsa instead of custom ssh key

VS Code using id_rsa instead of custom ssh key

Add this section to your ~/.ssh/config (if it doesn't exist create it)

Host github.com
	User git
	HostName github.com
	AddKeysToAgent yes
	IdentityFile ~/.ssh/github
@codeliger
codeliger / updatego.sh
Created November 9, 2022 19:06
A function for .bashrc to update go to latest version
function updatego(){
GOVERSION=`git ls-remote --tags https://go.googlesource.com/go | grep -E "refs\/tags\/go[[:digit:]]*\.[[:digit:]]*(\.[[:digit:]]*)?$" | cut -f2 -- | sort -V | tail -n 1 | cut -d'/' -f3`
FILENAME=$GOVERSION.linux-amd64.tar.gz
FILEPATH="/home/$USER/$FILENAME"
URL=https://golang.org/dl/$FILENAME
echo "Downloading $URL"
echo "Saving to $FILEPATH"
echo "wget -nc -c -O $FILEPATH $URL"
wget -nc -c -O $FILEPATH $URL
sudo rm -rf /usr/local/go
@codeliger
codeliger / install-lineage-os-18-poco-f3.md
Last active March 8, 2022 19:20
Installing LineageOS 18 on Poco F3 Downgrading Android 12 to Android 11

Installing LineageOS 18 on Poco F3 Downgrading Android 12 to Android 11

I tried installing LineageOS following the instructions here: https://wiki.lineageos.org/devices/alioth/install

Problems:

  • I had android 12 not 11
  • The documentation provided does not describe how to downgrade Android 12 firmware to Android 11

Theres 3 modes that you need to understand the difference between:

@codeliger
codeliger / grub.cfg.diff
Created January 3, 2022 00:52
grub.cfg.diff
diff --git a/mnt/boot/grub/grub.cfg b/mnt/archliger/boot/grub/grub.cfg
old mode 100755
new mode 100644
index e0a49aa..64876ae
--- a/mnt/boot/grub/grub.cfg
+++ b/mnt/archliger/boot/grub/grub.cfg
@@ -85,7 +85,7 @@ if loadfont $font ; then
load_video
insmod gfxterm
set locale_dir=$prefix/locale
@codeliger
codeliger / NetworkManager.conf
Created January 28, 2020 16:34
Use resolvconf for dns
[main]
plugins=ifupdown,keyfile
dns=default
rc-manager=resolvconf
[ifupdown]
managed=false
[device]
wifi.scan-rand-mac-address=no
package main

import "fmt"

func Normal(s string) string {
    fmt.Println(&s)
    return s
}
@codeliger
codeliger / grub.sh
Last active December 31, 2021 03:41
#ensure you are booted into UEFI mode through the motherboards boot menu
# test if efi mode in bash:
# [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
# list devices
lsblk -f
# decrypt the encrypted disk/volume
sudo cryptsetup luksOpen /dev/nvme0n1p2 archliger
@codeliger
codeliger / restore_grub_manjaro.txt
Created December 8, 2019 08:33 — forked from greginvm/restore_grub_manjaro.txt
Restore GRUB in UEFI + LVM + LUKS setup (Manjaro)
Setup: UEFI, LVM + LUKS encrypted drive
Bootloader: Grub
Links:
- https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader
-
Restore GRUB (boot into live env):
# get the encrypted partition (crypto_LUKS)
lsblk -f