Skip to content

Instantly share code, notes, and snippets.

View UnconventionalMindset's full-sized avatar
👋
Ciao! :3

Jac UnconventionalMindset

👋
Ciao! :3
View GitHub Profile
@UnconventionalMindset
UnconventionalMindset / efi-restore.bat
Last active July 31, 2024 03:08
Restore Windows after recreating the EFI partition / BSOD 0xc0000001 / IO1 Initialization Failed
Rem This may mess up Linux GRUB. You might need to reinstall GRUB afterwards.
Rem Open Diskpart
diskpart
Rem Select your disk number, in my case #0
list disk
sel disk 0
Rem Select your disk number, in my case #2, you should recognize it by its size and by the filesystem (FAT32)
Set-NetFirewallProfile -DisabledInterfaceAliases "vEthernet (WSL (Hyper-V firewall))"
@UnconventionalMindset
UnconventionalMindset / codename.sh
Created January 9, 2024 11:00
Ubuntu get codename
#!/bin/bash
codename=$(lsb_release -c | sed 's/\(Codename:\s\)\(.*\)/\2/g')
echo "Ubuntu codename: ${codename}..."
$reboot
bash: /sbin/reboot: Input/output error
$shutdown -r now
bash: /sbin/shutdown: Input/output error
#
# if the above reboot commands doesn't work try either forced reboot or shutdown
#
{
"ignition": {
"version": "3.3.0"
},
"passwd": {
"users": [
{
"name": "core",
"sshAuthorizedKeys": [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCoPJQAHkfSRIfS05ptesdKwTX7ererHcTZ7pKWi7yUqOQv1e2xpfNBcfx/trwzITJe9N7bwp7t6gpPY2/yBr8F6TenigFWhDaF3Qi9kdSlv64eOsPv6iTg0URH7RE4RQwdArPuwAEBA79BOVoJ0qG/zgn0LOlqYGE/EameYxtgzDJNjXPWOi6OkPKhOEc00+wWGucsCw/8a6rzaMbQHn647yiS7XUJ9/QgMwZ5tqT+Fw/1dxzV4zrWK5MVEXlN5wRZEzukadPQJKyZhhhx3o7MqEVOsTHvyBln6NVJGFawQY7B+ffN/+9n6pEuskWCqngywqAvDXyRS7zD/Dxqv5pjzSQI2fkyuM21oRcKlSYx2AB4L46J6MRJ4ZLA5dhY0fwv868F5VFmJZ2AsDmaGFCqdXTMCv6VRnghJo75oybv+/eoV53NETrTeB4XsPOxSZOHmK93zJzGw2hT4X/ZTvyVbnCyU+Z4sg2iU8ZVE3pHJi8ZQ3hadW0N+CAAmVQ+zsE= nousername"
@UnconventionalMindset
UnconventionalMindset / coreos_embedded_ipxe.sh
Last active October 25, 2022 22:27
Embed Core OS installation to iPXE
#!/bin/bash
download_folder="ipxe"
install_script_url="https://gist.githubusercontent.com/UnconventionalMindset/f4ca2d66b943f916b5fecfad698b47ea/raw"
full_path="$HOME/${download_folder}"
[ -z $full_path ] && { echo "Error: download path is empty"; exit 1; } || echo "Download path set to: ${full_path}, continuing..."
apt -y install gcc binutils make perl liblzma-dev mtools genisoimage syslinux isolinux
@UnconventionalMindset
UnconventionalMindset / coreos-install.ipxe
Last active October 25, 2022 22:25
Script to embed to iPXE to run Fedora core OS from RAM
#!ipxe
set STREAM stable
set VERSION 36.20221001.3.0
set CONFIGURL https://raw.githubusercontent.com/UnconventionalMindset/coreos-setup/main/coreos.ign
set BASEURL https://builds.coreos.fedoraproject.org/prod/streams/${STREAM}/builds/${VERSION}/x86_64
dhcp
@UnconventionalMindset
UnconventionalMindset / embed.ps1
Last active October 26, 2022 12:46
Script to embed an ignite (.ign) to a Fedora Core OS iso.
$latest = "https://builds.coreos.fedoraproject.org/prod/streams/next/builds/36.20220906.1.0/x86_64/fedora-coreos-36.20220906.1.0-live.x86_64.iso"
$path = "C:\coreos-setup\"
$iso = "coreos-latest.iso"
$ign = "install.ign"
curl -o ${path}${iso} ${latest}
curl -o ${path}${ign} https://raw.githubusercontent.com/UnconventionalMindset/coreos-setup/main/install.ign
docker run -i `
-v ${path}${iso}:/$iso `
-v ${path}${ign}:/$ign `
quay.io/coreos/coreos-installer:latest `
@UnconventionalMindset
UnconventionalMindset / privateField.scala
Created February 2, 2022 02:05
Get Private field in Scala for debugging purposes
def privateField[A](obj: AnyRef, fieldName: String): A = {
val f = obj.getClass.getDeclaredField(fieldName)
f.setAccessible(true)
f.get(obj).asInstanceOf[A]
}
@UnconventionalMindset
UnconventionalMindset / arch.md
Last active July 27, 2024 04:57
My Arch setup

My Arch setup

Pre-installation

  • Make sure EFI partition is of 550 MB
  • Microsoft Reserved Partition can be deleted (is created to reserve a portion of disk space for possible subsequent use by a Windows operating system installed on a separate partition)
  • Turn encryption off when moving windows main partition
  • Keep the windows' bitlocker recovery key with you
  • Use AOMEI partition assistant to manage partitions on windows
  • Disable secure boot
  • Disable Intel RAID and select AHCI

Installation