libmagic

Conditional requirements in setup.py

主宰稳场 提交于 2021-02-11 15:34:35
问题 I'm writing a library that's dependent on file-magic, which works just fine for most platforms, but in Alpine Linux, file-magic won't work so I need to instead use the python-magic library. Now I know how to write my own code to handle the different Python library APIs, but what I don't know how to do is to write my setup.cfg or setup.py to have a different requirements based on the system on which we're doing the installation. I figured the best option would be to use the PEP 508 rules, but

知识点044-virtual memory exhausted: Cannot allocate memory

纵然是瞬间 提交于 2020-03-02 05:55:25
问题: 编译时遇到这个问题提示内存不够用 virtual memory exhausted: Cannot allocate memory make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1 [root @bash php-7.3.0]# free -m total used free shared buff/cache available Mem: 992 127 754 0 110 734 Swap: 0 0 0 [root @bash php-7.3.0]# mkdir /opt/images/ [root @bash php-7.3.0]# dd if=/dev/zero of=/opt/images/swap bs=1024 count=2048000 2048000+0 records in 2048000+0 records out 2097152000 bytes (2.1 GB) copied, 18.3069 s, 115 MB/s [root @bash php-7.3.0]# mkswap /opt/images/swap Setting up swapspace version 1, size = 2047996 KiB no label, UUID=d994d138-22a5-4c63-8b12

Mac 安装

强颜欢笑 提交于 2019-12-23 23:48:28
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> sql建立数据库 create database opsmanage DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; grant all privileges on opsmanage.* to root@'%' identified by 'password'; 安装依赖 brew install libmagic 配置文件 conf/opsmanage.ini [db] engine = mysql host = 127.0.0.1 port = 3307 user = root password = 123456 database = opsmanage [redis] host = 127.0.0.1 port = 6379 password = ansible_db = 3 celery_db = 4 default_db = 0 [deploy] path = /Users/lijingjing/OpsManage/workspaces 初始化数据 python3 manage.py makemigrations wiki python manage.py createsuperuser # 建立后台管理员帐号 https://github

libmagic. text/plain instead of text/javascript text/css

此生再无相见时 提交于 2019-12-11 01:04:22
问题 I use libmagic to get the mime type of a file in a web interface of my project. I get text/plain mime type on css and js files. For example chromium shows below warnings: Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:8000/jquery-ui.css". Resource interpreted as Script but transferred with MIME type text/plain: "http://localhost:8000/jquery.timers.js". Http dialog alex@alex-laptop ~ $ nc localhost 8000 GET /ui.css HTTP/1.1 HTTP/1.1 200 OK

Compiling libmagic statically (c/c++ file type detection)

天大地大妈咪最大 提交于 2019-12-10 17:55:18
问题 Thanks to the guys that helped me with my previous question (linked just for reference). I can place the files fileTypeTest.cpp , libmagic.a , and magic in a directory, and I can compile with g++ -lmagic fileTypeTest.cpp fileTypeTest . Later, I'll be testing to see if it runs in Windows compiled with MinGW. I'm planning on using libmagic in a small GUI application, and I'd like to compile it statically for distribution. My problem is that libmagic seems to require the external file, magic .