-
置顶 Pipenv的使用(一款比较不错的python包管理工具)
pipenv虚拟包管理工具的日常使用方法...
-
Ubuntu 18.04基础环境安装
1.安装ssh客户端 sudo apt update sudo apt install -y openssh-server 2.安装python3.7及pip3 安装python3.7 sudo apt install -y python3.7 更改python3命令使其指向python3.7 sudo rm -rf /usr/bin/python3 sudo ln -s /usr/bin/python3.7 /usr/bin/python3 安装pip3 sudo apt install -y python3-pip 升级并将pip3命令替换为pip sudo pip3 install --upgrade pip 3.pip换源 在当前用户目录下建立文件夹.pip mkdir ~/.pip 创建pip.conf文件 vim ~/.pip/pip.conf 写入以下内容保存即可: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=mirrors.aliyun.com 附:其他国内镜像源 清华:https://pypi.tuna.tsinghua.edu.cn/simple 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 华中理工大学:http://pypi.hustunique.com/ 山东理工大学:http://pypi.sdutlinux.org/ 豆瓣:http://pypi.douban.com/simple/ 阿里:https://mirrors.aliyun.com/pypi/simple 4.安装MySQL 安装mysql命令 sudo apt install -y mysql-server 设置允许MySQL远程连接:修改配置文件,找到bind-address = 127.0.0.1一行,加#注释掉 sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 重启MySQL服务 sudo service mysql restart 查看MySQL临时登录用户名及密码 sudo cat /etc/mysql/debian.cnf 使用临时用户名登录MySQL mysql -u debian-sys-maint -p 修改root用户密码,依次输入以下sql语句: use mysql; update user set host='%' where user='root'; update user set authentication_string=password('pg123456') where user='root'; update user set plugin='mysql_native_password'; flush privileges; quit; 5.安装Redis 安装Redis命令 sudo apt install -y redis-server 配置Redis允许远程连接,修改Redis配置文件 sudo vim /etc/redis/redis.conf 注释掉bind 127.0.0.1 ::1,将protected-mode修改为no 重新启动Redis以便更改生效 sudo systemctl restart redis-server 6.安装Apache2 安装Apache2命令 sudo apt install -y apache2 安装Apxs,运行python程序需要 sudo apt install -y apache2-dev 设置目录权限 sudo chmod -R 777 /var/www 7.安装ntp并对时 安装ntp命令 sudo apt install -y ntp 修改配置文件,注释5行pool开头内容 sudo vim /etc/ntp.conf 与其他ntp服务器对时 tinker panic 0 server 10.143.27.2 prefer minpoll 3 maxpoll 10 restric 10.143.27.2 将自己作为ntp服务器 server 127.127.1.0 fudge 127.127.1.0 stratum 10 restrict 192.168.3.0 mask 255.255.255.0 nomodify notrap 8.PyQt客户端运行所需库安装 sudo apt install --reinstall libxcb-xinerama0 9.修改IP地址 sudo vim /etc/netplan/01-network-manager-all.yaml ethernets: enp3s0: dhcp4: false addresses: [192.168.6.21/24] gateway4: 192.168.6.1 enp4s0: dhcp4: false addresses: [192.168.30.50/24] 10.定时任务 30 0 * * * /home/pg/save_data.sh * * * * * /home/pg/restart.sh ...
-
Cmake使用说明
MakeFile中用CMake方法记录...
-
Clickhouse安装
clickhouse的基本部署及使用...
-
Pyro4的一个简单通信案例
机器数据交互的一种方式,可以对数据进行压缩,效率比原有的redis中间件有所提高...
-
将文件拖入校验文件id是否连续的工具
校验文件内数据连续性...
-
pyo3(rust包的)测试
rust的自定义包效率测试...
-
linux下多进程收发数据,提高采样率方法
# coding=utf-8 import socketserver import multiprocessing import time from multiprocessing import Manager # 创建一个多进程共享的队列 manager = Manager() data_queue = manager.Queue() class MyUDPHandler(socketserver.BaseRequestHandler): def handle(self): data = self.request[0] # 将接收到的数据放入队列 data_queue.put(data) def process_data(data): while True: # 在这里添加你的处理逻辑,例如,将数据写入文件或执行其他操作 print(f"Processing data: {data.get()}") time.sleep(0.001) if __name__ == "__main__": # 创建 UDP 服务器 server = socketserver.ForkingUDPServer(('0.0.0.0', 21800), MyUDPHandler) # 创建处理数据的子进程 data_process = multiprocessing.Process(target=process_data, args=(data_queue,)) data_process.start() # 启动服务器 server.serve_forever()...
-
记录一次linux下程序性能分析方法
通过工具实时分析,优化代码...
-
cython、python、numpy速度对比
当需要提高python效率时,可以尝试使用各类方法加速,cython的实例实测...