Skip to content

Instantly share code, notes, and snippets.

View nadiaholmquist's full-sized avatar

Nadia Holmquist Pedersen nadiaholmquist

View GitHub Profile
@nadiaholmquist
nadiaholmquist / gist:0e7c036ee309771e4f28
Last active August 29, 2015 14:10
Terminal color test script
#!/bin/bash
echo -e "\n" "\e[48;5;"{0..7}"m " "\e[0m\n" \
"\e[48;5;"{8..15}"m " "\e[0m" \
"\e[11C" "\e[48;5;"{232..255}"m " "\e[0m\n"
for i in {0..30..6}; do
echo -n " "
for j in {0..180..36}; do
for k in {0..5}; do
@nadiaholmquist
nadiaholmquist / update-steam-app-folder.sh
Created December 3, 2014 16:58
Script to update a Steam app folder in GNOME Shell
#!/bin/bash
# WARNING: This script is totally awful and it'll probably blow up if you are unlucky.
# You have been warned.
# NOTE: This script assumes that you've already created an app folder called "Steam".
# Don't forget to give it a name too.
cd ~/.local/share/applications
@nadiaholmquist
nadiaholmquist / mmclwjgl.sh
Last active June 26, 2020 16:44
MultiMC ARM LWJGL setup script
#!/bin/bash
set -eu
javaarch=
if which java 2> /dev/null > /dev/null; then
javaarch=$(java -version 2>&1 | grep -io "..-Bit" | cut -d- -f1)
fi
@nadiaholmquist
nadiaholmquist / Makefile
Created June 6, 2021 10:40
Little program to print the flags set on a file by name on macOS.
OUT := getflags
SDK := $(shell xcrun --show-sdk-path)
all: $(OUT)
clean:
rm flag_names.h $(OUT)
flag_names.h: flag_names.awk
awk -f $< "$(SDK)/usr/include/sys/stat.h" > $@
@nadiaholmquist
nadiaholmquist / 0-pam-touchid-setup.md
Last active June 26, 2024 00:09
Permanent setup for sudo with Touch ID for macOS

Permanent sudo Touch ID setup for macOS

Want to use Touch ID with sudo but annoyed that the change gets reset every time macOS updates? Here's a hacky solution to fix that!

Installation

  1. Compile pam-touchid-setup.c
    clang -o pam-touchid-setup pam-touchid-setup.c
    
@nadiaholmquist
nadiaholmquist / brew-cmake-update.rb
Created October 26, 2022 14:18
Small hacky script to update the CMake version pointed to in build directories created by Homebrew's CMake
#!/usr/bin/env ruby
if ARGV.size < 1 then
puts "Usage: #{$0} <build-dir>"
exit
end
build_dir=ARGV[0]
cmake_prefix=File.realpath(`brew --prefix cmake`.strip)
cellar_cmake_path=File.dirname(cmake_prefix)