- 博客(44)
- 资源 (13)
- 收藏
- 关注
原创 linux安装.AppImage后缀安装包
假设有个安装包名称为 myinstall.AppImage,添加权限后直接可以运行:chmod a+x myinstall.AppImage./myinstall.AppImage
2020-12-30 15:50:14 3973
原创 上传docker到阿里云镜像仓库
首先请参考:配置阿里云docker加速与云镜像配置的第二部分配置阿里docker云镜像创建命名空间paper_demeen与镜像仓库block_chain后,开始上传:
2020-12-29 11:16:55 630
原创 docker 删除镜像时报错Error response from daemon: conflict: unable to delete xxx (must be forced) -
解决方法方法一:删除时不要使用 image ID,改用镜像名称(REPOSITORY)方法二:docker rmi -f imageID问题解析docker rmi 8e6aee9da407会报错:Error response from daemon: conflict: unable to delete 8e6aee9da407 (must be forced) - image is referenced in multiple repositories使用docker images可以看到
2020-12-29 11:11:14 11718 3
原创 Mac显示放大镜
设置快捷键系统默认是不开启热键的,如果需要设置,操作如下:设置(system preferences)->accessibility,在左侧找到room,进入配置窗口:按如上配置后,按住option键,然后两指向上就可以放大,两指向下就可以缩小...
2020-12-28 14:48:47 2333
原创 geth运行报错zsh: exec format error: ./geth
使用:file geth可知,原因多半是geth与对应的系统不匹配造成的,同理,AMD的mac也暂时用不了这个可以从这里重新下载:https://geth.ethereum.org/downloads/
2020-12-27 19:04:57 6088
原创 以太坊使用puppeth工具
puppeth源于官方的项目编译后,https://github.com/ethereum/go-ethereum即可得到要得到的内容只想用工具,不想自己编译博主编译了一份所有的工具都有,下载:https://download.csdn.net/download/weixin_35757704/13944150工具清单:rlpdumppuppethgethp2psimfaucetexamplesevmethkeydevp2pclefcheckpoint-adminbootnod
2020-12-27 16:47:44 1538
原创 Linux安装以太坊geth客户端
操作比较简单:首先可以到网站上看看最新版的版本号:https://geth.ethereum.org/downloads/wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.25-e7872729.tar.gz生成配置文件:./geth --rpc --rpcaddr '0.0.0.0' --rpcport 8545 --datadir /root/ethereum/ethdir_1 --port
2020-12-27 13:24:29 916
原创 selenium使用浏览器隐私模式加载网站
使用火狐的隐私模式打开百度,代码如下:from selenium.webdriver.firefox.options import Optionsfrom selenium import webdriverurl = 'https://www.baidu.com'options = Options()firefox_profile = webdriver.FirefoxProfile()firefox_profile.set_preference("browser.privatebrowsin
2020-12-26 17:29:31 904
原创 python selenium解决报错SessionNotCreatedException session not created: No matching capabilitie与问题解析
解决方法查看导包是否正确:如果是webdriver.Chrome,那么导包的一切都要是chrome的如果是webdriver.Firefox,那么导入的包也都源于firefox的包出现这个问题是因为由于selenium很多类都很相似,如selenium.webdriver.firefox.options与selenium.webdriver.chrome.options,导致导包的时候容易出错,而代码本身是没有问题的。问题解析错误代码如下:from selenium.webdriver.f
2020-12-26 16:21:39 10251
原创 Mac 配置selenium连接chrome
输入chrome://version/ ,查看chrome版本,如图为87.0.4280.88:到网址http://chromedriver.storage.googleapis.com/index.html 上下载适合自己的版本, 我需要下载的是87.0.4280.88版本对应的chromedriver_mac64.zip下载后:unzip chromedriver_mac64.zipmv chromedriver /usr/local/bin测试一下运行python:f.
2020-12-26 16:14:59 186
原创 docker 配置selenium调用Firefox无界面浏览器
思路docker 拉取一个ubuntu:8.04在docker ubuntu中安装python3.6在docker ubuntu中安装Firefox配置selenium测试操作步骤请参考:在docker容器里创建ubuntu系统进入容器后接着后续的操作在容器中安装python3.6与其他依赖:apt-get updateapt-get install -y python3.6 wget gnupg2 vim python3-pip安装Firefoxapt-get
2020-12-26 13:28:17 1044
原创 ubuntu18.04纯命令行安装chrome
安装chromesudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources.list.d/wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -apt-get updateapt-get install google-chrome-stable安装完成后使用如下命令查看chrom
2020-12-26 11:38:27 753
原创 在docker容器里创建ubuntu系统
思路首先需要安装docker:参考:ubuntu18.04 安装(指定版本/最新版)docker与docker compose拉取ubuntu:docker pull ubuntu:18.04运行容器:docker run docker exec -it 容器ID /bin/bash
2020-12-26 10:37:21 1579
原创 docker导入与导出容器
使用docker ps可以查看已有的docker容器的id,或是进入容器后的root@e7b5145e5e71,root后即为容器的id导出容器docker export -o 导出的文件名 容器id例:docker export -o docker_cont.tar e7b5145e5e71导入容器例:docker import docker_cont.tar这里的导入会导入为镜像...
2020-12-25 16:36:49 210
原创 使用U盘在Windows与Mac上传输数据
修改方法:将U盘插在Mac上(可能需要拓展器才行)点击erase,在弹出的选项中,可以修改U盘的名称与文件格式将文件格式改为ExFAT确认后,就可以确保U盘可以在Mac与windows上使用,但是已经在U盘上的数据会被清除。...
2020-12-25 16:19:26 1921
原创 Linux查询端口的任务
文章目录查询已占用的端口情况根据端口查询任务查询已占用的端口情况netstat -tunlp # Linux# -t 是显示tcp# -u 是显示udp# -l 是显示listen的端口或lsof -i # Mac根据端口查询任务netstat -tunpl | grep 端口号或lsof -i:端口号...
2020-12-24 19:53:34 222 1
原创 Mac 上无法使用netstat的-p参数
解决方法改为使用lsof命令,例:lsof -i -P | grep -i "listen"问题解析如果像linux一样使用netstat -tunlp,会收到如下报错:netstat: option requires an argument -- pUsage: netstat [-AaLlnW] [-f address_family | -p protocol] netstat [-gilns] [-f address_family] netstat -i | -I interface
2020-12-24 19:50:56 1902 1
原创 采集浏览器访问某网站时产生的流量,并保存为pcap文件
如果直接采集访问一个网站的流量,会得到各种莫名其妙的包,很难做分析,但是简单操作之后就可以得到相对干净的流量,操作方法如下(以火狐浏览器为例):参考https://blog.csdn.net/weixin_35757704/article/details/111556072,关闭火狐主页多余的加载页在设置里搜索clear,在Cookies and Site Data选项中,清理掉浏览器的数据,因为在使用搜索框时,这些历史访问的记录会被火狐预操作一番:打开隐私模式,即Private Window:
2020-12-24 10:57:51 552
原创 linux添加ssh公钥免密登录
思路(比如我的电脑是MY,我想免密码登录Remote)在MY的机器生成一个rsa公钥在Remote的~/.ssh/authorized_keys文件中添加MY的rsa公钥在MY上使用ssh登录Remote,测试是否添加成功生成rsa秘钥:ssh-keygen -t rsa一路回车后就会在~/.ssh/目录下生成私钥文件:id_rsa与公钥文件:id_rsa.pub,复制id_rsa.pub的内容,这里的内容需要加入到远程电脑中可选参数:-t 可选加密方法,有:dsa | ecds
2020-12-23 12:31:40 3709
原创 python旋转matplotlib绘制的三维图
Pycharm不要默认在pycharm旁边看图,而是用原本的看图工具就可以看三维效果,切换方法pycharm 打开设置界面在搜索框中搜索Scientific定位到Tool下的 Show plots in tool window选项,取消勾选,重新绘图即可Jupyter先安装ipympl:!pip install ipympl在jupyter中添加:%matplotlib notebook之后绘制的图像就可以有移动,选择,保存等操作...
2020-12-21 19:24:57 5596 2
原创 解决Numpy 报错 ValueError: zero-size array to reduction operation maximum which has no identity
这是因为numpy对一个空的array做运算操作造成的,如:x = np.array([])# x + 1 # 会报错建议在代码中可以改为:if x.size == 0: print('x.size is 0')else: print('x.size > 0')
2020-12-21 19:09:07 13273
原创 matplotlib绘制三维折线图
如下代码:import matplotlib as mplimport numpy as npimport matplotlib.pyplot as pltmpl.rcParams['legend.fontsize'] = 10 fig = plt.figure()ax = fig.gca(projection='3d')x = np.random.randint(0,10,20) # 生成20个随机整数y = np.random.randint(0,10,20)z = x/(x+y)
2020-12-21 19:01:59 2967
原创 ipv6网络使用scp,并解决No route to host与no matches found报错
从本地上传文件到远程服务器:scp 本地文件 root@\[ipv6地址\]:远程目录例:scp test.txt root@\[2001::41:21\]:/root/如果ipv6地址没有用”[ ]“包起来,会报错No route to host;如果没有加反斜杠\[ \],会报错no matches found;...
2020-12-20 14:19:32 2478 2
原创 解决由于sz rz导致抓包时文件容量增加
原因是使用sz rz传输数据时是网络传输行为,在使用tshark等抓包软件抓取数据包时,会同样抓取sz rz传输产生的数据包。解决方案按照时间戳截取掉传输时那一段的流量,因为后续的采集工作仍在继续,所以并不会影响后续的采集工作。...
2020-12-20 11:15:19 216 1
原创 python计算AA制时砍价后大家需要分摊的钱
经常和同学拼外卖,商家总会有满减,所以这个是计算AA制条件下,算上满减折扣等之后,大家需要平摊的钱def get_money(money: list, sum_money): pix = sum_money / sum(money) for index, i in enumerate(money): money[index] = round(i * pix, 1) return moneyif __name__ == '__main__': money
2020-12-19 15:07:44 757 1
原创 matplotlib绘制箭头
文章目录小型的箭头大型的箭头小型的箭头import matplotlib.pyplot as pltimport numpy as npplt.arrow(0, 0, 1, 1, head_width=0.02, head_length=0.1, shape="full", fc='green', ec='red', alpha=0.9, overhang=0.5)plt.arrow(1, 1, 0, 2, head_width=0.02, head_length=0.1,
2020-12-19 10:59:13 1025 1
原创 python使用logging模块记录日志
记录日志:import logginglogging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s', # 日志打印格式 level=logging.DEBUG, # 打印级别 filename='new.log', # 打印写入的文件 filemode='w',) # 写入日志的方法,a为追加,w为写入
2020-12-18 19:07:40 263 1
原创 Ubuntu18.04搭建Web服务器
安装Apache服务sudo apt-get install apache2使用的是/etc/apache2/sites-available,Apache服务命令sudo /etc/init.d/apache2 restart # 重启服务sudo /etc/init.d/apache2 start # 启动sudo /etc/init.d/apache2 stop # 停止
2020-12-15 15:41:38 593
原创 嵌入网站的挖矿代码——Cryptoloot
搭建方法进入网站 https://crypto-loot.org/dashboard/注册账号(最好在google incognito 中使用,同时把AD blocker关闭)注意要先验证后,才可以注册,这里需要关闭ADBlocker:
2020-12-15 10:35:27 1502 1
原创 以太坊geth报错fatal error: runtime: out of memory
首先注意使用geth的时候要设置 --cache value ,这个是设置最大缓存的
2020-12-10 10:49:13 1876
原创 python使用新线程执行目标函数
import threading# threading.Thread(target=不带括号的目标函数,args=[参数列表]).start() # 这个会创建一个子线程执行函数threading.Thread(target=不带括号的目标函数,args=[参数列表]).run() # 这个会用主线程执行函数,经常用于debug...
2020-12-09 14:55:58 936
原创 反转dataframe
参考自:https://stackoverflow.com/questions/20444087/right-way-to-reverse-pandas-dataframedata为dataframe类型方法1:reverse_data = data.reindex(index=data.index[::-1])方法2:reverse_data = data.iloc[::-1]
2020-12-08 10:16:10 850
原创 python获得距离指定(x,y)固定距离的全部坐标点
这里认为(1,1)与(0,2)距离(0,0)是一样的距离def get_loc_by_distance(x, y, distance) -> list: sec_list = [] print("BEGIN :" + str(distance)) seq = 0 while distance >= 0: sec_list.append([x + distance, y + seq]) if distance != 0:
2020-12-04 10:49:51 1970
原创 sklearn网格搜索GridSearchCV得到各个评价指标的均值与方差
官网API:https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html
2020-12-03 19:18:14 1207
原创 java调用linux命令
无需得到返回值package paper2;import java.io.IOException;public class test_cmd { public static void main(String[] args) throws IOException, InterruptedException { String cmd_string = "echo 'sss'>test.txt"; // 执行的命令字符串 String[] cmd = new Stri
2020-12-03 10:57:12 224
使用pyLDAvis的实例结果,及d3.min.js,ldavis.v1.0.0.css,ldavis.v1.0.0.js
2022-02-26
handless_firefox.tar
2020-12-26
一键安装libpcap及其所有依赖文件的脚本
2017-11-26
W3Cschool参考手册资料
2017-04-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人