Skip to content

Instantly share code, notes, and snippets.

View purpleidea's full-sized avatar

James purpleidea

View GitHub Profile
@purpleidea
purpleidea / toggle_jobs.bash
Created July 3, 2024 01:06 — forked from sebastiancarlos/toggle_jobs.bash
Toggle between the last two jobs in Bash by pressing "Ctrl-Z Ctrl-Z" (Or toggle between the shell and your single job by pressing "Ctrl-Z")
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/0zx4uSBUt_k
# Add this somewhere in your ~/.bashrc
# Use bash-preexec.sh (https://github.com/rcaloras/bash-preexec) to:
# - disable the Ctrl-Z keybinding before printing the prompt
# - enable the Ctrl-Z keybinding before executing a command
#
@purpleidea
purpleidea / gzip.go
Created September 4, 2024 01:10
Simple golang gzip compression
// Thanks purpleidea for putting this together!
// Why isn't this the default example in the golang docs?
package main
import (
"compress/gzip"
"fmt"
"io"
"os"
)
# ssh-keygen overwrites the .pub portion without asking
# i guess this is fine, but it surprised me
[root@fedora ~]# /usr/bin/ssh-keygen -t rsa -f /root/.ssh/id_rsa -N ''
Generating public/private rsa key pair.
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
Dear #mgmtconfig hackers
I have a small prototype of a simple container scheduler built entirely with mcl. It's not 100% polished yet, so I'd like some early design feedback before I publish it.
(Note it schedules "containers" but that resource could be "vm" or something different.)
Please let me know:
(1) If you are using or have used a container scheduler, preferably with not overly complicated needs.
(2) Would be interested in trying a basic container scheduler built with mgmt+mcl.
(3) Preferably have some knowledge of "scheduling" in this context, since I have a few pointed scheduling/work-distribution type questions that I'd love to learn a bit from you on.
@purpleidea
purpleidea / gist:81432a790c06d7afbfe4e6ebe0e209e6
Created December 3, 2025 01:14
dmidecode/lshw buggy r8168/r8169 on recent kernels
DMIDECODE
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.
Table at 0x000EBF40.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: American Megatrends Inc.