2016年3月14日

LeetCode题解-----Majority Element II 摩尔投票法

摘要: 题目描述: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) spa 阅读全文

posted @ 2016-03-14 20:09 姚灯灯! 阅读(1943) 评论(0) 推荐(0) 编辑

2016年3月2日

LeetCode题解-----Maximum Gap

摘要: 题目描述: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. R 阅读全文

posted @ 2016-03-02 10:38 姚灯灯! 阅读(368) 评论(0) 推荐(0) 编辑

2016年2月29日

CEPH块设备创建及快照

摘要: 1、创建image rbd create foo --size 1024 {--image-format 2}//创建一个名为foo的image,大小为1024M,当需要克隆快照时,需要添加大括号中的内容 2、加载rbd模块 sudo modprobe rbd 3、使用image 通过map指令将镜 阅读全文

posted @ 2016-02-29 14:54 姚灯灯! 阅读(910) 评论(0) 推荐(0) 编辑

2016年2月27日

Ubuntu 14.04 部署 CEPH集群

摘要: 注:下文的所有操作都在admin节点进行 1、准备三台虚拟机,其中一台作为admin节点,另外两台作为osd节点,并相应地用hostname命令将主机名修改为admin,osd0,osd1,最后修改/etc/hosts文件如下所示 127.0.0.1 localhost 10.10.102.85 a 阅读全文

posted @ 2016-02-27 20:12 姚灯灯! 阅读(1866) 评论(0) 推荐(0) 编辑

2016年2月25日

Ubuntu 14.04 单机安装 CEPH

摘要: 0、如果先前安装过ceph,则先卸载 sudo stop ceph-all //停止所有CEPH进程 ceph-deploy uninstall [{ceph-node}] //卸载所有ceph程序 ceph-deploy purge [[ceph-node} [{ceph-node}] //删除c 阅读全文

posted @ 2016-02-25 16:44 姚灯灯! 阅读(4482) 评论(0) 推荐(0) 编辑

2016年2月21日

LeetCode题解-----Median of Two Sorted Arrays

摘要: 题目描述: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complex 阅读全文

posted @ 2016-02-21 20:55 姚灯灯! 阅读(3114) 评论(0) 推荐(0) 编辑

2016年2月18日

LeetCode题解-----First Missing Positive

摘要: Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文

posted @ 2016-02-18 22:10 姚灯灯! 阅读(407) 评论(0) 推荐(0) 编辑

2016年1月15日

QEMU启动时插入tap虚拟网卡

摘要: 1、利用brctl命令创建虚拟网桥br0brctl addbr br0ifconfig br0 up //上述两条命令分开执行会导致网络断开2、将虚拟网桥br0与物理网卡eth0绑定brctl addif br0 eth0ifconfig eth0 0.0.0.0 //网桥类似于交换机,此时... 阅读全文

posted @ 2016-01-15 19:27 姚灯灯! 阅读(3684) 评论(0) 推荐(0) 编辑

2015年11月13日

shell script 学习笔记-----if,for,while,case语句

摘要: 1、if内的判断条件为逻辑运算:2、if内的判断条件为目录是否存在,文件是否存在,下图先检验目录/home/monster是否存在,然后再检测/home/monster中的file.txt文件是否存在,这里需要注意的是在进行文件目录是否存在一类的判断时,只能使用"[]"括号。“()”括号一般仅用于算... 阅读全文

posted @ 2015-11-13 21:32 姚灯灯! 阅读(2627) 评论(0) 推荐(0) 编辑

2015年11月4日

shell script 学习笔记-----shell变量

摘要: 1、在赋值语句name=value中不能存在空格,例如:name = value这样的形式会被认为是三个变量,因为本质上来说,脚本的内容就是传给shell程序的变量,而变量之间是通过空格区分的。如果想要在value里面出现空格,则需要用引号标注出来,想要应用变量的内容则在变量名前加‘$’符号,如下: 阅读全文

posted @ 2015-11-04 11:23 姚灯灯! 阅读(1171) 评论(0) 推荐(0) 编辑

导航