工作记录
jack_ricky
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
使用TeamCymru获得IP对应的BGP-Prefix和AS number
将所有的IP分成2500个IP一个文件(split -l 2500 all_ip.txt),每个文件第一二行分别是begin,verbose 使用TeamCymru提供的接口处理每个文件 #!/bin/bashPROCESS_NUM=0function getdir(){ for element in `ls $1` do dir_or_file=$...原创 2019-11-14 21:35:38 · 431 阅读 · 0 评论 -
Python 读取文件的几种方法
0. 读取文件# 1f = open('fileName', 'r')# do something with ff.close()# 2with open('fileName', 'r') as f: # do something with f # no need to close, and will close automatically if exceptio...原创 2019-11-07 17:10:24 · 475 阅读 · 0 评论 -
Python 内存回收
import gcdel datagc.collect()原创 2019-08-21 15:40:35 · 315 阅读 · 0 评论 -
MATLAB GMM
clearclcdisp 'Loading...'feature_list = csvread('feature_list.csv');disp 'scaling...'feature_z = zscore(feature_list);GMM_3 = fitgmdist(feature_z, 3, 'RegularizationValue', 0.1);disp 'GMM 3...原创 2019-07-09 11:25:52 · 1218 阅读 · 0 评论 -
linux环境下 python import找不到自定义的模块
两种方法:1. 在导入模块之前(每个.py文件都需要加)import syssys.path.append(r'/home/my_python_module/')2. 更改环境变量(一次修改永久生效)管理员权限修改:/etc/profile。在最后一行加上:export PYTHONPATH=$PYTHONPATH:/home/my_python_module/然后运...原创 2019-06-24 09:32:35 · 8009 阅读 · 0 评论 -
Holt-Winters 方法进行时间序列预测 与 评价指标
本文主要对HW方法进行简单的特点、使用介绍。HW方法比较适用于具有明确周期性的序列。python代码如下:from statsmodels.tsa.holtwinters import ExponentialSmoothing def hw_predict(sample_serie, s_p=4, s_index=0, e_index=10): hw_fit = Expone...原创 2019-04-02 21:51:29 · 5074 阅读 · 0 评论 -
python 带条纹的 barplot 和 boxplot
plt.boxplot(..., patch_artist=True, boxprops=dict(facecolor="green", hatch = '/'))plt.bar(..., hatch='\\')原创 2019-02-19 21:03:28 · 2297 阅读 · 0 评论 -
LaTex插入eps或pdf(或svg)以及去除eps、pdf白边
1. 插入eps\begin{figure}\centering\includegraphics[width=3.33in, keepaspectratio]{fig_name}\caption{title}\end{figure}2. 插入pdf(类似于插入eps)\begin{figure}\centering\includegraphics[width=3.33i...原创 2018-10-30 21:29:46 · 37763 阅读 · 6 评论 -
IP转经纬度,经纬度画热力图
1. IP转经纬度工具:GeoIP python 每个IP一行 代码:import GeoIPimport sysimport osdef print_usage(): print "Usage: " + os.path.basename(__file__) + " ipfile.txt"# make sure we've been passed the filename...原创 2018-10-26 15:13:59 · 4351 阅读 · 0 评论 -
处理日志的心得体会
不要急着把数据拷到硬盘(如果数据量小,拷一份原始的数据还是有必要的),先把数据进行清理,然后逐行提取字段的值,将提取出的值用逗号分隔组成新的一行再存储。需要使用的时候,只需要用逗号分隔string,然后读取所需字段对应的下标即可!import osimport redir = "/data/scr/"files = os.listdir(dir1)dst_dir = ...原创 2018-04-21 21:55:34 · 414 阅读 · 0 评论 -
windows+xshell+xming 显示远程linux服务器的图形程序窗口
1. linux服务器设置允许ssh转发:#vi /etc/ssh/sshd_config确保 X11Forwrding yes 生效2. 安装xming在Xlaunch中配置(采用如下默认配置)运行xming3. xshell中对连接属性进行设置至此,全部设置完成。在 “应该出现的时候” 会弹出linux服务器的图形程序界面。...原创 2018-03-21 09:51:53 · 6903 阅读 · 0 评论 -
linux挂载硬盘
1. df -h 查看已挂载硬盘情况2. fdisk -l 查看所有可用硬盘的情况,找到需要的挂载的硬盘3. mount /dev/sd[xn] [挂载的文件夹]4. [挂载的文件夹]就是硬盘umount [挂载的文件夹] 挂载的反操作...原创 2018-02-28 19:51:38 · 230 阅读 · 0 评论 -
Python/bash 去除/输出 包含关键字的行
Pythonimport shutilwith open('/path/to/file', 'r') as f: with open('/path/to/file.new', 'w') as g: for line in f.readlines(): if '/local/server' not in line: ...原创 2018-03-08 10:05:08 · 2067 阅读 · 0 评论
分享