Skip to content

Instantly share code, notes, and snippets.

View BenLocal's full-sized avatar

shiben BenLocal

  • 22:55 (UTC +08:00)
View GitHub Profile
@BenLocal
BenLocal / Cargo.toml
Last active December 17, 2025 08:41
livekit csharp
[package]
name = "livekit-ffi-csharp"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["cdylib"]
[build-dependencies]
csbindgen = "1.9.6"
@BenLocal
BenLocal / docker-compose.yml
Created December 8, 2025 01:52
Create win11 in linux docker
services:
windows:
image: dockurr/windows
container_name: windows11
environment:
VERSION: "11"
USERNAME: "shiben"
PASSWORD: "xxx"
RAM_SIZE: "16G"
CPU_CORES: "8"
@BenLocal
BenLocal / docker_firewall.sh
Created November 21, 2025 02:36
docker_firewall
#!/bin/bash
IPTABLES=iptables
STATIC=10.6.121.210
IF=bond0
echo "STATIC: ${STATIC}"
for addr in ${STATIC//,/ }; do
echo "addr: ${addr}"
done
@BenLocal
BenLocal / ssh_remote.ps1
Created August 15, 2025 01:06
copy ssh auth
# "your-user-name-on-host@hostname"
param (
[Parameter(Mandatory=$true)]
[string]$host_and_name,
[Parameter(Mandatory=$false)]
[int]$p
)
write-host $host_and_name
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
@BenLocal
BenLocal / app.js
Created April 12, 2019 14:58
nodejs
//Prevent Visual Studio Node.js Console closing
//2. From the Debug menu in Visual Studio choose "Options". After this choose "NodeJS Tools" and tick the checkbox
//"Wait for input when process exits normally". press Ctrl + F5 the console window will stay open.
require('readline')
.createInterface(process.stdin, process.stdout)
.question("Press [Enter] to exit...", function () {
process.exit();
});
@BenLocal
BenLocal / Foo.cs
Created February 23, 2019 08:04
链式调用
namespace ClassLibrary1
{
class Test
{
private static void Main(string[] args)
{
new Foo().UseXxx().UseYyy().UseZzz().Execute();
new Foo().UseXxx().UseYyy().UseZzz().Invoke();
}
}
@BenLocal
BenLocal / xpath.cs
Last active February 23, 2019 08:04
xml
// vim:syntax=C#
public class ConfigXmlReader
{
private const string xmlPath = @"Config/settiingFileList.config";
private const string baseXPath = @"//setupType[text()={0}]//following-sibling::settingFiles//settingFile//accounts[contains(., '{1}')]/..";
private static ConfigXmlReader xmlReader = null;
private XDocument xDocument = null;
// vim:syntax=Java
package com.shiben.asm;
public class GeneratorClassLoader extends ClassLoader {
public GeneratorClassLoader() {
super(ClassLoader.getSystemClassLoader());
}
public Class<?> defineClassFromClassFile(String className, byte[] classFile)
@BenLocal
BenLocal / BrowserFrame
Last active November 21, 2018 07:47
ecf
// vim:syntax=Java
public class BrowserFrame extends JFrame {
/**
*
*/
private static final long serialVersionUID = 4144302791917251886L;
private LoadingPanel loadingPanel;
public BrowserFrame(String[] args, String initString, boolean useOsr, boolean isTransparent) {