Skip to content

Instantly share code, notes, and snippets.

@Chion82
Chion82 / iana_openssl_cipher_mapping.json
Created January 25, 2019 06:40
Mapping OpenSSL cipher suite names to IANA names. https://testssl.sh/openssl-iana.mapping.html
{
"TLS_RSA_WITH_NULL_MD5":"NULL-MD5",
"TLS_RSA_WITH_NULL_SHA":"NULL-SHA",
"TLS_RSA_EXPORT_WITH_RC4_40_MD5":"EXP-RC4-MD5",
"TLS_RSA_WITH_RC4_128_MD5":"RC4-MD5",
"TLS_RSA_WITH_RC4_128_SHA":"RC4-SHA",
"TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5":"EXP-RC2-CBC-MD5",
"TLS_RSA_WITH_IDEA_CBC_SHA":"IDEA-CBC-SHA",
"TLS_RSA_EXPORT_WITH_DES40_CBC_SHA":"EXP-DES-CBC-SHA",
"TLS_RSA_WITH_DES_CBC_SHA":"DES-CBC-SHA",
@Chion82
Chion82 / virtualbox_ports.png
Created June 2, 2022 14:42 — forked from snb/virtualbox_ports.png
virtualbox serial console
virtualbox_ports.png
package main
import (
"net"
"os"
"syscall"
"time"
)
func main() {
strEcho := "Halo"
@Chion82
Chion82 / debian-mips64el-on-qemu.md
Created March 19, 2022 01:33 — forked from sergev/debian-mips64el-on-qemu.md
Installing Debian MIPS64 on QEMU

Let's install Debian 9.0 "Stretch" on QEMU MIPS64 under Ubuntu.

Step 1: Install QEMU

sudo apt install qemu-system-mips

Step 2: Download Linux kernel and installation image

wget http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot/vmlinux-4.9.0-8-5kc-malta

#项目整体架构

##概述

本项目采用基于Node全栈式开发的NodeJS Midway架构,详细实现原理请参照 淘宝UED
前端除了需要编写UI层的HTML、CSS和JavaScript等浏览器端UI和控制逻辑,还需要编写NodeJS中间层控制逻辑。NodeJS中间层与后端服务器进行RESTful通信并预渲染页面,同时返回部分静态文件。用户在浏览器端访问的服务器是NodeJS中间层的预渲染服务,真后端服务器不暴露。

  • 交互图示如下:

交互图示

DIR=$(dirname $(readlink -f $0))
if [ ${#DIR} -gt 0 ]; then
cd $DIR
fi
@Chion82
Chion82 / gen_compile_commands.py
Created August 24, 2021 06:25
Script to get compile_commands.json form linux kernel
#!/usr/bin/env python
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) Google LLC, 2018
#
# Author: Tom Roeder <tmroeder@google.com>
#
"""A tool for generating compile_commands.json in the Linux kernel."""
import argparse
@Chion82
Chion82 / client.c
Created February 12, 2017 14:56
fake TCP test
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <string.h>
#include "trans_packet.h"
void on_packet_recv(char* from_ip, uint16_t from_port, char* payload, int size, unsigned int seq) {
printf("Packet received from=%s:%d, seq=%d\n", from_ip, from_port, seq);
char* message = (char*)malloc(size);
memcpy(message, payload, size);
@Chion82
Chion82 / get_cn_ip.sh
Last active November 29, 2020 03:41
get_cn_ip.sh
wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > your_chn_list.txt
@Chion82
Chion82 / Golang static build
Last active October 14, 2020 10:07 — forked from PurpleBooth/Dockerfile
Create a static binary in go
go build -ldflags "-linkmode external -extldflags -static"