作者文章归档:betteryuan

NGINX 通过不同的二级域名映射到不同端口下的应用


NGINX 二级域名映射不同端口下的应用NGINX 二级域名映射不同端口下的应用


有三个二级域名
www.betteryuan.top ==> djangoblog(djangoblog 127.0.0.1:8000)
gitlab.betteryuan.top ==> gitlab.betteryuan.top(httpd 127.0.0.1:8081)
ngrok.betteryuan.top ==> ngrok.betteryuan.top(nprok 127.0.0.1:1080)
server {

    listen 80;
    server_na

Read more

NGROK 服务器搭建


NGROK 服务器搭建


1. 准备证书

1. 免费通配符域名CA证书

1. 安装必须的软件

Certbot的包装在EPEL(Enterprise Linux的额外软件包)中。要使用Certbot,必须首先启用EPEL存储库
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

sudo yum install python2-certbot-nginx

2. 开始申请

sudo certbot -a dns-pl

Read more

Docker Install


Docker Install -- Centos 7


1. 卸载旧版本的Docker

sudo yum remove docker \
              docker-client \
              docker-client-latest \
              docker-common \
              docker-latest \
              docker-latest-logrotate \
              docker-logrotate \
              docker-engine

Read more

Python Proxy


Pyhon Proxy

1. python利用http/https代理访问外网

#!/usr/bin/python3
import requests
from googletrans import Translator

proxy = '127.0.0.1:8118'
proxies = {
    'http': 'http://' + proxy,
    'https': 'https://' + proxy,
}
try:
    response = requests.get('http://g

Read more

超能英语FROM 0 TO 1


FROM 0 TO 1


Hello Hi Hey

Hello 不熟悉的人
Hi 熟悉的人
Hey[yyyyyy] 熟悉的人,有调侃的意思

How are you?

How are you doing?
How is it going?
How have you been?
What's up?

Nice to meet you. meet you 连读 第一次见面 或 偶遇寒暄很短,要分别可以说

Nice to meet you, too.
It's nice metting you. (Metting you is nice)
Nice to see you.   (>=2

Read more

NGINX 权限问题的解决方式


权限问题

NGINX启动的用户最好和代理的web服务器用户一致,这样可以避免权限问题
在 centos7 上可以通过/etc/nginx/nginx.conf配置
user [runinguser]

Nginx 500 Internal Server Error

这个问题分析的第一件事是查看日志,centos7 一般在/var/log/nginx目录下
一般 Permission denied 问题(权限问题)可以通过chmod -R PATH 来解决,但最好的方式还是在开始的时候就避免,使用相同用户配置nginx

Read more

Spacemacs 使用技巧


Spacemacs 使用技巧

1. 窗口跳转

SPC N               跳转到第n个window窗口

2. 配置文件管理

SPC f e d           快速打开配置文件.spacemacs
SPC f e R           加载配置文件
SPC q R             重启Spacemacs

3. 帮助文档

SPC h d             查看describe相关的文档
SPC h d f           查看指定函数的帮助文档
SPC h d b           查看指定快捷键绑定的命令
SPC h d v           查看指定变

Read more