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 / 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 / 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 / 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_
@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 / git-getversion.sh
Last active July 29, 2024 13:37
Generate version information based on Git tags/commits
#!/bin/sh
#
# Generate version information based on Git tags/commits.
#
# License: Public Domain
#
# URL: https://gist.github.com/liweitianux/9fce0fc404c41b8f28512e87fbca1562
#
dirty_mark='+'
@liweitianux
liweitianux / nginx.google.conf
Created July 17, 2021 03:44
Nginx Proxy to Google
#
# Nginx reverse proxy to Google Search (with images and webcache))
#
# Credit:
# * Nginx rewrite append a parameter at the end of an URL
# https://serverfault.com/a/311660/387898
# * https://github.com/tracycool/Reverse-Proxy-for-Google
# * https://github.com/caiguanhao/nginx-bypass-gfw/blob/master/google.conf
#
# References:
@liweitianux
liweitianux / apisix-etcd.md
Last active February 21, 2024 12:05
APISIX etcd configurations
@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' */