分类 perl/php/python/gawk/sed articles

win7+python+opencv配置

当前各种无人概念满天飞,而无人背后需要涉及到面部识别,而大多的面部识别技术是在opencv这个开源项目的基础上做出来的。这里在win7主机上也搭建了下简单的win7 + opencv + numpy+ scipy 。opencv是时下最流行的基于C++的开源计算机视觉库,从最基本的读写图片,到简单的图像处理(比如降噪滤……

Continue reading

钉钉webhook实现告警通知

之前的运维告警多通过SMS、mail 等方式通知到相应的人员。不过虽着 IM 和手机APP的发展,很多告警也会发送到IM软件上去。目前比较常用的是发送到微信和钉钉上。不过微信发送时,需要开通企业公众号,比较麻烦。而钉钉在今年更新的机器人功能比较易用,只要启用的有钉钉,可以通过官方提供的A……

Continue reading

tushare画图库TuChart

Tushare是一个用于获取股票行情数据的开源python库。TuChart是一个基于Echarts和Tushare的股票视觉化应用,其可以看作是tuchart配套的。该库使用起来还是比较人性化的,因为其调用了qtpy 库,所以直接运行就是图形化选择的界面,通过该界面可以选取我们想……

Continue reading

通过mysql+PHPExcel实现查询导出

通过php+mysql自建了几个zabbix事件查询的页面,不过后面在web页面上查询完,需要将结果导出到excel 时,感觉不怎么方便,当然可以通过python 实现快速导出到excel 。也可以通过mysql 官方出的插件,直接在excel 里进行SQL查询并返回。不过为了便于在页面上……

Continue reading

matplotlib汇制时间索引的k线图

使用matplotlib 可以汇制行情图(为方便取数据,这里行情源还是用的tushare),不过在汇图的时候想要使用时间作为x列,格式“2017-01-01”这种格式,发现只有bar类型的图可以正常在下面显示出时间序列,其他像折线图,k线图等都不能正常显示时间序列。后来研究发现在使……

Continue reading

利用Jinja2模板生成html页面

本篇实现的作用是利用Jinja2模板根据需要生成html 页面。 ghtml.py内容如下: 1# cat ghtml.py 2#!/usr/bin/env python 3# coding=utf-8 4# code from www.361way.com 5import os 6from jinja2 import Environment, FileSystemLoader 7PATH = os.path.dirname(os.path.abspath(__file__)) 8TEMPLATE_ENVIRONMENT = Environment( 9 autoescape=False, 10 loader=FileSystemLoader(os.path.join(PATH, 'templates')), 11 trim_blocks=False) 12def render_template(template_filename, context): 13 return TEMPLATE_ENVIRONMENT.get_template(template_filename).render(context) 14def create_index_html(): 15 fname = "output.html" 16 urls = ['http://www.361way.com/tag/python', 'http://www.361way.com/tag/linux', 'http://www.361way.com/tag/mysql'] 17 context = { 18 'urls': urls 19 } 20 # 21 with open(fname, 'w') as f: 22 html = render_template('index.html', context) 23 f.write(html) 24def main(): 25 create_index_html() 26######################################## 27if __name__ == "__main__": 28 main() templates/in……

Continue reading

python装饰器

python装饰模式有很多经典的使用场景,例如插入日志、性能测试、事务处理等等,有了装饰器,就可以提取大量函数中与本身功能无关的类似代码,从而达到代码重用的目的。装饰器实际上就是一个函数,其有如下两个特别之处: 1.参数是一个函数 2.返回值是一个函数 一、无参装饰器 这里先实现一个简单……

Continue reading

pandas小结(七)merge、join与concat

一、merge、join与concat的区别 Pandas.DataFrame操作表连接有三种方式:merge, join, concat。三者的使用很容易搅浑,三者之间的区别什么呢? merge 相当于SQL中的JOIN。该函数的典型应用场景是,两张表有相同内容的列(即SQL中的键),现在我们想把两张表……

Continue reading

pandas小结(六)merge数据合并

在《pandas小结(五)concat数据合并》中提到了数据合并,本篇学习另一个数据合并方法merge,不过这个和concat是有区别的,concat方法准确的说更像是级联,而不算合并,merge才是真正意义的合并。merge个人用的比较多的一个场景就是两个pandas数据,有相……

Continue reading

pandas小结(五)concat数据合并

pandas数据的行更新、表合并等操作,一般用到的方法有concat、join、merge。本篇先说concat方法。其具体用法如下: 1pd.concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, 2 keys=None, levels=None, names=None, verify_integrity=False) 常用参数说明: objs: series,dataframe或者是panel构成的序列lsit axis: 需要合并链接的轴,0是行,1是列 j……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta