Skip to content

Instantly share code, notes, and snippets.

View imabug's full-sized avatar

Eugene Mah imabug

View GitHub Profile
@imabug
imabug / gist:e1dd3ade3975c691ba1474bba3165559
Created June 14, 2025 01:11
Fedora rescue kernel refresh
sudo rm -f /boot/*-rescue-*
sudo kernel-install add $(uname -r) /lib/modules/$(uname -r)/vmlinuz
Sometimes when updating the kernel in Fedora, the initramfs doesn't get built for some reason. To force a rebuild,
sudo dracut --force --kver <kernel>
where <kernel> is the kernel version to build the initramfs for.
@imabug
imabug / starship.toml
Created October 21, 2024 22:21
starship.toml
# Don't print a new line at the start of the prompt
add_newline = false
[c]
format = '\[[$symbol($version(-$name))]($style)\]'
symbol = " "
[character]
error_symbol = "[✖](bold red)"
@imabug
imabug / set-chroot.sh
Created August 8, 2024 22:45 — forked from Tamal/set-chroot.sh
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.
@imabug
imabug / TG270-TR.ijm
Created May 24, 2021 03:59
AAPM Report 270 ImageJ macros
// Use this code to generate a series of temporal resolution images for an animated gif
// Define the size of the frame
vsize = 1024;
hsize = 1024;
// Define a scalar to adjust from the default size
vsc = vsize/1024;
hsc = hsize/1024;
@imabug
imabug / VBA printer listing
Last active June 21, 2019 15:57
Get a list of installed printers using VBA
'Needed to get a list of installed printers and their ports on a Windows 7 machine
'Based on code from https://docs.microsoft.com/en-us/office/vba/access/concepts/printing/retrieve-a-list-of-installed-printers
Option Compare Database
Sub ShowPrinters()
Dim strCount As String
Dim strMsg As String
Dim prtLoop As Printer
Dim fileNum As Integer
@imabug
imabug / calendar.blade.php
Last active January 25, 2018 13:09
calendar.blade.php
<script type="text/javascript">
google.charts.load("current", {packages:["calendar"]});
chart = google.charts.setOnLoadCallback(drawChart);
var {{ $model->id }};
function drawChart() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'date', id: 'Date'});
dataTable.addColumn({ type: 'number', id: '{!! $model->element_label !!}'});
dataTable.addRows([
@for ($i = 0; $i < count($model->values); $i++)
@imabug
imabug / keybase.md
Last active October 18, 2018 12:07

Keybase proof

I hereby claim:

  • I am imabug on github.
  • I am imabug (https://keybase.io/imabug) on keybase.
  • I have a public key whose fingerprint is 7067 1058 B7E3 7E83 1992 118A 56B7 05CA E954 2BB8

To claim this, I am signing this object:

#/usr/bin/env bash
# Install some pacakages we'll need to compile the driver below.
sudo dnf install gcc kernel-devel -y
# Create working dir for Broadcom driver files and patches.
mkdir hybrid_wl_f23
# Change to working dir.
cd hybrid_wl_f23