Skip to content

Instantly share code, notes, and snippets.

View supechicken's full-sized avatar

SupeChicken666 supechicken

View GitHub Profile
@supechicken
supechicken / privileged-crostini.md
Created June 17, 2024 16:09
[Guide] Obtain full access to the underlying VM inside Crostini containers

Obtain full access to the underlying VM inside Crostini containers

Overview

As you might know, all Crostini containers are running under the "unprivileged container" mode and are kind of restricted, which means:

  • Unable to load any kernel modules
  • Unable to mount any disk/loopback images natively (although you could use FUSE to achieve a similar result, that's complicated to use)
  • Unable to setup device mappers

So what's the solution? This guide will cover things below:

@supechicken
supechicken / autologin-chromeos.md
Last active May 18, 2024 19:32
[Tutorial] Auto sign-in on ChromeOS startup

Auto sign-in on ChromeOS startup

Overview

In some scenarios, it is inconvenient/unnecessary to login with a password, for example, when using Chromebook as a home server or kiosk.

However, ChromeOS doesn't provide any way to enable auto-login or to disable the sign-in password (there was such a feature on macOS many years ago). And Google have no interest in adding this functionality also.

Recently I installed ChromeOS on my HTPC, planning to use it as a TV box (and the same trouble annoyed me). So I created a program to do it for me.

@supechicken
supechicken / build-termina-kernel.sh
Created March 3, 2024 17:35
Script snippet for building ChromeOS Crostini/Termina kernel
RELEASE=release-R123-15786.B-chromeos-6.1
LLVM_VERSION=18
curl -L https://apt.llvm.org/llvm.sh | sudo bash -s "${LLVM_VERSION}"
for f in clang clang++ ld.lld llvm-objdump llvm-ar llvm-nm llvm-strip llvm-objcopy llvm-readelf; do
sudo ln -sf $f-$LLVM_VERSION /usr/bin/$f
done
git clone https://chromium.googlesource.com/chromiumos/third_party/kernel.git -b ${RELEASE} --depth=1
@supechicken
supechicken / root_chromeos_arcvm.md
Last active January 13, 2024 12:46
[Tutorial] Root your ChromeOS Android subsystem w/ KernelSU (Android 11+)

Root your ChromeOS Android subsystem w/ KernelSU (Android 11+)

Note

This tutorial is also available on Reddit

Table of Contents

  • Overview

  • Notes

@supechicken
supechicken / root_mi_box_s_2nd_gen.md
Last active July 18, 2024 07:48
A tutorial for rooting Xiaomi TV Box S 2nd Gen (jaws) without UART/teardown

Rooting Xiaomi TV Box S 2nd Gen (jaws) without UART/teardown

Table of contents

  • Prerequisites
  • Step 1: Download the stock ROM for Xiaomi TV Box S 2nd Gen
  • Step 2: Extract boot image from the OTA archive
  • Step 3: Update the system with downloaded OTA archive
  • Step 4: Patch boot image with Magisk
  • Step 5: Unlock bootloader with fastboot
  • Step 6: Reboot to system and complete setup
@supechicken
supechicken / crosh-su
Last active March 6, 2024 12:08
A simple `su` client/daemon script for ChromeOS crosh shell
#!/usr/bin/env ruby
# CroshSU: "Fix" sudo in crosh by redirecting all sudo calls to VT-2 shell, inspired by root solutions on Android
#
# Usage: put this script into /usr/local/bin, run `crosh-su --daemon` in VT-2 and run
# some command with `crosh-su --client <command you want to run with root>` in crosh
#
require 'io/console'
require 'socket'
require 'pty'
require 'fileutils'
@supechicken
supechicken / build.sh
Last active October 14, 2023 05:44
My Linux kernel config for Mi 11T Pro
set -e
mkdir -p kernel && cd kernel
git clone --depth=1 https://github.com/Xiaomi-SM8350-Development/kernel_xiaomi_sm8350 .
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -
cat /mnt/c/Users/supec/Documents/*kernelsu*.diff | patch -p1
cp /mnt/c/Users/supec/Downloads/config.txt .config
sed -i 's/-ReBorn-11TPro/-SupeChicken666/' .config
@supechicken
supechicken / ani2ico.rb
Created August 19, 2023 06:19
My ani2ico implementation written in Ruby
#!/usr/bin/env ruby
MetaStruct = {
file_magic: :txt, # File magic, should be "RIFF"
payload_size: :int, # Size of the file (excluding the file magic)
riff_chunkType: :txt, # Should be "ACON"
riff_chunkID: :txt, # Should be "anih"
riff_chunkSize: :int, # Should be 36
@supechicken
supechicken / keybase.md
Created May 24, 2023 15:26
Keybase identity prove

Keybase proof

I hereby claim:

  • I am supechicken on github.
  • I am supechicken666 (https://keybase.io/supechicken666) on keybase.
  • I have a public key whose fingerprint is 8E44 2218 70D6 A51F 6680 E110 615E 32BA 9CA6 4A14

To claim this, I am signing this object:

@supechicken
supechicken / crew_archlinux_update.rb
Created February 26, 2023 18:52
Check chromebrew package update from archlinux repository
$LOAD_PATH << "#{Dir.pwd}/lib"
require 'package'
`grep -A1 '# Adapted from Arch Linux .* PKGBUILD at:' packages/*.rb`.split('--').map do |message|
message.strip.lines(chomp: true)[1].sub(/ # .*/, '').split('-# ', 2)
end.each do |pkgFile, archLink|
latest_ver = `curl -Ls '#{archLink.sub('blob', 'raw')}'`[/^pkgver=(.*)$/, 1]
current_ver = Package.load_package(pkgFile).version
puts "#{pkgFile}: current: #{current_ver}, latest: #{latest_ver}"