Skip to content

Instantly share code, notes, and snippets.

View supechicken's full-sized avatar

SupeChicken666 supechicken

View GitHub Profile
// loop
setInterval(()=>{
// simulate keyboard press
document.dispatchEvent(new KeyboardEvent('keydown',{'key':'a'}));
}, 1)
// that's it
@supechicken
supechicken / check_update_gnu.rb
Created December 17, 2021 16:46
Check update for all GNU packages in Chromebrew
# -*- encoding: UTF-8 -*-
$LOAD_PATH << '/usr/local/lib/crew/lib/'
require 'concurrent'
require 'fileutils'
require 'const'
require 'color'
gnu_pkg = `grep -l 'source_url.*\\.gnu\\.' /usr/local/lib/crew/packages/*.rb`.lines(chomp: true)
git_pkg = `grep -l "source_url.*\\.git['\\"]$" /usr/local/lib/crew/packages/*.rb`.lines(chomp: true)
@supechicken
supechicken / disable_verify.sh
Last active April 19, 2024 22:42
Script to disable rootFS verification on Chrome OS Flex/CloudReady 96+
#!/bin/bash -eu
# disable_verify.sh: Script to disable rootFS verification on Chrome OS Flex/CloudReady 96+
#
# Usage:
# curl -Ls 'https://gist.github.com/supechicken/ccf8bfad3be30dbcd144b46bc4d7083e/raw' | sudo bash -eu
[[ "${EUID}" != 0 ]] && echo -e "\e[1;31m"'Please run this script as root.'"\e[0m" && exit 1
# get disk device name which has Chrome OS installed to
cros_disk="$([[ "$(mount | grep '/mnt/stateful_partition')" =~ (sd[a-z]|nvme[0-9]n[0-9]p|mmcblk[0-9]p) ]] && \
@supechicken
supechicken / cros_custom_splash_screen.md
Created June 7, 2022 16:19
[Tutorial]: Custom boot splash screen/animation on Chrome/Chromium OS

Custom boot splash screen/animation on Chrome/Chromium OS

Before you start...

You can find tutorials about these online

  • Enable Chrome OS developer mode
  • Disable root filesystem verification, remount root filesystem as read/write

Steps

  • Pick a .gif image that you wish to be the boot splash animation
  • Go to https://ezgif.com/split, upload the .gif file
  • Select Output images in PNG format in Split options
@supechicken
supechicken / tar_remove_on_copy.c
Last active August 19, 2022 13:47
A simple C program that adds remove-on-copy support to "tar c | tar x" command
/*
remove_on_copy.c: Remove each file listed in tar archive once they sent to stdout
Usage:
stdin: Tar archive (only ustar format is supported) created by tar -c
stdout: Tar extract command (tar -x)
Option:
-v Enable verbose output
require 'fileutils'
loop do
print 'Commit: '
commit = $stdin.gets
system 'git', 'checkout', commit, chdir: 'platform2'
FileUtils.rm_rf %w[a b]
FileUtils.cp_r 'platform2/vm_tools/sommelier', 'a'
@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}"
@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 / 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 / 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