Skip to content

Instantly share code, notes, and snippets.

View icpz's full-sized avatar
👻

Digital Pencil icpz

👻
View GitHub Profile
@icpz
icpz / v2ray-as-ss-over-v2plugin-server-config.json
Last active February 15, 2023 16:50
`shadowsocks over v2ray-plugin' as client work with `v2ray' as server
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "info"
},
"inbounds": [
{
"port": "10000", /* this is the server port for client */
"listen": "127.0.0.1",
@icpz
icpz / darwin-route.c
Last active November 28, 2019 06:16
manipulate routing table via route socket on darwin
#include <sys/socket.h>
#include <sys/types.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <netinet/in.h>
#include <net/route.h>
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <unistd.h>
@icpz
icpz / darwin-self-cpu-usage.c
Created November 27, 2019 10:51
get cpu usage in percent of current process on darwin
#include <mach/bootstrap.h>
#include <mach/mach_host.h>
#include <mach/mach_port.h>
#include <mach/task.h>
#include <mach/mach_vm.h>
#include <mach/thread_act.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
@icpz
icpz / darwin-SIOCAIFADDR_IN6.c
Created November 24, 2019 18:54
example of adding ipv6 address via ioctl(SIOCAIFADDR_IN6)
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <arpa/inet.h>
#include <netinet6/nd6.h>
#include <unistd.h>