Skip to content

Instantly share code, notes, and snippets.

View rikka0w0's full-sized avatar

Rikka0_0小六花 rikka0w0

  • UNSW
  • Sydney
View GitHub Profile
@rikka0w0
rikka0w0 / Win11_22H2_Menu_Contrast.md
Last active September 22, 2023 08:30
Improve visibility of Win11 22H2 context menu
  1. Download mssstyleEditor and install UxThemePatcher, then reboot.
  2. Open the msstyle to be patched, usually C:\Windows\Resources\Themes\colored\colored.msstyles or C:\Windows\Resources\Themes\aero\aero.msstyle, no need to make a backup, as the software wont overwrite the existing one.
  3. Replace the image of Part 27 in "Menu" and POPUPITEM in "ImmersiveStart::Menu".
  4. Change the FILLCOLOR of 2-Hot to white (0,0,0)
  5. Save the modified msstyles to somewhere else
  6. Make a copy of the system one
  7. Replace the system one
  8. Swith to the new theme, and done!

Note:

@rikka0w0
rikka0w0 / ip6_pub.sh
Created June 15, 2022 07:30
Get public ipv6 addr
ip -f inet6 addr show br0 | sed -En -e 's/.*inet6 (([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/\1/p' | grep -v ^fe80 | grep -v ^fdea | grep -v temporary | grep -v mngtmpaddr
@rikka0w0
rikka0w0 / readme.md
Created May 17, 2022 16:10
QEMU KVM + Pulseaudio

By default, pulseaudio will only be available to the current login user. If running the QEMU as the root user, the audio will not be available. The common error thrown by QEMU looks like this: Could not init 'pa' audio driver. The following step sets up a globally accessible Unix socket for the other users to access the audio interface. Note that any user on this PC will be able to use it, hence if you really worry about the security issue, please consider assigning an user group to the socket and restrict its access(load-module module-native-protocol-unix auth-group=sharepulse socket=/tmp/pulseaudio.sock).

  1. Edit /etc/pulse/default.pa. Look for a line starts with load-module module-native-protocol-unix and change it to load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/pulseaudio.sock.
  2. Edit /etc/pulse/client.conf. Change/add: default-server = unix:/tmp/pulseaudio.sock and autospawn = no.
  3. Copy /home/CURRENT_USER/.config/pulse/cookie to `/root/.config/pulse/cooki
@rikka0w0
rikka0w0 / backtrace.txt
Created February 28, 2022 15:56
ad22_wine7.2_simbeor_crash
couldn't load main module (0)
Unhandled exception: C++ exception(object = 00000001AE0AF9F0, type = 000000016435AEE8, base = 000000015DB20000) in 64-bit code (0x000000007b011a5e).
Register dump:
rip:000000007b011a5e rsp:00000001ae0af880 rbp:00000001ae0af9c0 eflags:00000202 ( - -- I - - - )
rax:00000001ae0af8c0 rbx:000000016435aee8 rcx:00000001ae0af8a0 rdx:0000000000000001
rsi:00000001ae0af9c0 rdi:00000001ae0af8e0 r8:0000000000000004 r9:00000001ae0af9a0 r10:0000000000000001
r11:0000000000440138 r12:0000000000000000 r13:0000000000000000 r14:00000001ae0afc78 r15:00000001a62fb9f0
Stack dump:
0x00000001ae0af880: 00000001ae0af8a0 000000017002b4a8
0x00000001ae0af890: 0000000000000079 000000017005f824
@rikka0w0
rikka0w0 / Readme.md
Last active February 24, 2025 16:39
Use Saleae 16 in Sigrok Pulseview

Use Saleae 16 in Sigrok Pulseview

Ubuntu (Tested on Kubuntu 20.04): sudo apt install -y sigrok pulseview

Steps

  1. Go to http://sigrok.org/gitweb/?p=sigrok-util.git;a=tree;f=firmware/saleae-logic16
  2. Download parseelf.py and sigrok-fwextract-saleae-logic16
  3. Download "Logic 1.2.10 Linux 64-bit"from Saleae and extract the file Logic from the archive to the same folder as the above two files.
  4. (Make sure you have python installed) ./sigrok-fwextract-saleae-logic16 Logic
  5. Copy the generated ".bitstream" and ".fw" files to /usr/share/sigrok-firmware or any other firmware search paths.
@rikka0w0
rikka0w0 / Readme.md
Created February 10, 2022 17:44
CCS11.1 on Java 17

The following steps have been tested on Kubuntu 20.04 with Oracle JDK 17. The original JRE (folder) shipped with CCS has been deleted.

Nashron JavaScript is missing since Java 15

Use standalone Nashron from OpenJDK. Create a folder named "nashorn" in the same folder with "ccstudio" and "eclipse", unzip the jars into the newly created folder. Edit "./ccs1110/ccs/eclipse/plugins/com.ti.dvt.control.engine_4.1.0.202105121547/META-INF/MANIFEST.MF", so that the final file looks like this:

Manifest-Version: 1.0
Bundle-SymbolicName: com.ti.dvt.control.engine;singleton:=true
Require-Bundle: com.ti.dvt.core,com.ti.dvt.datamodel;visibility:=reexp
 ort,org.apache.ant;visibility:=reexport,org.eclipse.ant.core;visibili
@rikka0w0
rikka0w0 / gtk.css
Last active February 16, 2022 14:55
Makes Eclipse and other GTK3 apps more compact, for small screens
@import 'colors.css';
scrollbar {
-GtkScrollbar-has-backward-stepper: false;
-GtkScrollbar-has-forward-stepper: false;
}
menubar > menuitem, .menubar > menuitem {
padding: 1px 5px;
}
@rikka0w0
rikka0w0 / dell.c
Last active April 19, 2025 20:34
Emulate Dell chargers with ESP-01 module
/*
* Example-Code that emulates a DS2502 - 1kbit EEPROM as a dell power supply
*
* Tested with
* - dell notebook https://forum.pjrc.com/threads/33640-Teensy-2-OneWire-Slave
* - DS9490R-Master, atmega328@16MHz as Slave
* - Arduino ProMini clone
* - esp8266
*
* OneWire messaging starts when AC adapter is plugged to notebook,
#!/bin/ash
# This script will draw color gradient on the framebuffer
# http://seenaburns.com/2018/04/04/writing-to-the-framebuffer/
# fbset --show
# cat /sys/class/graphics/fb0/bits_per_pixel
fbdev=/dev/fb0
width=320
height=240
@rikka0w0
rikka0w0 / buildcrossgcc.sh
Last active May 14, 2025 12:23 — forked from tautologico/buildcrossgcc.sh
Build gcc cross-compiler for armv7l (arm-linux-gnueabi)
#!/bin/sh
mkdir ~/tmp
cd ~/tmp
# See
# Typical ARM triples (see "armv7l-linux-gnueabi")
# https://bgamari.github.io/posts/2019-06-12-arm-terminology.html
# GCC -march options
# https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html