Skip to content

Instantly share code, notes, and snippets.

@KunYi
KunYi / libusb_xb_test.c
Last active May 2, 2024 04:49 — forked from xpn/libusb_xb_test.c
LibUSB test with XBOX One controller
// to code base on
// https://gist.github.com/xpn/9dca0c1663ecdee76ede
// and modify to another pid(0x0b12)
//
// build commands on Ubuntu 22.04
// gcc libusbxboxone.c -o test_xboxone -lusb-1.0
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@KunYi
KunYi / com525.class.php
Created January 21, 2024 08:22 — forked from Sarjuuk/com525.class.php
communication interface for SIEMENS S5-CP524 and S5-CP525 communications processor
<?php
// Procedure 3964R
// Interpreter RK512
class Com525
{
// commands
private const CMD_SEND = 0x41; // 'A'
private const CMD_SEND_X = 0x4F; // 'O'
@KunYi
KunYi / docker.md
Created May 20, 2022 04:34 — forked from FreddieOliveira/docker.md
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@KunYi
KunYi / script-template.sh
Created December 19, 2020 04:15 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@KunYi
KunYi / multiple_ssh_setting.md
Last active October 19, 2020 09:48 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
@KunYi
KunYi / introrx.md
Created August 18, 2018 05:49 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
void TestCopy()
{
BOOL cond = FALSE;
IFileOperation *FileOperation1 = NULL;
IShellItem *isrc = NULL, *idst = NULL;
BIND_OPTS3 bop;
SHELLEXECUTEINFOW shexec;
HRESULT r;
do {