moon published posts

Unnamed document

就默默的跑,低着头,偶尔抬头看看天,就能跑个不错的成绩了,更努力一些可以比大部分人都好了
DADC5F40-003D-428B-9947-80C789EE50F5.png

Error installing mysql-python/mysqlclient: library not found for -lssl

macOS Mojave 安装mysqlclient时提示没有ssl库,错误如下:

Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... error
    Complete output from command /Users/moon/Workspace/Pycharm/env-tonghang/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6z/3d8pkqg53r72hd3gvt71n0900000gn/T/pip-install-dk68k229/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/6z/3d8pkqg53r72hd3gvt71n0900000gn/T/pip-record-4eo9tbll/install-record.txt --single-version-externally-managed --compile --install-headers /Users/moon/Workspace/Pycharm/env-tonghang/include/site/python3.6/mysqlclient:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.13-x86_64-3.6
    copying _mysql_exceptions.py -> build/lib.macosx-10.13-x86_64-3.6
    creating build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/compat.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/connections.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/converters.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/release.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    copying MySQLdb/times.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb
    creating build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.13-x86_64-3.6/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.macosx-10.13-x86_64-3.6
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,3,12,'final',0) -D__version__=1.3.12 -I/usr/local/opt/mysql@5.7/include/mysql -I/Users/moon/Workspace/Pycharm/env-tonghang/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c _mysql.c -o build/temp.macosx-10.13-x86_64-3.6/_mysql.o
    clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.6/_mysql.o -L/usr/local/opt/mysql@5.7/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.13-x86_64-3.6/_mysql.cpython-36m-darwin.so
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "/Users/moon/Workspace/Pycharm/env-tonghang/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/6z/3d8pkqg53r72hd3gvt71n0900000gn/T/pip-install-dk68k229/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/6z/3d8pkqg53r72hd3gvt71n0900000gn/T/pip-record-4eo9tbll/install-record.txt --single-version-externally-managed --compile --install-headers /Users/moon/Workspace/Pycharm/env-tonghang/include/site/python3.6/mysqlclient" failed with error code 1 in /private/var/folders/6z/3d8pkqg53r72hd3gvt71n0900000gn/T/pip-install-dk68k229/mysqlclient/

Screen Shot 2019-06-19 at 14.06.27.png

解决方法可以指定ssl库

LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient

或在~/.bash_*中指定环境

export LDFLAGS="-L/usr/local/opt/openssl/lib"

To StackoverflowError installing mysql-python: library not found for -lssl

什么时候最幸福

人在幸福的时候往往是不自知的,只有当不幸福、悲伤、恐惧、痛苦等不好的事情将要发生的时候才幡然醒悟幸福即将消失。
今天晚上,我们面对即将到来的分别,依依不舍,泪眼婆娑。
抱在一起的时候多么想时间永远停止,甚至只让我的时间停止,把我毁灭,我在所不惜,只要我的脑海里最终停留的是当时的感觉。
时间如流水般,终究是留不住的,我的时间也在飞速流逝,距离我自己的毁灭也还有好些时间。
不愿意让时间折磨我,我主动告别今晚,为了更好的活过明天。

晚安🌙

Unnamed document

食言、信口开河将会对两人的关系造成不可弥补的破坏,甚至也许是关系破裂的开始。
我希望永远不要再这样了,对自己爱的人。

宝贝生日快乐

陪宝贝度过的第一个生日

哭哭啼啼的度过了

宝贝为了让我好好睡觉,假装开心的陪我到这么晚,她应该还会去看一会儿小埋才肯去睡

宝贝情感洁癖严重,希望下辈子能让宝贝慢慢释怀

很爱你,宝贝,愿意跟你不离不弃

Modifying SElinux configure for allowing nginx reverse proxy local site

Read about audit2allow and used it to create a policy to allow access to the denied requests for nginx.

    [root]# sudo cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -m nginxlocalconf > nginxlocalconf.te
    [root]# cat nginxlocalconf.te 
    
    module nginxlocalconf 1.0;
    
    require {
        type httpd_t;
        type var_t;
        type transproxy_port_t;
        class tcp_socket name_connect;
        class file { read getattr open };
    }
    
    #============= httpd_t ==============
    
    #!!!! This avc can be allowed using the boolean 'httpd_can_network_connect'
    allow httpd_t transproxy_port_t:tcp_socket name_connect;
    allow httpd_t var_t:file { read getattr open };
    [root]# sudo cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M nginxlocalconf
    ******************** IMPORTANT ***********************
    To make this policy package active, execute:
    
    semodule -i nginxlocalconf.pp
    
    [root]# semodule -i nginxlocalconf.pp

暂别上海

今天来收拾打扫办公室,被办公室其他团队抛弃的一盆小草让我犯难了,就是这个
572D64D2-7568-4BEF-88FD-68D25922B488.jpeg

我自己当时养的一棵盆栽已经送给了庆庆,这棵盆栽不是我养的但办公室另一个团队走了之后我就成了他的继父。
把它放到楼梯口又留了个纸条后回来继续打扫办公室发现它有一条小小的根已经扎到了地板缝里,突然感觉好……
3A05117A-FB91-4D44-8320-8AD4EEE6B34A.jpeg