[置顶] 用Erlang写一个抓写真图片的程序

摘要: Erlang 阅读全文
posted @ 2012-06-17 21:35 盐味 阅读(907) 评论(0) 推荐(0) 编辑

docker ls: cannot open directory .: Permission denied

From access.redhat.com:Sharing_Data_Across_Containers:

" Host volume settings are not portable, since they are host-dependent and might not work on any other machine. For this reason, there is no Dockerfile equivalent for mounting host directories to the container. Also, be aware that the host system has no knowledge of container SELinux policy. Therefore, if SELinux policy is enforced, the mounted host directory is not writable to the container, regardless of the rw setting. Currently, you can work around this by assigning the proper SELinux policy type to the host directory":

~]# chcon -Rt svirt_sandbox_file_t host_dir.

Where host_dir is a path to the directory on host system that is mounted to the container.

It's seems to be only a workaround but i tried and it works

posted @ 2015-05-29 22:15 盐味 阅读(3135) 评论(0) 推荐(0) 编辑

Python url_escape

摘要: escape.py# -*- coding: utf8 -*-import sysif type('') is not type(b''): def u(s): return s bytes_type = bytes unicode_type = str bas... 阅读全文
posted @ 2014-06-26 21:24 盐味 阅读(1968) 评论(0) 推荐(0) 编辑

Lua 查看栈的宏

摘要: LUA C API 阅读全文
posted @ 2013-10-18 20:11 盐味 阅读(903) 评论(0) 推荐(0) 编辑

windows7 开热点

摘要: netsh wlan set hostednetwork mode=allow ssid=名称 key=密码netsh wlan start hostednetworknetsh wlan stop hostednetwork 阅读全文
posted @ 2013-06-25 16:06 盐味 阅读(177) 评论(0) 推荐(0) 编辑

rabbitmq客户端pika一个channel消费多个queue

摘要: 我们知道rabbitmq在一个connection中可以声明多个channel, 一个channel可以供给一个线程来安全的使用, 而一个channel是可以同时从多个队列接收数据的,我们称为消费多个queue, 那么在python客户端pika中, 如果一个channel消费多个queue, 对不同的消费是否可以执行不同的callback呢? 为了验证这个, 写了这么一个测试代码test_queue_send.py# -*- coding: utf-8 -*-from packages.rabbit import tornado_connimport timeimport pikaimpor 阅读全文
posted @ 2013-05-05 21:12 盐味 阅读(2217) 评论(0) 推荐(0) 编辑

Google v8实现类似nodejs的import加载模块

摘要: 希望在Cooper中加入模块搭建的机制, 参考了Nodejs中exports,import的机制,觉得他弄得复杂了些, 就自己试着写了个简单的有这些文件:makefilev8test: \ v8test.cpp g++ \ v8test.cpp \ -o v8test \ -I/usr/local/include -L/usr/local/lib -lv8v8test.cpp#include <v8.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include... 阅读全文
posted @ 2013-04-16 00:08 盐味 阅读(2197) 评论(1) 推荐(0) 编辑

Python 让对象能被转化为dict

摘要: # -*- coding: utf-8 -*-class MyClass(object): """docstring for MyClass""" def __init__(self, attr1, attr2, attr3): self.attr1 = attr1 self.attr2 = attr2 self.attr3 = attr3 def __iter__(self): attrs = dir(self) for attr in attrs: if attr.find('__... 阅读全文
posted @ 2013-04-03 16:34 盐味 阅读(556) 评论(0) 推荐(0) 编辑

linux 查看磁盘

摘要: 查看磁盘使用情况df -h查看当前文件夹大小du -sh * 阅读全文
posted @ 2013-03-21 16:22 盐味 阅读(141) 评论(0) 推荐(0) 编辑

Erlang term to string

摘要: R = io_lib:format("~p",[yourtermhere]),lists:flatten(R). 阅读全文
posted @ 2013-02-14 17:29 盐味 阅读(200) 评论(0) 推荐(0) 编辑

Erlang port communicate with python

摘要: 只保留核心代码, 看起来方便。erlang代码-module(port_test).-export([start/0, send/1, stop/0]).start() -> Fun = fun() -> register(?MODULE, self()), Port = open_port({spawn, "./port_test.py"}, [{packet, 2}]), %% {packet, 2} loop(Port) ... 阅读全文
posted @ 2012-12-26 00:38 盐味 阅读(336) 评论(0) 推荐(0) 编辑
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

点击右上角即可分享
微信分享提示