daemon

Gradle Daemon Android Studio: “Unable to start the daemon process”

大兔子大兔子 提交于 2020-02-05 05:52:06
问题 I am having a problem. I have always developed applications in Android Studio and never had a problems, but now I had the following error: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.4/userguide/gradle_daemon.html I already changed in gradle.properties the following line org.gradle.jvmargs=-Xmx1536m to

Docker基础

浪子不回头ぞ 提交于 2020-02-05 05:19:48
一、容器概念 Linux六大名称空间 UTS 主机名和域名 IPC 信号量、消息队列和共享内存 PID 进程编号 Network 网络设备、网线栈、端口等 Mount 挂载点(文件系统) User 用户和用户组,内核3.8支持 Control Group(cgroups) blkio 块设备IO cpu cpu cpuacct cpu资源使用报告 cpuset 多处理器平台上的CPU集合 devices 设备访问 freezer 挂起或恢复任务 memory 内存用量及报告 perf_event 对cgroup中的任务进行统一性能测试 net_cls cgroup中的任务创建的数据报文的类别标识符 容器核心技术 chroot namespace cgroups Docker容器引擎:LXC --> libcontainer --> runC Docker Daemon:Docker server端,默认只提供socket文件接入 Registry:镜像仓库,默认通信协议HTTPS Containers:容器 Images:镜像 二、Docker安装 基础环境 64 bits CPU kernel-3.10+ 安装 # yum install -y yum-utils device-mapper-persistent-data lvm2 # yum-config-manager -

Docker 入门

拥有回忆 提交于 2020-02-04 22:58:32
1.Docker安装(centos7): # step 1: 安装必要的一些系统工具 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 # Step 2: 添加软件源信息 sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # Step 3: 更新并安装 Docker-CE sudo yum makecache fast sudo yum -y install docker-ce # Step 4: 开启Docker服务 sudo service docker start 2.配置镜像加速器: 针对Docker客户端版本大于 1.10.0 的用户 您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://8yy96a18.mirror.aliyuncs.com"] } EOF sudo systemctl daemon

threading 使用笔记

隐身守侯 提交于 2020-02-02 01:15:38
threading模块介绍以及常用方法 介绍 threading模块是Python支持多线程编程的重要模块,该模块是在底层模块_thread的基础上开发的更高层次的线程编程接口,提供了大量的方法和类来支持多线程编程。 threading模块常用方法表 方法 功能说明 threading.active_count() 获取当前处于alive状态的Thread对象数量 threading.current_thread() 获取当前的Thread对象 threading.get_ident() 获取当前线程的线程标识符 threading.enumerate() 获取当前处于alive状态的所有Thread对象列表 threading.main_thread() 获取主线程对象,即启动Python解析器的线程对象 threading.stack_size([size]) 获取创建线程时所使用的栈的大小,如果指定size参数,则用来指定后续创建线程使用的栈大小,size必须是0或大于32K的正整数 简单例子 # 例 1-1 import threading ''' 0 ''' print ( threading . stack_size ( ) ) ''' Traceback (most recent call last): ** IDLE Internal Exception: File

Correct way to start docker daemon listening to specific port

扶醉桌前 提交于 2020-02-01 03:42:33
问题 I´m new to docker and want to start it in daemon mode listening to a specific IP-adress and port. In the documentation it is said that this can be done by writing sudo /usr/bin/docker daemon -H 0.0.0.0:5555 . It then says that I can list running containers with this command docker ps . If I try this I get the following message: Get http:///var/run/docker.sock/v1.20/containers/json?all=1: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled

centos环境下安装docker

风流意气都作罢 提交于 2020-01-31 13:33:38
目前Docker支持centos 7及以后版本。 本文中使用的是centos7系统。 安装所需的软件包 $ sudo yum install update $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 设置稳定的仓库 官方源 $ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 有时由于网络问题,无法访问官方源,也可以添加国内源: $ sudo yum-config-manager \ --add-repo \ https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo 安装docker $ sudo yum install docker-ce 安装过程中,也会将docker-ce-cli, containerd.io 作为依赖进行安装。 启动docker sudo systemctl start docker 查看docker进程是否已经启动: $ ps -ef| grep docker root 12486 1 0 23:21 ? 00:00:00 /usr/bin/dockerd -H

python中的deamon进程

﹥>﹥吖頭↗ 提交于 2020-01-31 04:06:07
python官方说python进程是系统的原生进程,线程也是系统的原生线程。最近需要在linux下设置python deamon进程 #!/usr/bin/python # -*- coding: utf-8 -*- # Daemon.py # # Created on: 2011-8-29 # Author: roberts import sys, os, time, atexit from signal import SIGTERM class Daemon: """ A generic daemon class. Usage: subclass the Daemon class and override the _run() method """ def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): self.stdin = stdin self.stdout = stdout self.stderr = stderr self.pidfile = pidfile def _daemonize(self): """ do the UNIX double-fork magic, see Stevens' "Advanced Programming in

田小花语音机器人(三)使用python的threading类建立基础多线程程序

和自甴很熟 提交于 2020-01-30 13:33:06
本来是想用thread来着,结果在开始导入thread模块的时候就掉坑了 好气哦,ubuntu 环境下打开pycharm搜索这个模块竟然找不到!!! 于是我换源,参考这篇博客: https://blog.csdn.net/IAMoldpan/article/details/78544598 结果还是不行T_T 我输了,去找答案,于是乎网上说python3里面已经把thread取代了… Python 为啥不建议使用 thread模块? 于是换成threading threading有比thread更好的线程管理和解决方法 搜索pythreading,直接成功,废了我一个小时时间 ×_× 55555 教程参考大神的文章: Python多线程编程(一):threading 模块 Thread 类的用法详解 python:threading.Thread类的使用详解 下面是我学习的代码,实现了如下功能: 1、建立了两个子线程 2、主线程和子线程分别按照时间顺序打印数字i,得到三组不同输出 3、使用time类获得延时操作 4、使用相关线程方法使得主线程和线程2必须在线程1执行结束以后才执行 代码如下: #!/usr/bin/python #encoding:utf-8 # import time import threading def function(): for i in range

How to ask CompletableFuture use non-daemon threads?

馋奶兔 提交于 2020-01-29 08:43:06
问题 I have wrote following code: System.out.println("Main thread:" + Thread.currentThread().getId()); CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { try { System.out.println("Before sleep thread:" + Thread.currentThread().getId(), + " isDaemon:" + Thread.currentThread().isDaemon()); Thread.sleep(100); System.out.println("After sleep"); } catch (InterruptedException e) { e.printStackTrace(); } }); future.whenComplete((r, e) -> System.out.println("whenCompleted thread:" +

Rsync快速入门实例(转)

安稳与你 提交于 2020-01-28 13:21:30
三种主要数据传输方式 单主机本地目录间数据传输(类似cp) Local: rsync [OPTION...] SRC... [DEST] 借助rcp,ssh等通道来传输数据(类似scp) Access via remote shell: Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST] Push: rsync [OPTION...] SRC... [USER@]HOST:DEST 守护进程(socket)的方式传输数据 Access via rsync daemon: Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST] rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST] Push: rsync [OPTION...] SRC... [USER@]HOST::DEST rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST 选项 常用: -z, --compress 对备份的文件在传输时进行压缩处理。 -v, --verbose 详细模式输出。 -a, --archive 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于-rlptgoD。 -