Skip to content

Instantly share code, notes, and snippets.

View ihainan's full-sized avatar
😉
Hey

Jigao Fu ihainan

😉
Hey
View GitHub Profile
@XargonWan
XargonWan / japanese_locale_enabler.sh
Last active May 4, 2024 20:25
Enable Japanese locale on Steam Deck
#!/bin/bash
# This script is enabling (uncommenting) the Japanese locale and regenerates them
sudo steamos-readonly disable
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman -S glibc
sudo sed -i "s%#ja_JP.UTF-8 UTF-8%ja_JP.UTF-8 UTF-8%" /etc/locale.gen
sudo locale-gen
@wanglf
wanglf / vscode-extension-offline.md
Last active May 3, 2024 06:06
Download VS Code extensions as VSIX

How to use?

  • Copy content of vsix-bookmarklet, create a bookmark in your browser.
  • Navigate to the web page of the VS Code extension you want to install.
  • Click the bookmark you just created, then click the download button.
    download
  • After download finished, rename the file extension to *.vsix.
  • In VS Code, select Install from VSIX... in the extension context menu.
    vsc
@zopieux
zopieux / README.md
Last active May 2, 2024 15:12
QNAP TS-453 Pro: LCD, LEDs, fan & buttons

QNAP TS-453 Pro: LCD, LEDs, fan & buttons

QNAP NAS model TS-453 Pro has limited documentation on how to control its various peripherals, namely:

  • the front LCD display, a 2 row, 16 column blue & white LCD display, and its two menu buttons ("ENTER", "SELECT")
  • the front LEDs "STATUS" (red & green) & "USB" (blue)
  • the 4 "disk error" LEDs (red)
  • the front "USB COPY" button
  • the main rear fan
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@ts-sz
ts-sz / reset-proxmox-cluster.sh
Created September 29, 2021 18:21 — forked from nderjung/reset-proxmox-cluster.sh
Reset proxmox cluster
#/bin/bash -xe
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
sqlite3 /var/lib/pve-cluster/config.db "delete from tree where name = 'corosync.conf';"
@aa65535
aa65535 / aria2.bat
Last active February 7, 2024 05:41
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@AndnixSH
AndnixSH / qnap_standby_debug.sh
Last active November 16, 2023 00:57
QNAP standby debug fix
# https://www.qnap.com/en/how-to/faq/article/how-do-i-find-out-which-process-prevents-the-hard-drives-from-standby-mode
# wget https://eu1.qnap.com/Storage/tsd/utility/standby_debug.sh;sh standby_debug.sh
binary=""
case "$(uname -m)" in
*x86_64*)
echo "Arch: x86_64"
binary=https://download.qnap.com/Storage/tsd/utility/Disk_Standby_Debug_x86_64/Disk_Standby_Debug
;;
@BenWoodford
BenWoodford / lh2.md
Last active October 17, 2023 02:33
Lighthouse 2.0 GATT Information

All control characteristics are under Service 00001523-1212-EFDE-1523-785FEABCD124

Characteristics

Mode = 00001524-1212-EFDE-1523-785FEABCD124 (READ, WRITE, NOTIFY)

Identify = 00008421-1212-EFDE-1523-785FEABCD124 (WRITE)

Power State = 00001525-1212-EFDE-1523-785FEABCD124 (WRITE, newer firmware also had READ and NOTIFY)

@st-f
st-f / ThreeLevelExpandableListView.java
Last active August 15, 2023 22:52
A 3 level expandable list view
package net.stf.threelevelexpandablelistview;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
@ElementW
ElementW / uexplode.py
Created January 30, 2018 20:14
Python3 script to extract music from UE4 .uexp files
#!/usr/bin/env python3
import sys, os, errno
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass