Skip to content

Instantly share code, notes, and snippets.

View 521xueweihan's full-sized avatar
:octocat:
me

削微寒 521xueweihan

:octocat:
me
View GitHub Profile
@521xueweihan
521xueweihan / web-servers.md
Created November 25, 2020 02:45 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@521xueweihan
521xueweihan / Dockerfile
Created September 28, 2020 08:55 — forked from twang2218/Dockerfile
Docker cron example
FROM python:3.5.2
ENV TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install -y cron \
&& apt-get autoremove -y
COPY ./cronpy /etc/cron.d/cronpy
CMD ["cron", "-f"]
@521xueweihan
521xueweihan / fix-missing-libcrypto-osx.md
Last active August 6, 2020 04:04 — forked from aklap/fix-missing-libcrypto-osx.md
Resolving missing link to libcrypto/openssl on OSX
brew uninstall --ignore-dependencies openssl
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb
@521xueweihan
521xueweihan / email.py
Created December 23, 2019 07:13
邮件发送工具方法
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Author : XueWeiHan
# Date : 18/8/11 上午11:21
# Desc : 通用工具类
import smtplib
from email.mime.text import MIMEText
from email.header import Header

1、vim /etc/sysctl.conf

2、末尾追加如上设置

# 提高整个系统的文件限制
# max open files
fs.file-max = 51200

# max read buffer
net.core.rmem_max = 67108864
@521xueweihan
521xueweihan / proxychains-ng安装.md
Last active February 11, 2023 06:34
Mac OS 终端翻墙

前提是需要有配置好的 shadowsocks 服务

通过 proxychains-ng + shadowsocks 实现终端翻墙,步骤如下:

  1. 安装:brew install proxychains-ng
  2. 配置:
    1. vim /usr/local/etc/proxychains.conf
    2. 配置文件末尾加入:socks5 127.0.0.1 1080(shadowsocks 默认本地监听地址)
  3. 测试是否成功:
    1. wget https://www.dropbox.com -v -O /dev/null //直接输入这条语句连接不了
  4. proxychains4 wget https://www.dropbox.com -v -O /dev/null //加入proxychains4之后就可以顺利执行
@521xueweihan
521xueweihan / deploy-flask-gunicorn-supervisor-nginx.md
Created April 7, 2017 15:05 — forked from binderclip/deploy-flask-gunicorn-supervisor-nginx.md
Flask Gunicorn Supervisor Nginx 项目部署小总结

Flask Gunicorn Supervisor Nginx 项目部署小总结

服务器的基本连接和配置

SSH 连接

使用公钥私钥来登陆而不是账号密码,公钥私钥需要简单的在本地生成一下。Github 的生成 SSH 公钥私钥的教程:Generating SSH keys

可能需要使用 -i 参数选择一下本地的私钥,一个示例的 ssh 连接如下:

@521xueweihan
521xueweihan / markdown.md
Last active November 25, 2018 13:48
GitHub Markdown 编写技巧

美观的ReadME




eva.js is a complete solution to
building modern webs with Vue.js.

NPM version NPM downloads

@521xueweihan
521xueweihan / portforwarding.md
Created December 25, 2016 14:49 — forked from kujohn/portforwarding.md
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

# PyLint configuration file for the project pymvpa.
#
# Agreed formatting (per yoh+michael voice dialog) is camel.
#
# This pylintrc file will use the default settings except for the
# naming conventions, which will allow for camel case naming as found
# in Java code or several libraries such as PyQt, etc.
#
# At some moment it was modified by yoh from the original one
# which can be found on debian systems at