自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(353)
  • 资源 (1)
  • 收藏
  • 关注

原创 python : statemachine

statemachine

2022-09-19 13:22:30 521 1

原创 python rpc using zmq-XPUB/XSUB

rpc python zmq

2022-09-01 15:15:36 869

原创 python zmq xpub/xsub

zeromq python xpub/xsub proxy

2022-08-31 15:21:31 598

原创 python DLL

python call DLL generated by Visual Studio 2019

2022-08-09 11:15:59 138

原创 zerorpc:async=True can be written as **{“async“: True}

zerorpc: 异步参数处理

2022-08-08 14:30:10 304

原创 相干采样 FFT python

import numpyimport numpy as npfrom scipy.fftpack import fftimport matplotlib.pyplot as pltfrom matplotlib.pylab import mplmpl.rcParams['font.sans-serif'] = ['SimHei'] # 显示中文mpl.rcParams['axes.unicode_minus'] = False # 显示负号# https://drr.ikcest.o.

2022-05-08 16:27:48 1603

原创 ZeroMQ:事件监控

#include <stdio.h>#include <zmq.h>#include <string.h>#include <assert.h>#include <malloc.h>//http://api.zeromq.org/4-2:zmq-socket-monitorstatic int get_monitor_event(void* monitor, int* value, char* address){ // Fir.

2022-04-21 15:09:20 3418

原创 python有用的库:tqdm/viztracer

tqdm:Fast, Extensible Progress Meterviztracer:A debugging and profiling tool that can trace and visualize python code execution

2022-04-21 11:08:56 722

原创 python:zeromq:send_multipart:send_string

import zmqimport randomimport timefrom multiprocessing import Processa = ['one', 'two', 'three', 'four', 'five']b = [10, 20, 30, 31, 50]d = dict(zip(a, b))def pub001(): context = zmq.Context() socket = context.socket(zmq.PUB) socket..

2022-04-18 14:10:26 756

原创 python/tornado/ioloop/push-pull

import timeimport zmqfrom zmq.log.handlers import PUBHandlerimport loggingfrom threading import ThreadLOG_URL = 'tcp://127.0.0.1:12345'def consume(url): ctx = zmq.Context.instance() s = ctx.socket(zmq.PULL) s.connect(url) while T.

2022-04-16 15:45:50 640

原创 python/zeromq/logger

import timeimport zmqfrom zmq.log.handlers import PUBHandlerimport loggingfrom threading import ThreadLOG_URL = 'tcp://127.0.0.1:12345'handler = PUBHandler(LOG_URL)handler.root_topic = 'foo'logger = logging.getLogger('foobar')logger.setLevel(l.

2022-04-13 15:51:44 804

原创 python/zmq/monitor

此解决方案基于MonitoredQueue example from pyzmq doc服务器绑定到端口5555服务器将绑定到端口5555。与其他示例不同,我将保持服务器作为固定部分,而不会更改它连接到monitoredqueue。但是,这种交换不是问题,也不会产生任何问题(只要您正确地调整MonitoredQueue)。在MonitoredQueue绑定到端口4444,连接到端口5555,在端口7777上发布流量MonitoredQueue位于客户端和服务器之间。它监听端口4444,向服务

2022-04-11 09:35:01 453

原创 python/zeromq/IOLoop

直接用tornado中的IOLoop代替zmq.eventloop.ioloop# coding: utf-8import osimport zmqimport tornado# from zmq.eventloop.ioloop import IOLoopfrom tornado.ioloop import IOLoopfrom zmq.eventloop.zmqstream import ZMQStream# 分类后的日志的zmq的pub地址LOG_TYPE_PUB_PATH.

2022-04-10 11:03:19 617

原创 windows/openPGM/datetime初始化失败

sockaddr.c/* join IP multicast groups */ for (unsigned i = 0; i < res->ai_recv_addrs_len; i++) pgm_setsockopt (sock, IPPROTO_PGM, PGM_JOIN_GROUP, &res->ai_recv_addrs[i], sizeof(struct pgm_group_source_req)); pgm_setsockopt (sock, IPPRO.

2022-04-08 20:26:29 381

原创 Rabbitmq/python/RPC

Rabbitmq/python/RPC

2022-04-02 09:51:00 2703

原创 一种C语言同步代码封装方法

#include "stdio.h"#include <stdarg.h>void SetMeasurementParameter(unsigned int SampleCount, unsigned int SampleInteval,...) { printf("%d %d\r\n", SampleCount, SampleInteval);}void SetMeasurementParameter2(int co.

2022-03-24 13:54:01 888

转载 在 Batch 中使用多实例任务来运行消息传递接口 (MPI) 应用程序

你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问https://docs.azure.cn。在 Batch 中使用多实例任务来运行消息传递接口 (MPI) 应用程序项目 2022/03/11 18 个参与者使用多实例任务可在多个计算节点上同时运行 Azure Batch 任务。 这些任务可在 Batch 中实现高性能计算方案,例如消息传递接口 (MPI) 应.

2022-03-16 17:15:51 348

原创 HDF5/SWMR

import sysimport h5pyimport numpy as npimport loggingfrom multiprocessing import Process, Eventclass SwmrReader(Process): def __init__(self, event, fname, dsetname, timeout=2.0): super(SwmrReader, self).__init__() self._event = .

2022-03-14 19:24:12 1196

原创 python:cmd+zeromq

#https://blog.51cto.com/capricorn/1891402# coding=utf-8from cmd import *import sysfrom subreqnode import SubReqNodefrom multiprocessing import Queue, Processdef subscribe_callback(node): string = node.sub_socket.recv_string() print('{}'.f.

2022-01-26 16:55:30 766

原创 python cmd模块

# coding=utf-8from cmd import *import sysclass TestCmd(Cmd): def __init__(self): Cmd.__init__(self) Cmd.intro="测试用的模块" def do_test1(self,line): print "test模块下的test命令" def help_test1(self): print "用于测试这个模块" .

2022-01-25 15:11:01 841

原创 python/sub/pub/rep/req

[root@han node]# cat pubrepnode.py import zmqimport timea = 0def rep(node): global a print('------------') time.sleep(1) a = a+1 node.pub_socket.send_string("%s %s" % ('onu/online', str(a)))class PubRepNode(object): def __i.

2022-01-24 20:26:43 773

原创 python/timer

import timefrom multiprocessing import Queue, Processclass TimerMgr(object): def __init__(self, TotalTimers): self.totalTimers = TotalTimers self.idleTimers = ['timer'+str(y) for y in range(TotalTimers)] print(self.idleTimers) a =.

2022-01-21 13:07:49 749

原创 python/Queue/timeout

from multiprocessing import Queue, Processdef producer(q): q.put('send a message')def consumer(q): while True: try: item = q.get(timeout=0.1) print(item) except Exception as error: passif __name__ == '__main__': .

2022-01-21 09:44:50 469

原创 python:获取嵌套字典值

[root@han learn_python]# vi getdictvalue.py def getdictvalue(d,code): result=[] if isinstance(d, dict) : try: value = d[code] result.append(value) except Exception as e: pass for value.

2022-01-19 16:05:31 911

原创 Linux /dev/mem的新玩法

来自《解决Linux内核问题实用技巧之-dev/mem的新玩法》Linux /dev/mem的新玩法_Netfilter,iptables/OpenVPN/TCP guard:-(-CSDN博客Linux /dev/mem的新玩法_Netfilter,iptables/OpenVPN/TCP guard:-(-CSDN博客/dev/mem里有什么简单来讲,/dev/mem是系统物理内存的映像文件,然而这里的 “物理内存” 需要进一步解释。物理内存是指我们插在内存槽上的内存条吗?当然是,但物理内存不单

2022-01-01 21:48:56 616

原创 rebar test

[root@han eredis_pool]# lltotal 160drwxrwxr-x 4 1001 1001 35 Dec 31 04:49 depsdrwxrwxr-x 2 1001 1001 154 Dec 31 04:49 docdrwxrwxr-x 2 1001 1001 109 Dec 31 04:55 ebin-rw-rw-r-- 1 1001 1001 395 Dec 31 04:55 Makefile-rw-rw-r-- 1 1001 1001 .

2021-12-31 13:09:18 487

原创 kamailio.cfg

#!KAMAILIO######## Include Local Config If Exists #########import_file "kamailio-local.cfg"##!define WITH_MULTIDOMAIN#!define WITH_NAT 1#!define WITH_NATSIPPING 1#!define WITH_BLOCK3XX 1####!define WITH_TRUNK 0#!define WITH_REGISTER 1####### .

2021-12-23 15:40:57 1167

原创 sipp-callee-coloring

<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE scenario SYSTEM "sipp.dtd"><!-- This program is free software; you can redistribute it and/or --><!-- modify it under the terms of the GNU General Public License as --.

2021-12-23 13:09:18 235

原创 freeswitch-180-sdp-180-no-sdp

freeswitch@WIN-H1VJCKECDO1> 2021-12-23 11:20:31.913500 [NOTICE] switch_channel.c:1118 New Channel sofia/internal/[email protected]:5060 [42e4265f-9ac5-4801-800a-87fafe15a982]2021-12-23 11:20:31.913500 [DEBUG] switch_core_state_machine.c:585 (sofia/i.

2021-12-23 13:07:01 1568

转载 如何优雅的阅读开源项目源码

作者:二两链接:https://zhuanlan.zhihu.com/p/149769949来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。我阅读过一些比较知名的 Python 第三方库的源码,如 Flask、APScheduler、requests 等,虽然不多,但有点浅显的经验可以分享。使用 tag一个知名的项目,通常经过较长时间的开发,如 requests、pytest 等,从 github 上拉下来,直接开看,通常会有点闷逼,此时你可以按 tag .

2021-12-18 16:31:00 308

原创 freeswitch----early media passthrough

2021-12-06 15:37:50.585233 [DEBUG] switch_core_state_machine.c:651 (sofia/internal/[email protected]:5060) State EXECUTE2021-12-06 15:37:50.585233 [DEBUG] mod_sofia.c:209 sofia/internal/[email protected]:5060 SOFIA EXECUTE2021-12-06 15:37:50.585233 .

2021-12-06 15:43:59 1495 1

原创 python-bytes-str转换

来源:python之bytes和string - skiler - 博客园1、bytes主要是给计算机看的,string主要是给人看的2、中间有个桥梁就是编码规则,现在大趋势是utf83、bytes对象是二进制,很容易转换成16进制,例如\x644、string就是我们看到的内容,例如'abc'5、string经过编码encode,转化成二进制对象,给计算机识别6、bytes经过反编码decode,转化成string,让我们看,但是注意反编码的编码规则是有范围,\xc8就不是utf8

2021-12-05 08:47:18 458

原创 python3-epoll-server-client

#!/usr/bin/env python#-*- coding:utf-8 -*- import socketimport selectimport queue serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)serversocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)server_address = ("127.0.0.1", 888.

2021-12-05 08:27:29 1152

原创 CentOS7---tftp(安装、配置、使用)

TFTP一般用于向目标板下载镜像文件TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现。嵌入 式linux的tftp开发环境包括两个方面:一是linux服务器端的tftp-server支持,二是嵌入式目标系统的tftp-client支持。 因为u-boot本身内置支持tftp-client,所以嵌入式目标系统端就不用配置了。下面就详细介绍一下linux服务器端tftp-server 的配置。安装:执行下面的命令能够看到服务是否已经启动,若已经启动则不用安装,否则需要安装下面的步骤安装tft

2021-12-04 19:34:43 3474

转载 SIP协议/框架

Service Creation Environment (SCE ) for SIPApplicationsI hoped of making a SIP application Development environment a year back and worked towards it earnestly . Sadly I wasn’t able to complete the job yet I have decided to share a few things about it he.

2021-12-01 08:57:46 12431

转载 opensips 配置文件

opensips 配置文件Upon installation, the default configuration file path is :[INSTALL_PATH]/etc/opensips/opensips.cfgThe configuration file is text-based, written in an OpenSIPS custom language, very similar to the C language. You will find different vari

2021-11-30 12:58:47 32484

原创 CentOS利用Lua访问Redis

CentOS利用Lua访问Redis首先确保你编译的Lua是支持链接外部动态链接库的。因为在对Redis进行访问时是需要使用socket通信的,而这依赖于外部的C语言写的动态连接库。首先,这里先下载Redis的Lua客户端访问包redis-lua,下载地址:https://github.com/nrk/redis-lua下载之后,直接解压就行,下载的zip的话,可以使用unzip 压缩包 就可以了。因为对Redis进行访问需要使用socket进行通信,所以需要下载Socket动态连接库.

2021-11-13 20:53:57 230

原创 freeswitch1.10.6从Centos源码安装(成功)

freeswitch1.10.6从Centos源码安装(成功) - 简书

2021-11-02 08:43:56 239

原创 httpd关于web-dav的配置

# Load config files in the "/etc/httpd/conf.d" directory, if any.IncludeOptional conf.d/*.confDavLockDB "var/davlock"Alias /webdav /home/yhhan/webdav<location /webdav> Dav On Order Allow,Deny Allow from all AuthType Digest .

2021-09-14 15:27:13 1298 1

原创 Monitor CPU/MEM/storage

[root@han kazoo-4.3.140]# cat /root/monitor_cpu.sh#!/bin/bash#system process CPU&MEM use information#mail: [email protected]=$1name=$2process=$3mem_total=$(cat /proc/meminfo | grep "MemTotal" | awk '{printf "%.f",$2/1024}')cpu_total=$(( $.

2021-09-06 09:24:21 181

SUO introuduction

介绍SIP协议,对于需要了解SIP协议的人会有较好的帮助。

2011-08-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除