Skip to content

Instantly share code, notes, and snippets.

View hustwolf's full-sized avatar
🎯
Focusing

hustwolf hustwolf

🎯
Focusing
View GitHub Profile
@hustwolf
hustwolf / inspectslice.go
Created October 11, 2024 09:08 — forked from mpiannucci/inspectslice.go
Inspect Go Slice memeory layouts
package main
func InspectSlice(slice []string) {
// Capture the address to the slice structure
address := unsafe.Pointer(&slice)
// Capture the address where the length and cap size is stored
lenAddr := uintptr(address) + uintptr(8)
capAddr := uintptr(address) + uintptr(16)
@hustwolf
hustwolf / Vagrantfile
Created May 7, 2024 07:06 — forked from mike-hearn/Vagrantfile
Multi-machine Vagrant config with private networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
:name => "server1",
:eth1 => "192.168.205.10",
:mem => "1024",
:cpu => "1"
@hustwolf
hustwolf / LICENSE
Created August 16, 2023 02:16 — forked from yamnikov-oleg/LICENSE
Shared (interprocess) mutexes on Linux
MIT License
Copyright (c) 2018 Oleg Yamnikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@hustwolf
hustwolf / shadowsocks_ubuntu1604.org
Created September 4, 2022 03:00 — forked from nuhuo08/shadowsocks_ubuntu1604.org
Install Shadowsocks-libev + simple-obfs on Ubuntu 16.04

Install Shadowsocks-libev + simple-obfs on Ubuntu 16.04

Install shadowsocks-libev via Ubuntu PPA

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
sudo apt-get update
sudo apt install shadowsocks-libev

Linux可執行文件ㄉ內容分析工具

NOTE: This is a working copy. This tutorial is unfinished and may contain inaccuracies.

I've written the title of this tutorial in Chinese, as I suspect that its contents may, at first glance, appear similarly incomprehensible to the audience.

However, just as I can sketch for you the following...

可執行文件 = (可 = can) + (執行 = execute) + (文件 = file) = executable (file)

@hustwolf
hustwolf / ds01_AdminClient_describe_cg_info.java
Created June 8, 2022 06:55 — forked from erhwenkuo/ds01_AdminClient_describe_cg_info.java
使用Kafka的AdminClient API來查詢Kafka中每一個ConsumerGroup己經消費過的offset最大值
import org.apache.kafka.clients.admin.*;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.common.TopicPartition;
import java.util.*;
import java.util.concurrent.ExecutionException;
/**
* Kafka的AdminClient函式庫,支持管理和檢查topics, brokers, configurations和ACLs。
* 所需的最小的Kafka broker版本為0.10.0.0。有些API會需要更高版本的Kafka broker的話會註解在API中。
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz
@hustwolf
hustwolf / lvn.md
Created March 25, 2022 02:29 — forked from mtds/lvn.md
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |
@hustwolf
hustwolf / setup-vagrant-macosx.md
Created March 23, 2022 03:48 — forked from tomysmile/setup-vagrant-macosx.md
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

@hustwolf
hustwolf / introrx.md
Created February 11, 2022 06:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing