Skip to content

Instantly share code, notes, and snippets.

View fcicq's full-sized avatar

fcicq fcicq

View GitHub Profile
@fcicq
fcicq / jetson-nano-kvm-gic.patch
Last active August 31, 2020 01:40
enable GIC for kvm for Jetson Nano (tegra210), make sure you edit /boot/extlinux/extlinux.conf, add "FDT /boot/tegra210-p3448-XXXX-p3449-XXXX-XXX.dtb"
--- a/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi 2020-08-31 08:40:36.602176618 +0800
+++ b/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi 2020-08-31 08:41:45.223679918 +0800
@@ -351,7 +351,10 @@
#interrupt-cells = <3>;
interrupt-controller;
reg = <0x0 0x50041000 0x0 0x1000
- 0x0 0x50042000 0x0 0x0100>;
+ 0x0 0x50042000 0x0 0x2000
+ 0x0 0x50044000 0x0 0x2000
+ 0x0 0x50046000 0x0 0x2000>;
#!/bin/sh
for file in "$@"; do
[ ! -f "$file" ] && continue
t="$(file "$file" --mime-type -b)"
if [ "$t" = "video/x-ms-asf" ]; then
mv -i "$file" "${file%.*}.wmv"
fi
if [ "$t" = "video/mp4" ]; then
mv -i "$file" "${file%.*}.mp4"
fi
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 3f649c9..6efa40f 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -456,6 +456,13 @@
MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+ #
+ # ATA/AHCI Driver
--- a/hw/usb/dev-network.c 2020-05-28 00:00:00.000000000 +0800
+++ b/hw/usb/dev-network.c 2020-05-28 00:00:00.000000000 +0000
@@ -47,8 +47,8 @@
/* For hardware that can talk RNDIS and either of the above protocols,
* use this ID ... the windows INF files will know it.
*/
-#define RNDIS_VENDOR_NUM 0x0525 /* NetChip */
-#define RNDIS_PRODUCT_NUM 0xa4a2 /* Ethernet/RNDIS Gadget */
+#define RNDIS_VENDOR_NUM 0x04b3 /* IBM */
+#define RNDIS_PRODUCT_NUM 0x4010 /* Ethernet/RNDIS Gadget */
@fcicq
fcicq / qemu-sendkey-translation-sed.sh
Last active May 28, 2020 22:08
translation strings to sendkey. note: missing many symbols. check sendkey <tab>
-e 's/\([A-Z]\)/%shift-\1%/g' \
-e 's/\\/%backslash%/g' -e 's/\//%slash%/g' \
-e 's/,/%comma%/g' -e 's/</%shift-comma%/g' \
-e 's/\./%dot%/g' -e 's/>/%shift-dot%/g' \
-e "s/'/%apostrophe%/g" -e 's/\"/%shift-apostrophe%/g' \
-e 's/:/%shift-semicolon%/g' \
-e 's/_/%shift-minus%/g' \
-e 's/+/%shift-equal%/g' -e 's/=/%equal%/g' \
-e 's/#/%shift-3%/g' \
-e 's/&/%shift-7%/g' \
@fcicq
fcicq / iconv-cp1252-sjis.ps1
Last active May 8, 2020 06:17
powershell convert cp1252 to sjis. same as iconv -f utf8 -t windows-1252 | iconv -f sjis
$cp1252 = [System.Text.Encoding]::GetEncoding(1252);
$cp932 = [System.Text.Encoding]::GetEncoding(932);
Read-Host "Input Mojibake" | foreach{ $cp932.getstring($cp1252.getbytes($_))}
@fcicq
fcicq / nginx.conf
Last active May 3, 2020 05:53
minimal nginx stream config, replace TARGET / LISTEN first. nginx -c PATH/to/conf
worker_processes 1; master_process off; daemon off; error_log /dev/null; pid /dev/null;
load_module /usr/lib/nginx/modules/ngx_stream_module.so;
events {}
stream { upstream u { server TARGET max_fails=0; server TARGET max_fails=0; } server { listen LISTEN; proxy_pass u; }}
REG ADD HKLM\SYSTEM\Setup /v SetupType /t REG_DWORD /d 0 /f
REG ADD HKLM\SYSTEM\Setup /v SetupPhase /t REG_DWORD /d 0 /f
REG ADD HKLM\SYSTEM\Setup /v OOBEInProgress /t REG_DWORD /d 0 /f
REG ADD HKLM\SYSTEM\Setup /v CmdLine /t REG_SZ /d "" /f
net user administrator /active:yes
@fcicq
fcicq / openwrt-revive-small-flash-default-ram-mount-with-etc-persistence.sh
Last active October 16, 2022 16:50
openwrt: revive 4MB flash devices! updated for 22.03
mkdir -p openwrt-rootfs/lib/preinit
[ ! -f openwrt-rootfs/lib/preinit/80_mount_root ] && cat <<'EOF' > openwrt-rootfs/lib/preinit/80_mount_root
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
ram_mount_root() {
echo "- ram overlay -"
rdev=$(find_mtd_part rootfs_data)
if [ -z "$rdev" ]; then
echo "- bad rdev -"
From c3f09abd9ad45ce453fec29c68af0e4c68f71e84 Mon Sep 17 00:00:00 2001
From: Nicholas Sherlock <[email protected]>
Date: Mon, 30 Apr 2018 12:59:13 +1200
Subject: [PATCH] Revert readonly pagetables introduced by 2ac1730 and 147fd35
---
.../Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 6 ------
.../Core/DxeIplPeim/X64/VirtualMemory.c | 6 ------
UefiCpuPkg/CpuDxe/CpuPageTable.c | 21 ++++++++++++-------
3 files changed, 13 insertions(+), 20 deletions(-)