Skip to content

Instantly share code, notes, and snippets.

View liweitianux's full-sized avatar
🎵
Focusing

Weitian LI liweitianux

🎵
Focusing
  • Shanghai, China
View GitHub Profile
@liweitianux
liweitianux / fg21sim-plot-example.py
Created September 12, 2018 04:13
Matplotlib example
import matplotlib as mpl
import matplotlib.pyplot as plt
# %matplotlib inline
# Matplotlib Customization
# References: https://matplotlib.org/users/customizing.html
# refresh the font cache:
#mpl.font_manager._rebuild()
@liweitianux
liweitianux / keybase.md
Created July 14, 2019 03:29
Keybase proof

Keybase proof

I hereby claim:

  • I am liweitianux on github.
  • I am liweitianux (https://keybase.io/liweitianux) on keybase.
  • I have a public key ASC-oq97UzToDKQUsTtdvSKy5GVuEHWFx9NZQmOoTYs0TQo

To claim this, I am signing this object:

@liweitianux
liweitianux / f-stack.installation.md
Last active July 16, 2020 09:39
F-Stack Installation (custom prefix)

F-Stack Installation

  • Author: Weitian LI
  • Date: 2020-07-16

Environment

  • OS: CentOS 7.4.1708
  • Kernel: 3.10.0-957.27.2.el7.x86_64
@liweitianux
liweitianux / README.md
Last active October 21, 2020 03:41
DPVS in VirtualBox

DPVS in VirtualBox

Environment

  • DPVS version: v1.7.6, v1.8.4
  • Host: Arch Linux
  • VirtualBox: 6.1.2
  • Virtual machines:
    • centos: as the DPVS load balancer
@liweitianux
liweitianux / ed25519-read-der.c
Last active August 8, 2022 02:17
Convert PEM key to C bytes array
/*-
* Read Ed25519 public and private keys in DER format.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include "private.h" /* generated by 'pem-to-c.sh' */
@liweitianux
liweitianux / dfly-install.org
Last active February 26, 2023 05:19
DragonFly BSD Manual Installation with HAMMER2 and Encrypted Root

DragonFly BSD Installation

2018-01-30

Disk Partition

MBR Slice

root# dd if=/dev/zero of=/dev/vbd0 bs=32k count=16
root# fdisk -IB /dev/vbd0
@liweitianux
liweitianux / centos7-clang13.md
Last active April 19, 2023 05:29
Build Clang 13 on CentOS 7

Build Clang 13 on CentOS 7

Requirements [1]:

  • CMake >=3.13.4
  • GCC >=7.1.0
  • Python >=3.6 (automated test suite)
  • zlib >=1.2.3.4
  • GNU Make >=3.79
@liweitianux
liweitianux / encryptor.c
Last active August 24, 2023 09:08
Chacha20-Poly1305 AEAD with PBKDF2 key derivation
/*-
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2022-2023 Aaron LI
*
* 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
@liweitianux
liweitianux / dfly-install-uefi.md
Last active December 17, 2023 15:33
DragonFly BSD Installation (UEFI & HAMMER2)

DragonFly BSD Installation

Date: 2023-04-22

Setup:

  • Disk: /dev/da3 (500GB)
  • Use full disk
  • UEFI boot
  • GPT disk type (don't use disklabel64(8))
@liweitianux
liweitianux / dfly-install-hammer2.md
Last active January 2, 2024 06:15
DragonFly BSD Installation (MBR, HAMMER2 boot+root)

DragonFly BSD Installation

1. Create Disk Slice

Assume the disk is /dev/da8, to create a slice of about 100 GB.

dfly# cat > fdisk.conf << _EOF_