Skip to content

Instantly share code, notes, and snippets.

View RinGotou's full-sized avatar
🌽
BUSYYYYYYYYYYY

Rin RinGotou

🌽
BUSYYYYYYYYYYY
  • Daydream Interactive/百花屋
View GitHub Profile
@sorz
sorz / check_release.py
Last active May 12, 2018 13:57
Sending new release notification (via email) for GitHub repos.
#!/usr/bin/env python3
"""GitHub New Release Checker
./check_release.py path/to/releases.ini
It fetches release tag from GitHub, then comparing it with the
old one in ini file. If tag changed, send a email to configured
address.
"""
import re
<?xml version="1.0" encoding="utf-8"?>
<spnOverrides>
<!-- Korea -->
<spnOverride numeric="45005" spn_display_rule="SPN_RULE_SHOW_PLMN" />
<!-- Japan -->
<spnOverride numeric="44010" spn_display_rule="SPN_RULE_SHOW_PLMN" />
<spnOverride numeric="44020" spn="SoftBank" />
<!-- Hong Kong -->
<spnOverride numeric="45406" spn="SmarTone" />
# This function will automate grep CMD($1) windows and set OPACITY($2).
transparent_windows() {
for i in $(pgrep -f $1); do
for j in $(/usr/bin/xdotool search --pid $i); do
xprop -id $j -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY $(printf 0x%x $((0xffffffff * $2 / 100)));
done
done
}
# Give vscode an alias.

Minecraft on Apple Silicon

In this gist, you can find the steps to run Minecraft 1.16.4 natively on Apple Silicon (AS), without needing Rosetta 2 translation of the dependencies (mainly LWJGL and related libraries).

While it's possible to use a launcher like MultiMC to have a prettier way to run the game on AS, it requires installing even more dependencies (like QT) which take time and are difficult to distribute. Therefore, I've put together a command line-based launcher tool using a couple shell & Python scripts.

To get up and running quickly, follow the steps below. Otherwise, for more detail, watch my YouTube video.

Download my package

@grenade
grenade / disable-windefend.ps1
Created November 28, 2018 17:53
Disable Windows Defender
Set-ItemProperty -path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender' -name 'DisableConfig' -type 'Dword' -value 1
Set-ItemProperty -path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender' -name 'DisableAntiSpyware' -type 'Dword' -value 1
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\wscsvc' -name 'Start' -type 'Dword' -value 4
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\SecurityHealthService' -name 'Start' -type 'Dword' -value 4
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Sense' -name 'Start' -type 'Dword' -value 4
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\WdBoot' -name 'Start' -type 'Dword' -value 4
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\WdFilter' -name 'Start' -type 'Dword' -value 4
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\WdNisDrv' -name 'Start' -type 'Dword' -value 4
Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc' -name 'Start' -type 'Dword' -v
@CombinedEffort
CombinedEffort / readme.en.md
Last active January 28, 2024 20:58
How to run Windows 11 on ARM in QEMU 6.1 on Apple Silicon Mac

How to run Windows 11 on ARM in QEMU 6.1 on Apple Silicon Mac

  1. Follow the excellent gist here, up to and including step 7 : https://gist.github.com/niw/e4313b9c14e968764a52375da41b4278

  2. I converted my VHDX to qcow2 - I doubt if that's significant, but YMMV:

./qemu-img convert -p -O qcow2 ~/Windows11_InsiderPreview_Client_ARM64_en-us__22454-orig.VHDX Windows11.img
  1. Run qemu with a slightly modified command-line. It may not be the most efficient, but it worked for me:
@chenshaoju
chenshaoju / script running adb shell
Last active March 25, 2024 04:58
Android 8.x Captive Portal Server for Mainland China
settings put global captive_portal_mode 1
settings put global captive_portal_use_https 1
settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
settings put global captive_portal_fallback_url http://captive.v2ex.co/generate_204
settings put global captive_portal_other_fallback_urls http://www.google.cn/generate_204
@darrenpmeyer
darrenpmeyer / open-vm-tools-vmware-ubuntu-sharing.md
Last active April 10, 2024 19:18
open-vm-tools and VMWare Shared Folders for Ubuntu guests

(NB: adapted from this Ask Ubuntu thread -- tested to work on Ubuntu 16.04 LTS through Ubuntu 22.04 LTS (Jammy).

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.

TL;DR

Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
@thales17
thales17 / msys2-SDL2-Setup.md
Last active April 14, 2024 07:20
msys2 sdl2 setup

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main