Skip to content

Instantly share code, notes, and snippets.

@bulletinmybeard
bulletinmybeard / fix-for-sudo-command-error-unable-to-initialize-pam-no-such-file-or-directory.md
Last active June 12, 2024 02:47
macOS - Fix for sudo command error: "unable to initialize PAM: No such file or directory" (Intel+M1)

In most cases, the sudo command displays the error unable to initialize PAM: No such file or directory mostly appears when the pluggable authentication module file /etc/pam.d/sudo has been edited with a typo or an incorrect PAM module.

Via Single-User-Mode > Terminal

If you have an older Mac, you can boot into single-user mode, which allows you to access the command line mode of macOS directly, bypassing the UI.

  • Press and hold down the COMMAND + S keys until you see commands being executed in the Terminal.

  • Open the sudo file with vi /Volumes/Macintosh\ - Data/etc/pam.d/, fix what's wrong, save and close the file by switching from INSERT to the COMMAND mode with the ESC key, type :wq!, and hit enter.

@niw
niw / README.en.md
Last active June 15, 2024 20:25
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@jthodge
jthodge / universal-switcher
Created September 6, 2020 22:07
Show macOS app switcher across all monitors
defaults write com.apple.Dock appswitcher-all-displays -bool true
killall Dock
@tap52384
tap52384 / readme.md
Last active January 10, 2023 23:38
Bootcamp via Virtualbox 5.2 on macOS Mojave
@jimfoltz
jimfoltz / tw5-server.rb
Last active February 26, 2024 02:18
A local server for TiddlyWiki5 that allows saving wiki.
require 'webrick'
require 'fileutils'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
else
root = '.'
end
BACKUP_DIR = 'bak'
@joernchen
joernchen / Wir sind Admins - Gentoo.txt
Created October 22, 2017 19:05
Wir sind Admins - Gentoo // Written by @astera and @joernchen in 2010
Komm mal ins RZ komm her zu mir
Siehst du da drüben gleich da hinten im Netzwerkraum
Ja da drüben in dem Rack vorm Storage haben sie
unsre Patches in'n Kernel gehaun
Komm an den Bildschirm komm her zu mir
Überall nur Skripte und Pakete halb compiled
Sieht so aus als hätten die unser Gentoo heute Nacht
schon ohne uns verteilt
@sam217pa
sam217pa / tufte-book.tex
Last active March 2, 2021 21:57
a template to export from org-mode to latex
\usepackage[scaled=0.95]{roboto}
\usepackage{mathpazo}
\linespread{1.05}
\usepackage{eulervm}
\usepackage[usenames]{xcolor}
%% footnote color
\renewcommand{\thefootnote}{\textcolor{Gray}{\arabic{footnote}}}
\makeatletter
@pce
pce / homebank_csv.rb
Created August 27, 2014 09:26
ing-diba export format umsatz.csv -> homebank-import.csv ("Buchung";"Valuta";"Auftraggeber/Empfänger";"Buchungstext";"Verwendungszweck";"Betrag";"Währung";"Saldo";"Währung" -> date ; paymode ; info ; payee ; description ; amount ; category )
#!/usr/bin/ruby
require 'csv'
bank_csv = Array.new
CSV.foreach("umsatz.csv", { :col_sep => ";" }) do |row|
bank_csv << [row[0].gsub(".", "-"), 0, row[4], row[2], row[4], row[5].gsub(",", "."), row[3]]
end
CSV.open("homebank-import.csv", "wb", { :col_sep => ";" }) do |csv|