Skip to content

Instantly share code, notes, and snippets.

View NNdroid's full-sized avatar
🎯
Focusing

NNdroid

🎯
Focusing
View GitHub Profile
@NNdroid
NNdroid / nginx.conf
Created November 26, 2023 02:25 — forked from fotock/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
@NNdroid
NNdroid / client.c
Created August 13, 2023 13:18 — forked from inaz2/client.c
IPv6 server & client in C
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
void ping(int s, char *message)
{
char buf[8192];
@NNdroid
NNdroid / LocalServerSocket.md
Created August 8, 2023 06:01 — forked from RajithaKumara/LocalServerSocket.md
Android create Unix domain socket by bound file descriptor

Android create Unix domain socket by bound file descriptor

Android provide LocalServerSocket and LocalSocket to create Unix domain sockets for local interprocess communication (IPC). Unix socket address can behave in three types[1],

  • pathname
  • unnamed
  • abstract

LocalServerSocket provide two public constructors for create socket in Linux abstract namespace[2] and create socket using file descriptor that's already been created and bound[3].

Create LocalServerSocket using [FileDescriptor](https://docs.oracle.com/javase/7/docs/api/j

@NNdroid
NNdroid / tun-ping-linux.go
Created July 18, 2023 14:18 — forked from glacjay/tun-ping-linux.go
Reading/Writing Linux's TUN/TAP device in Go.
package main
import (
"exec"
"log"
"os"
"syscall"
"unsafe"
)
@NNdroid
NNdroid / balance.go
Created May 30, 2023 00:03 — forked from darkhelmet/balance.go
Simple TCP load balancer in Go.
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)
@NNdroid
NNdroid / 0-go-os-arch.md
Created December 22, 2022 00:36 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android