Skip to content

Instantly share code, notes, and snippets.

@Raltar
Raltar / gist:586be522a0f3ddf2a52c5ba71533bdfc
Created May 6, 2023 02:13
Ubuntu 22.04 on Asus ROG Zephyrus G14 (2023 Version)
Here are my notes on how to set up an Asus ROG Zephyrus G14 2023 edition (with Ryzen 7940HX and Nvidia 4060) with Ubuntu 22.04
Thanks and respect to Vijay Prema whose earlier guide to the 2021 version of this laptop would have saved me a lot of time if I'd read it earlier. It still contains great info and is the inspiration for this 2023 version.
https://gist.github.com/vijay-prema/cfcf8cc4085663b7bb48f34172c10629
Currently I have most everything functioning correctly EXCEPT:
- It doesn't seem to bring video back after waking up from suspend. Currently I have to hold down the button to force it to turn off then reboot any time it suspends, so for now I just disable automatic suspension.
- NVIDIA-Prime, the plugin that lets you select between Ryzen integrated and Nvidia discrete graphics works only from the command line and with a reboot. It does not show up in the Nvidia control panel, and when it's in dynamic mode, it always seems to activate the Nvidia discrete graphics. The command-line selection
@woctezuma
woctezuma / while_true_learn.md
Created December 5, 2021 17:51
Promo codes for while True: learn()
  • 1111
  • 4game
  • aavak
  • alien
  • also_ghost
  • aypierre
  • backtowtl
  • bathyscaphe
  • batiskaf
  • big_cat
@allysonsilva
allysonsilva / Full-Markdown.md
Last active September 17, 2025 20:11
⚡️ Full Markdown Example

Headers

# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
@dideler
dideler / 0-startup-overview.md
Last active September 17, 2025 20:11
Startup Engineering notes
@ejbills
ejbills / main.swift
Last active September 17, 2025 20:10
Get the dock position, height and width in a MacOS Swift Cocoa app
import Cocoa
enum DockPosition {
case bottom
case left
case right
case unknown
}
class DockUtils {
@iraj-zahedi
iraj-zahedi / gist:d13f298071df8bcd2586f8482f132f16
Created September 17, 2025 08:04
change ssh port script
#!/bin/bash
# A robust script to change the SSH port on various systemd-based Linux distributions
# including Ubuntu (20.04+), Debian, AlmaLinux (8, 9, 10), and others.
# --- Ensure the script is run as root ---
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root."
exit 1
fi
@ThoNohT
ThoNohT / dehaskell.md
Last active September 17, 2025 20:08
Cleaning haskell packages from pacman

Cleaning up haskell packages on Arch Linux

In Arch Linux, all haskell packages are dynamically linked. This can be a headache for the user, since it results in a large amount of haskell-* packages being installed on your system, and the possibility for version conflicts. A way around this is to not depend on pacman at all for haskell packages, but manually install them. In this document I explain how I switched from a lot of haskell packages installed with pacman, to a few manually installed packages.

Finding packages to uninstall

To determine which packages to uninstall (and replace), a few tools are useful:

  • pacman itself
  • pacgraph
@banjun
banjun / UserActivityWindowGroup.swift
Last active September 17, 2025 20:07
Open new window on drop UserActivity
import SwiftUI
// prerequisites in Info.plist: NSUserActivityTypes contains type, UIApplicationSceneManifest/UIApplicationSupportsMultipleScenes = YES
// accepts NSUserActivity.targetContentIdentifier = type
// see also: https://developer.apple.com/documentation/swiftui/scene/handlesexternalevents(matching:)
struct UserActivityWindowGroup<Content: View, Payload: Codable>: Scene {
var type: String
@ViewBuilder var content: (Payload) -> Content
init(type: String, payloadType: Payload.Type, @ViewBuilder content: @escaping (Payload) -> Content) {
@tomlankhorst
tomlankhorst / docker-swarm-gpu.md
Last active September 17, 2025 20:03
Instructions for Docker swarm with GPUs
@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation