Skip to content

Instantly share code, notes, and snippets.

@xhkyyy
xhkyyy / nginx-openssl-build.sh
Created April 4, 2021 12:29 — forked from lukespragg/nginx-openssl-build.sh
NGINX and OpenSSL build and installation script
#!/bin/bash
## TODO:
# Figure out how to get nginx file-aio module working (incompatible?)
## Get and install tools and dependencies
sudo apt-get -y install build-essential zlib1g-dev libpcre3 libpcre3-dev libbz2-dev
## Get installed OpenSSL version
# Use `whereis openssl` to check if installed first
@xhkyyy
xhkyyy / dnsmasq OS X.md
Last active January 14, 2020 07:24 — forked from ogrrd/dnsmasq OS X.md
mac 安装 dnsmasq

详细问题见文档末尾

Never touch your local /etc/hosts file in OS X again

NOTE this has been done properly by a guy here: https://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/

You should go and do that now, ignore all of this.

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@xhkyyy
xhkyyy / linux-http-tcp.md
Created May 22, 2018 06:23 — forked from v5tech/linux-http-tcp.md
linux下查看http 并发和 tcp连接数

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'