Skip to content

Instantly share code, notes, and snippets.

@firstrow
firstrow / gist:53d27b65d18c65bb41bea1713c097d45
Last active April 13, 2024 09:55
Archlinux NVIDIA suspend to ram fix
If machine goes to sleep and wakes up? hyprland crashes on wake up?
https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
```
To save and restore all video memory contents, use the NVreg_PreserveVideoMemoryAllocations=1 kernel module parameter
for the nvidia kernel module and enable nvidia-suspend.service, nvidia-hibernate.service, and nvidia-resume.service.
```
```
@firstrow
firstrow / full-disk-encryption-arch-uefi.md
Created April 8, 2024 18:59 — forked from huntrar/full-disk-encryption-arch-uefi.md
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@firstrow
firstrow / Initial Setup.md
Created April 7, 2024 17:48 — forked from Pamblam/Initial Setup.md
Installing And Setting Up Arch Linux to Dual Boot Alongside Window 10

Newb's Guide to installing Arch Next to Pre-installed Windows 10

The steps I took to dual boot Arch Linux alongside the preinstalled Windows 10 that came with my new Lenovo Ideapad. I used Ubuntu exclusively for the last 6 years so I'm Window's illiterate. I don't know a whole lot about the inner workings of Linux either.

Pre-Instllation Steps

Prepare the preinstalled Windows to share the system.

Verify the boot mode...

@firstrow
firstrow / sign.md
Created October 4, 2019 08:53
MacOS Mojave GDB cosign
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
 
@firstrow
firstrow / arch-linux-install
Created January 28, 2019 09:30 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
mkdir /tmp/protoc && cd "$_"
wget https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
unzip protoc-3.5.1-linux-x86_64.zip
sudo cp bin/protoc /usr/local/bin/protoc

Keybase proof

I hereby claim:

  • I am firstrow on github.
  • I am firstrow (https://keybase.io/firstrow) on keybase.
  • I have a public key ASCO_4vb5x_A7wd5exCo8Po2ajjKWEvMnqVNG3Me_22Ilgo

To claim this, I am signing this object:

@firstrow
firstrow / gist:392bce9ea8c00d3634479f5798ed958b
Last active June 10, 2017 08:52 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 1 > Bridged Adapter

@firstrow
firstrow / rabbitmq_reconnect.go
Created April 24, 2017 13:03 — forked from svcavallar/rabbitmq_reconnect.go
Golang example to reconnect to RabbitMQ on a connection closed event
package main
import (
"flag"
"github.com/streadway/amqp"
"log"
"time"
)
var amqpUri = flag.String("r", "amqp://guest:guest@127.0.0.1/", "RabbitMQ URI")
@firstrow
firstrow / sql_logger.rb
Created January 5, 2017 15:52
Log active record SQL call line
module LogQuerySource
def debug(*args, &block)
return unless super
backtrace = Rails.backtrace_cleaner.clean caller
# logger.debug(backtrace)
relevant_caller_line = backtrace.detect do |caller_line|
!caller_line.include?('/initializers/')
end