Skip to content

Instantly share code, notes, and snippets.


Casper Bruun bmcbm

View GitHub Profile
bmcbm /
Created Jan 12, 2021
Reparer Ubuntu på LUKS krypteret harddisk

Reparer Ubuntu

Hvis Ubuntu ikke kan startes og fx blot efterlader opstarten i en (initramfs) prompt, kan disse skridt hjælpe med at reparere systemet.

I dette eksempel er systemet installeret på en 1TB M2 SSD (/dev/nvme0n1) med LUKS og LVM.

Live USB boot

Boot systemet på en Live CD/USB

# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf
bmcbm / .bash_aliases
Last active Apr 4, 2018
# Timestamped, Git enabled Prompt
View .bash_aliases
# Timestamped, Git enabled Prompt
export PS1='\[\e[01;30m\]\t\[\033[01;32m\] \u\[\e[0m\]@\[\e[01;95m\]\h\[\033[00m\]:\[\e[01;34m\]\w\[\e[00m\]`[[ $(git status 2> /dev/null) =~ Changes\ to\ be\ committed: ]] && echo "\[\e[38;5;202m\]" || echo "\[\e[31m\]"``[[ $(git status 2> /dev/null) =~ untracked\ files\ present ]] && echo "\[\e[33m\]"``[[ ! $(git status 2> /dev/null) =~ nothing\ to\ commit,\ working\ .+\ clean ]] || echo "\[\e[32m\]"`$(__git_ps1 "(%s)")\[\e[00m\]\$ '
bmcbm / .emacs
Last active Jan 16, 2018
.emacs file
View .emacs
;; Sæt (netværks)printer sti
;(setq lpr-switches nil) ; Stop printing headers
;(setq printer-name "HPLJ6MP")
;; start gnuserv stuff. Put it up front so you don't get into a
;; timeout problem when starting emacs from gnuclient or gnudoit,
;; according to Cristian Ionescu-Idbohrn
bmcbm /
Last active Nov 25, 2020
Gnome3 Unity settings
# Add date and weekeday to clock to Gnome Shell
gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.desktop.interface clock-show-weekday true
# Move window control buttons to the left, Unity Style
gsettings set org.gnome.desktop.wm.preferences button-layout close,minimize,maximize:
# Move show application button from bottom of dash to top
bmcbm / .bash_aliases
Last active Feb 1, 2018
Add scp and snapshot (ie. shorthand for vboxmanage snapshot) to vagrant command
View .bash_aliases
function vagrant() {
if [ -x /usr/bin/vagrant ] ; then
if [ "$1" = 'scp' ]; then
# Inspired by
HOST=$( echo "${@: -1}" | cut -d: -f1)
/usr/bin/vagrant ssh-config $HOST > $TMPFILE
if [ $? -eq 0 ] ; then