- 博客(5)
- 收藏
- 关注
原创 scp实现两台服务器免密传输
需要在两台机器的*.ssh文件夹下生成对应的密匙id_rsa和公匙文件id_rsa.pub*ssh-keygen -t rsassh-keygen -t rsa -C <name@mail.com>将生成的公匙文件拷贝到clientscp -r <./id_rsa.pub> <usrname>@<ip>:<path>/authorized_keys在client端,将拷贝来的公匙和原始公匙合并到authorized_ke..
2021-02-28 17:30:15 225
原创 git常用command
git global setupgit config --global user.name "zhangmin"git config --global user.email "email-address"create a new repogit clone <http/git>git add .git commit -m "information about the update"git push -u origin origin masterpush an existing f
2020-10-31 23:49:41 129
原创 数组中重复的数字
要求:数组中的元素 0~n-1任意返回一个重复的数字如果不存在重复,返回-1需要注意的特殊案例:如果有超出范围的元素,直接返回-1def main(): nums = list(map(int, input().strip().split(' '))) n = len(nums) for i in nums: if i <0 or i >= n: ret...
2020-03-28 18:04:37 97
原创 快速幂、快速乘
求a^b直接求解,需要循环b次。思路:将b转化为二进制。对应为1的次数的幂保留,只需要将保留的幂的结果进行乘积就是a**b。class Solution(): def fast(self, a,b): b = bin(b)[2:] res = 1 for i in b[::-1]: if i == '1': res = res * a a *= a r...
2020-03-20 13:01:26 56
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人