泡面师

  • 首页
  • 记录
记录
golang

golang使用mysql连接池

安装 go get github.com/go-sql-driver/mysql 初始化 import ( "database/sql" _ "github.com/go-sql-driver/mysql" ) var db, _ = sql.Open("mysql", "root:root@tcp(127.0.0.1:3306)/testmysql") func init(){ db.SetMaxOpenConns(threadNum) db.SetMaxIdleConns(threadNum / 2) } 查询…

2021-05-25 0条评论 2977点热度 0人点赞 泡面师 阅读全文
golang

golang使用redis连接池

安装 go get github.com/gomodule/redigo/redis 初始化 import ( "github.com/gomodule/redigo/redis" ) var pool *redis.Pool func init() { pool = &redis.Pool{ //实例化一个连接池 MaxIdle: 16, //初始连接数 MaxActive: 0, //池的最大连接数,0为自动 IdleTimeout: 300, //连接超时关闭时间 Dial: func() (redi…

2021-05-25 0条评论 2871点热度 0人点赞 泡面师 阅读全文
PHP

laravel7的日期格式问题

laravel7.x之前时间格式为 2020-07-11 23:27:16 laravel7.x之后时间格式为 2020-07-11T23:27:16.000000Z 如果7.x版本想显示之前的时间格式 在model文件中加入 use DateTimeInterface; protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); }

2020-07-15 0条评论 4990点热度 17人点赞 泡面师 阅读全文
python

pyinstaller打包pyqt5后的程序报错Failed to execute script

使用pyqt5写的程序在调试时运行一切正常 用pyinstaller打包后在本地运行也一切正常 到其他电脑上运行就报错Failed to execute script 解决方法 打开程序文件在头部加入以下代码成功解决 import sys import os if hasattr(sys, 'frozen'): os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH']

2020-03-21 0条评论 5803点热度 13人点赞 泡面师 阅读全文
记录

mac使用iterm2进行rzsz

先安装lrzsz brew install lrzsz 下载iterm2-zmodem wget https://raw.githubusercontent.com/aurora/iterm2-zmodem/master/iterm2-zmodem 放到/usr/local/bin/ mv iterm2-zmodem /usr/local/bin/ 配置 设置为: Regular Expression Action parameters **B0100 Run Slilent Coprocess..…

2019-08-29 0条评论 4037点热度 0人点赞 泡面师 阅读全文
centos

网站设置301重定向

nginx设置301重定向 可以直接在nginx的配置文件中加if ($host = paomianshi.com) { return 301 http://www.$host$request_uri; } apache设置301重定向 在网站根目录新建.htaccess文件,加入以下内容(需要开启mod_rewrite) RewriteEngine On RewriteCond %{HTTP_HOST} ^paomianshi.com [NC] RewriteRule ^(.*)$ http://www.paom…

2019-05-13 0条评论 2720点热度 0人点赞 泡面师 阅读全文
centos

安装selenium和chromedriver

selenium 测试直接在浏览器中运行,可以模拟真实用户浏览网站。selenium 测试可以在 Windows、Linux 和 Macintosh上的 Internet Explorer、Chrome和 Firefox 中运行 centos7 安装selenium和chromedriver 先安装好python3 安装相关包 yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-d…

2019-04-30 0条评论 3667点热度 2人点赞 泡面师 阅读全文
centos

centos安装supervisor

安装supervisor pip install supervisor 重定向默认配置文件 echo_supervisord_conf > /etc/supervisor/supervisord.conf 如果报错pkg_resources.DistributionNotFound: meld3>=0.6.5 注释/usr/lib/python2.6/site-packages/supervisor-3.3.4-py2.6.egg-info/requires.txt的#meld3 >= 0.6.5 开启…

2019-03-23 0条评论 3069点热度 2人点赞 泡面师 阅读全文
PHP

oneinstack php增加fileinfo扩展

解压源文件 cd /home/oneinstack/src tar -zxvf php-7.0.32.tar.gz 生成configure文件 cd /home/oneinstack/src/php-7.0.32/ext/fileinfo 执行 /usr/local/php/bin/phpize 编译安装 ./configure --with-php-config=/usr/local/php/bin/php-config make && make install 开启扩展 /usr/local/p…

2018-11-04 0条评论 4265点热度 0人点赞 泡面师 阅读全文
python

playbook复制和编辑文件

远程拷贝到远程 --- - hosts: all tasks: - name: 复制文件 copy: src: /home/test.txt dest: "/home/test123.txt" remote_src: True owner: root group: root mode: 0644 本地拷贝到远程 --- - hosts: all tasks: - name: 复制文件 copy: src: /home/test.txt dest: "/home/test123.txt" owner: root gr…

2018-07-20 0条评论 4044点热度 12人点赞 泡面师 阅读全文
123
分类
  • centos (13)
  • golang (2)
  • PHP (4)
  • python (10)
  • 记录 (5)
最新 热点 随机
最新 热点 随机
golang使用mysql连接池 golang使用redis连接池 laravel7的日期格式问题 pyinstaller打包pyqt5后的程序报错Failed to execute script mac使用iterm2进行rzsz 网站设置301重定向
centos 7 安装 oh-my-zsh centos限制目录大小 golang使用mysql连接池 golang使用redis连接池 centos下Flask使用任务队列celery Mac 安装 scrapy
标签聚合
golang mysql go-redis redigo iterm2 scrapy redis git Flask centos

COPYRIGHT © 2024 泡面师. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS