摘要: 一.启动网卡 ubuntu server 安装后,ifconfig 发现只有一个lo 和一个p1p1 网卡, 先查看服务器网卡:ifconfig -a ,发现有lo ,p1p1,p2p1,p3p1,p4p1 要启动其他网卡,可以通过 ifconfig p2p1 up #启动p2p1网卡 二.配置网卡 阅读全文
posted @ 2018-10-17 12:30 anobscureretreat 阅读(836) 评论(0) 推荐(0) 编辑
摘要: 官网:https://developers.google.cn/web/updates/2017/04/headless-chrome 阅读全文
posted @ 2018-10-17 10:22 anobscureretreat 阅读(258) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriver import time fireFoxOptions = webdriver.FirefoxOptions() fireFoxOptions.set_headless() driver = webdriver.Firefox(firefox_options=fireFoxOptions) driver.get('https... 阅读全文
posted @ 2018-10-17 10:21 anobscureretreat 阅读(523) 评论(0) 推荐(0) 编辑
摘要: import java.util.HashMap; import java.util.Iterator; public class JavaHashMap { public static void main(String[] args) { //定义HashMap HashMap hm = new HashMap(); //添加字典 hm.put("username... 阅读全文
posted @ 2018-10-17 10:19 anobscureretreat 阅读(131) 评论(0) 推荐(0) 编辑
摘要: public class BubbleSort { public static void main(String[] args) { //排序数组 int[] intArray = {12, 11, 45, 6, 4, 8, 43, 40, 57, 3, 22}; System.out.println("排序前的数组:"); for (int i = 0; i < ... 阅读全文
posted @ 2018-10-17 10:18 anobscureretreat 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 统计文件个数 ls -l |grep "^-"|wc -l 统计目录的个数 ls -l|grep "^d"|wc -l 统计文件个数(包括子文件夹) ls -lr |grep "^-"|wc -l 统计目录的个数(包括子文件夹) ls -lr|grep "^d"|wc -l 统计目录的所有js文件 ls -lr /home/han|grep js|wc -l 或 ls -l ... 阅读全文
posted @ 2018-10-17 10:15 anobscureretreat 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1、lsof -i:端口号 2、netstat -tunlp|grep 端口号 3. netstat –anp | grep 8080 netstat -anlp | grep 80 都可以查看指定端口被哪个进程占用的情况 所有端口: netstat -an 查看硬盘剩余空间 #df -h #df -H 查看目录占用空间 #du -hs 目录名 阅读全文
posted @ 2018-10-17 10:14 anobscureretreat 阅读(126) 评论(0) 推荐(0) 编辑
摘要: from collections import defaultdict d=defaultdict(set) s=[("001","A"),("001","C"),("002","B")] for k,v in s: d[k].add(v) print(sorted(d.items())) 阅读全文
posted @ 2018-10-17 10:13 anobscureretreat 阅读(958) 评论(0) 推荐(0) 编辑
摘要: Server部分: #!/usr/bin/env python import sys import os import rospy #from beginner.srv import * from beginner.srv import AddTwoInts def add_two_ints_client(x,y): rospy.wait_for_service('add_two_in... 阅读全文
posted @ 2018-10-17 10:11 anobscureretreat 阅读(805) 评论(0) 推荐(0) 编辑
摘要: 加入以下内容 阅读全文
posted @ 2018-10-17 10:09 anobscureretreat 阅读(205) 评论(0) 推荐(0) 编辑
摘要: def binary_search(lis, key): low = 0 high = len(lis) - 1 time = 0 while low lis[mid]: low = mid + 1 else: # 打印折半的次数 print("times: %s" % ... 阅读全文
posted @ 2018-10-17 00:50 anobscureretreat 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 如果查找到123就会打印出123 的位置索引,否则显示false 阅读全文
posted @ 2018-10-17 00:43 anobscureretreat 阅读(850) 评论(0) 推荐(0) 编辑