Skip to content

Instantly share code, notes, and snippets.

@xjoker
xjoker / dockerfile
Created April 18, 2023 03:17
build caddy webdav
FROM golang:1.20.3 AS build
ARG version
ARG xcaddy_arg
WORKDIR /src
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
RUN xcaddy build ${version} ${xcaddy_arg}
FROM alpine:3.16 AS base
ARG version
@xjoker
xjoker / InstallDotnet.sh
Created September 21, 2022 07:43
install dotnet core to Armbian
curl -L https://dot.net/v1/dotnet-install.sh | bash -s -- --install-dir /var/lib/dotnet/
rm /etc/profile.d/dotnet_env.sh
echo 'DOTNET_ROOT=/var/lib/dotnet' >> /etc/profile.d/dotnet_env.sh
echo 'PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> /etc/profile.d/dotnet_env.sh
echo 'export PATH' >> /etc/profile.d/dotnet_env.sh
@xjoker
xjoker / md5.cs
Created February 24, 2022 03:30
MD5算法逻辑学习
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp11
{
internal class Program
{
private static uint A = 0x67452301;
@xjoker
xjoker / docker-compose.yaml
Created January 20, 2022 09:27
Single machine deploy redis cluster
version: "3"
# EN
# replace "123123123" to your password
# replace "172.26.14.16" to your machine real ip
# redis port range is 6379 to 6381
# sentinel port range is 26379 to 26381
# CN
# 替换 123123123 为密码
@xjoker
xjoker / OkHttp3Hook.java
Last active January 18, 2022 07:51
OkHttp3Hook
public class OkHttp3Hook {
private static final String TAG = "OkHttp3Hook";
private static final String realCallClassName = "okhttp3.RealCall";
private static final String httpUrlClassName = "okhttp3.HttpUrl";
private static final String requestBuilderClassName = "okhttp3.Request$Builder";
private static final String getResponseWithInterceptorChainMethodName = "getResponseWithInterceptorChain";
/**
@xjoker
xjoker / xhs_x-s.js
Created December 23, 2021 10:09
小红书x-s算法
var encFunc = function (inValue) {
var result = "";
var v1, v2, v3, v4, v5, v6, v7;
var index = 0x0;
var secDict =
"A4NjFqYu5wPHsO0XTdDgMa2r1ZQocVte9UJBvk6/7=yRnhISGKblCWi+LpfE8xzm3";
while (index < inValue.length) {
v1 = inValue.charCodeAt(index++);
v2 = inValue.charCodeAt(index++);
v3 = inValue.charCodeAt(index++);
@xjoker
xjoker / ldap.cs
Created November 21, 2021 01:58
LDAP SSL 连接
using System;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using Novell.Directory.Ldap;
namespace LDAPTest
{
class Program
{
static void Main(string[] args)
@xjoker
xjoker / query.sql
Created August 14, 2021 10:59
查询数据库表的基本信息
SELECT tb.name AS "表名",
c.name AS "字段名称",
p.value AS "字段注释",
t.name AS "字段类型",
c.max_length AS "字段长度",
c.is_nullable AS "是否可空",
c.is_identity AS "是否主键"
FROM sys.tables AS tb
INNER JOIN sys.columns AS c ON tb.object_id = c.object_id
INNER JOIN sys.types AS t ON c.system_type_id = t.system_type_id
@xjoker
xjoker / bat
Created January 8, 2018 08:09
Auto Patch Intel Meltdown Patch For Windows Server
@ECHO OFF
pushd %~dp0
CLS
COLOR 0E
:MAINMENU
CLS
ECHO.
ECHO ---------------------------------------------------------------
ECHO ---------------- Intel Meltdown Windows Patch -----------------
@xjoker
xjoker / Duplicate_file_removal.go
Last active May 10, 2017 02:51
目录文件去重
package main
import (
"crypto/md5"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"os"