Skip to content

Instantly share code, notes, and snippets.

View metzenseifner's full-sized avatar

Jonathan Lee Komar metzenseifner

  • The Alps
View GitHub Profile
@metzenseifner
metzenseifner / utm-arch-linux-installation-guide.md
Created August 9, 2022 13:49 — forked from Sam0230/utm-arch-linux-installation-guide.md
Installing Arch Linux ARM in a UTM virtual machine

Installing Arch Linux ARM in a UTM virtual machine

Steps:

  1. Create a new virtual machine.
  2. Go to System tab, change architecture to `ARM64 (aarch64)' and increase memory as needed.
  3. Download Alpine Linux LiveCD:
mirror=https://dl-cdn.alpinelinux.org/alpine
curl -o alpine-virt-latest-aarch64.iso "$mirror/latest-stable/releases/aarch64/$(curl "$mirror/latest-stable/releases/aarch64/latest-releases.yaml" | /usr/bin/grep -E 'file: alpine-virt-[0-9\.]+-aarch64\.iso' | head -n 1 | sed 's/ //g' | sed 's/\t//g' | sed 's/^file://')"
  1. Go to Drives tab, New Drive, set size to 20GiB or larger, then Inport Drive, choose the file you just downloaded.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\SESSIONNAME]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
backend should be alsa
change buffer delay from default to 0.50
make sure amixer volume is set at boot (i used a unit file)
set name to whatever, %H is hostname
[Unit]
Description="Set volume level."
After=sound.target
[Service]
Type=simple
ExecStart=/usr/bin/amixer sset PCM -- 97%
[Install]
WantedBy=multi-user.target
@metzenseifner
metzenseifner / get-lineendings.rb
Created June 30, 2017 06:13
Ruby Get Line Endings
#!/usr/bin/env ruby
ARGF.each do |line|
if $. == 1
if line =~ /\r\n$/
puts "CRLF"
elsif line =~/\n$/
puts "LF"
elsif line =~ /\r$/
puts "CR"
@metzenseifner
metzenseifner / ldconfig-fix.sh
Last active June 22, 2024 10:33
Fix ldconfig "file is empty, not checked" error
# --overwrite '*' whereby * means every file path; reinstall everything otherwise you might get "exists in filesystem" errors
pacman -Syyu $(pacman -Qnq) --overwrite '*'
SOURCE="/path/to/somewhere/" # slash means exclude "whatever" itself, but get everything underneath
DESTINATION="username@computer.local:/path/to/somewhere"
rsync -e 'ssh -p3022'\
--archive \
--compress \
--progress \
--partial \
--ignore-existing \
--human-readable \
"$SOURCE" \
@metzenseifner
metzenseifner / excel_iterate_cell_by_cell_both_variants.scpt
Last active June 9, 2017 16:01
Excel Iterate Cell by Cell Both Variants
tell application "Microsoft Excel"
set screen updating to false -- optimize performance
set range_selected to selection
-- setup ref vars for selection
set {range_selected_row_index, range_selected_column_index, range_selected_row_count, range_selected_column_count} to {get first row index of selection, get first column index of selection, get count rows of selection, get count columns of selection}
-- go row by row and iterate each column in each row
repeat with row_step from range_selected_row_index to range_selected_row_count -- row iteration
repeat with column_step from range_selected_column_index to range_selected_column_count -- column iteration
@metzenseifner
metzenseifner / excel_row_sequence_column_by_column.scpt
Created June 9, 2017 06:00
Excel Row Sequence Column by Column
tell application "Microsoft Excel"
set screen updating to false -- optimize performance
set range_selected to selection
-- setup ref vars for selection
tell selection to set {range_selected_row_index, range_selected_column_index, range_selected_row_count, range_selected_column_count} to {get first row index of selection, get first column index of selection, get count rows of selection, get count columns of selection}
-- go row by row and iterate each column in each row
repeat with row_step from range_row_index to range_row_count -- row iteration
repeat with column_step from range_column_index to range_column_count -- column iteration
@metzenseifner
metzenseifner / excel_optimize_performance_screen_updating_false.scpt
Created June 9, 2017 05:48
Excel Optimize Script Performance (Screen Updating)
tell application "Microsoft Excel"
set screen updating to false -- optimize performance