Skip to content

Instantly share code, notes, and snippets.

View hansfn's full-sized avatar

Hans Fredrik Nordhaug hansfn

  • Brunvoll AS
  • Molde, Norway
  • X @hansfn
View GitHub Profile
@hansfn
hansfn / grub-menulst.sh
Last active April 19, 2023 13:24
A simple (g)awk script that lists the grub menu from the command line. Typically used when you use grub-set-default or grub-reboot. Tested with Grub 2 on Ubuntu 22.04. Assumes grub.cfg is well formed.
gawk 'BEGIN {
in_submenu=0
menuindex=0
}
# Skip lines not menu related
!/.*menu.*{.*/ { next; }
# Do the work for each menu line
{
@hansfn
hansfn / composer.bat.patch
Created August 8, 2017 20:55
Patch for fixing 'Could not open input file: composer.phar"' when running composer in Acquia Dev Desktop
--- composer.bat.orig 2017-08-08 22:25:55.769011700 +0200
+++ composer.bat 2017-08-08 22:42:33.878045000 +0200
@@ -1,2 +1,6 @@
-@SET PATH=C:\Development\AcquiaDevDesktop\php5_4;%PATH%
-php.exe composer.phar %*
+@echo off
+
+IF "%PHP_ID%"=="" (SET PHP_ID=php5_5)
+SET PATH=C:\Development\AcquiaDevDesktop\%PHP_ID%;%PATH%
+