本篇宗旨:simple & stupidWeakHashMap (弱引用的哈希表)
Hash table based implementation of the Map interface, with weak keys. An entry in a WeakHashMap will automatically be removed when its key is no longer in or...
分类:
编程语言 时间:
2015-05-06 09:18:34
阅读次数:
141
ssh-agent一直不知道啥是ssh-agent,今晚看了几篇文章,终于领悟到了。一般的ssh过程
ssh-keygen 生成一个公钥私钥,注意,这里生成私钥的时候可以选密码,也可以不选密码。 openssh牛的地方在于能用key 登陆,而非用密码。
然后做免密码登陆,一般是复制到.ssh/authorized_keys ,或者用ssh-copy-id 。
其实第二步做完以后基本上就不输密码登陆。...
分类:
其他好文 时间:
2015-05-05 06:35:57
阅读次数:
123
公司需要新上项目,上架20台机器,要对这些主机进行改名#!/usr/bin/envpython
frommultiprocessingimportProcess,Pool
importparamiko
importsys,os
s=paramiko.SSHClient()
s.load_system_host_keys()
s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
defssh_run(ho..
分类:
编程语言 时间:
2015-05-04 20:24:05
阅读次数:
255
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:
其他好文 时间:
2015-05-04 10:12:08
阅读次数:
100
https://pypi.python.org/pypi/seleniumfrom selenium import webdriverfrom selenium.webdriver.common.keys import Keysbrowser = webdriver.Firefox()browser...
分类:
Web程序 时间:
2015-05-03 20:17:20
阅读次数:
1190
一、数组操作的基本函数1、数组的键名和值array_values($arr);获得数组的值array_keys($arr);获得数组的键名array_flip($arr); 数组中的值与键名互换(如果有重复前面的会被后面的覆盖)in_array("apple",$arr); 在数组中检索applea...
分类:
Web程序 时间:
2015-05-01 21:15:16
阅读次数:
129
一、数组操作的基本函数1、数组的键名和值array_values($arr);获得数组的值array_keys($arr);获得数组的键名array_flip($arr); 数组中的值与键名互换(如果有重复前面的会被后面的覆盖)in_array("apple",$arr); 在数组中检索applea...
分类:
Web程序 时间:
2015-05-01 08:14:42
阅读次数:
95
1、创建公钥、公钥ssh-keygen -t rsa无视它出来的任何提示,欢快的一路回车到底吧。2、把公钥 id_rsa.pub 复制到远程机器的 /home/username/.ssh目录 并命名为 authorized_keys方法1: 一步到位:scp ~/.ssh/id_rsa.pub us...
分类:
其他好文 时间:
2015-04-30 12:32:23
阅读次数:
234
用ssh client 客户端 远程登录服务器,避免每次都得输入密码:解决方法: ssh-keygen复制 id_rsa.pub 中的内容 到 远程连接的服务器的~/.ssh/authorized_keys 目录中,就可以避免每次都得输入密码了;
分类:
系统相关 时间:
2015-04-29 23:24:47
阅读次数:
184
redis本身不支持批量删除key.可以借助shell和lua脚本来实现
比如删除前缀为 “mykey” 的所有key
1. shell脚本
redis-cli KEYS "mykey*" | xargs redis-cli DEL
2. lua 脚本 windows客户端下可以使用...
分类:
其他好文 时间:
2015-04-29 13:42:10
阅读次数:
157