Skip to content

Instantly share code, notes, and snippets.

View liweitianux's full-sized avatar
🎵
Focusing

Weitian LI liweitianux

🎵
Focusing
  • Shanghai, China
  • 12:02 (UTC +08:00)
View GitHub Profile
@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 / cat-lps.pl
Last active February 21, 2024 12:05
Print lines at particular speed (line/sec)
#!/usr/bin/env perl
#
# Cat file to terminal at particular speed of lines per second
# https://superuser.com/a/526249
#
# Usage: cat-lps.pl [lps] [file]...
#
use warnings;
use strict;
@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 / apisix-etcd.md
Last active February 21, 2024 12:05
APISIX etcd configurations
@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 / 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 / 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 / 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 / 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 / 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_