Skip to content

Instantly share code, notes, and snippets.

View Pastitas's full-sized avatar

Pastitas

View GitHub Profile
@dixyes
dixyes / Readme.md
Last active May 6, 2024 14:22
ASUS ROG Zephyrus G14 2022 GA402RJ pci passthrough

ASUS ROG Zephyrus G14 2022 GA402RJ pci passthrough

This is a record for my own passthrough setup, I can finally use a single laptop for windows gaming and linux programming at the same time.

The device

My G14 is GA402RJ(6800HS + 6700s) with MT7922 WiFi/BT card.

At this time, BIOS version is 309.

@Pastitas
Pastitas / HibernateNotes.md
Last active September 6, 2023 06:57
Auto hibernate reboot to windows and fancontrol scritp

Enable hibernate and reboot into windows for dual booting

sudo vim /usr/lib/systemd/system-sleep/windows

#!/bin/bash

# Enable the use of hybrid-sleep for hibernate/reboot into windows when dual booting.
# requires the flag HybridSleepMode=reboot to be enabled in /etc/systemd/sleep.conf
# and grub-reboot to be installed
@da-n
da-n / usb-unlock-luks.md
Created August 24, 2019 13:11
Unlock LUKS full disk with USB stick

Configuration for passwordless root filesystem

Source: https://www.howtoforge.com/tutorial/passwordless-encryption-of-linux-root-partition/

The process of entering the passphrase at boot time will now be automated using an USB memory stick. Instead of using a passphrase , the secret key on the USB will decrypt the encrypted volumes. Connect an USB stick to the VM and locate it using the dmesg command. It is detected as /dev/sdb in my VM.

The secret key of 8192 random byte is extracted from the usb stick using the dd command.

dd if=/dev/sdb of=/root/secret.key bs=512 skip=4 count=16
@mortie
mortie / auto-screen-rotate.sh
Created November 17, 2018 13:32
Automatically rotate the screen.
#!/bin/sh
# Automatically rotate the screen when the device's orientation changes.
# Use 'xrandr' to get the correct display for the first argument (for example, "eDP-1"),
# and 'xinput' to get the correct input element for your touch screen, if applicable
# (for example, "Wacom HID 486A Finger").
#
# The script depends on the monitor-sensor program from the iio-sensor-proxy package.
if [ -z "$1" ]; then