Skip to content

Instantly share code, notes, and snippets.

View coughingmouse's full-sized avatar

Iso Lee coughingmouse

  • Seoul, People's Republic of Korea
View GitHub Profile
@coughingmouse
coughingmouse / cloud-localds
Last active February 6, 2024 05:08
Cloud-utils cloud-localds for macOS (GPLv3): converts user data such as default password for Ubuntu cloud images
#!/bin/bash
# Copyright (C) Canonical, Iso Lee
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program.
@coughingmouse
coughingmouse / download-cloud-localds.sh
Created February 6, 2024 05:00
Generation of Canonical cloud-utils cloud-localds on macOS with homebrew (OS X)
#!/bin/zsh
brew install cdrtools curl
curl -fsSL https://raw.githubusercontent.com/canonical/cloud-utils/main/bin/cloud-localds -o cloud-localds
sed -i '' -e 's/genisoimage/mkisofs/g' cloud-localds
sed -i '' -e 's/.*confused by additional args/\[ \$\# \-le 9 \] \|\| bad_Usage \"confused by additional args/g' cloud-localds
sed -i '' -e 's/output\=\$1/output\=\$7/' cloud-localds
sed -i '' -e 's/userdata\=$2/userdata\=\$8/' cloud-localds
sed -i '' -e 's/metadata\=$3/metadata\=\$9/' cloud-localds
chmod +x cloud-localds
@coughingmouse
coughingmouse / reverse_scroll.ps1
Last active January 30, 2024 09:33
Reverse Scroll on Windows (Applies instantly; no restart needed, applies to all current devices)
# Written by Jason Go
# From https://answers.microsoft.com/en-us/windows/forum/all/reverse-mouse-wheel-scroll/657c4537-f346-4b8b-99f8-9e1f52cd94c2
# Run as administrator on Powershell
$mode = Read-host "How do you like your mouse scroll (0 for Windows or 1 for Mac)?";
Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)";
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode;
"+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n";
Disable-PnpDevice -InstanceId "$($_.DeviceID)" -Confirm:$false;
Enable-PnpDevice -InstanceId "$($_.DeviceID)" -Confirm:$false}
@coughingmouse
coughingmouse / Download Sehjong Xanqwuqe.py
Last active May 9, 2023 21:10
Downloads PDF file of Sehjong Xanqwuqe book from online ebook format
"""
Copyright (c) 2022-2023 Iso Lee
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software