Skip to content

Instantly share code, notes, and snippets.

@xjoker
xjoker / logging.py
Last active September 8, 2016 03:38
python 日志模块
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(filename)s[Line:%(lineno)d] %(levelname)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
filename='SSDB_SERVER.log',
filemode='w')
console = logging.StreamHandler()
console.setLevel(logging.INFO)
@xjoker
xjoker / SaltStack_install.sh
Created September 8, 2016 15:35
一键安装SaltStack并配置好SaltAPI的脚本 for CentOS 6.8
echo "Install SaltStack "
yum install -y https://repo.saltstack.com/yum/redhat/salt-repo-latest-1.el6.noarch.rpm
yum install -y gcc python-pip python-devel openssl-devel libffi-devel
yum install -y salt-master salt-minion salt-api
pip install pyopenssl
echo "Create User: saltapi password: saltapi"
useradd -M -s /sbin/nologin saltapi
echo 'saltapi' | passwd --stdin saltapi
@xjoker
xjoker / VisualSNV_WMI_API.cs
Created October 14, 2016 08:00
通过操纵WMI来管理VisualSNV的一个库
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
namespace ConsoleApplication5
{
class VisualSVN_WMI_Api
{
/// <summary>
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6,7, Debian, Ubuntu #
# Description: One click Install ShadowsocksR Server #
# Author: Teddysun <i@teddysun.com> #
# Thanks: @breakwa11 <https://twitter.com/breakwa11> #
# Intro: https://shadowsocks.be/9.html #
#=================================================================#
@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"
@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 / 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 / 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 / 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 / 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";
/**