Shell脚本学习(二)制作SSH登录远程服务器的Shell脚本

Linux运维:Shell脚本实现ssh免密登录远程服务器 LInux系统日常运维过程中,经常需要在本地运行脚本执行对远程主机的命令,正常情况下,ssh登录远程服务器时会提示输入密码,这会影响到脚本的自动执行(因为shell脚本中没有自动填充密码的命令)。有三个解决办法: 1)使用远程登录工具 2)建立主机间的ssh信任依赖关系 3)用脚本模拟scp命令的密码输入过程,避免每次手工输密码。 一、使用远程登录工具—实现ssh免密登录远程服务器 常用的远程登录工具有expect以及sshpass,本文主要介绍的是sshpass。 1)sshpass介绍 ssh登录.. 阅读详情

Shell脚本学习(二)制作SSH登录远程服务器的Shell脚本

Ubuntu环境需要安装expect安装包

sudo apt-get install expect

使用shell脚本自动ssh登录远程服务器

login.sh

#!/usr/bin/expect -f
# 设置ssh连接的用户名
set user liuben
# 设置ssh连接的host地址
set host 10.211.55.4
# 设置ssh连接的port端口号
set port 9999
# 设置ssh连接的登录密码
set password admin
# 设置ssh连接的超时时间
Shell脚本实现多台机器SSH互信免密登录 阅读详情

相关推荐

简单实用!shell脚本实现ssh远程链接的三种方法

请将${REMOTE_U​SER}和${REMOTE_IP}替换为实际的远程电脑用户名和IP地址。这个命令会要求你输入远程电脑的密码。请确保将REMOTE_IP、REMOTE_USER和REMOTE_PASSWORD变量替换为实际的远程电脑IP地址、用户名和密码。请确保将REMOTE_IP和REMOTE_USER变量替换为实际的远程电脑IP地址和用户名。当运行此脚本时,系统会提示输入远程电脑的密码,输入密码后,将成功连接到远程电脑。按照提示操作,可以选择默认的文件路径和空密码。id_rsa(私钥)

ericdowney 1万+

Shell脚本实现SSH免密登录及批量配置管理

本节索引 场景分析 ssh免密登录 pssh工具批量管理 SHELL自动化脚本 本篇总结 场景分析 作为一个运维工程师,不是每个人工作的环境都想阿里、腾讯那样,动不动就上亿的PV量,上万台服务器。我们通常还是工作在,几十台上百台服务器这样的环境,而使用ansible或者puppet这样的自动化运维工具则显得大材小用,并且最终的效果可能还不如几个小工具达到的效果好。像ssh免密登录在配合pssh这样...

qq_40907977的博客 4888

Python实战:3种高效方法将txt转csv(附pandas对比测试)

本文针对Python中将txt文件转换为csv格式的需求,深度评测了open()、csv模块和pandas三种主流方法。通过详尽的性能对比测试,从执行效率、内存占用和适用场景等维度提供选型指南,帮助开发者根据数据规模与复杂度选择最高效的转换方案。

weixin_29073241的博客 271

ubuntu17.04 UHD 驱动出错

ubuntu 17.04 源码安装UHD

xrh003的博客 1万+

pyecharts可视化图表-tree:从入门到精通

本文系统介绍了树图(Tree Chart)的可视化技巧,包含基础实现、方向定制和环形布局等实例。树图能清晰展示层次结构数据,适用于组织架构、文件系统等场景。教程详细解析了pyecharts树图的核心配置项,包括数据准备、方向设置(下上、右左)和样式定制,并提供了完整代码示例。通过本指南,读者可快速掌握专业树图的构建方法,实现复杂层次数据的可视化呈现。

大数据内容个人总结与分享 1975

数字IC后端笔记-libcell命名规则与标准单元库介绍

ND3D1BWP13T40P140HVTND3D1BWP13T40P140HVTTSMC两种工艺,Metalization Stack的截面示意图:还有一层AP用来走RDL,RDL这层是最厚的一层,一般用于连接IO的bump,信号线基本上不会用这层绕线。

sinat_41774721的博客 2478

锁定放大器

锁定放大器

qq_46757048的博客 4713

新手必看:SMIC 0.18um PDK安装保姆级教程(附Cadence IC617环境配置)

本文提供SMIC 0.18um PDK在Cadence IC617环境下的详细安装教程,涵盖环境准备、文件解压、安装脚本运行、环境变量配置及Cadence集成验证等关键步骤,特别针对初学者常见问题提供解决方案,助力快速掌握芯片设计工具配置。

weixin_30522183的博客 514

集成运放内部电路组成(上)

目录 ​ 一,概述 1.1集成运放的发展 1.2集成运放特点 二,电流源电路 2.1镜像电流源电路 2.2.改进的镜像电流源 2.3微电流源 2.4比例电流源 三,差分放大电路 差动放大电路的静态分析 差动放大电路差模信号的动态分析 双入单出 总结: 四,复合管电路 五,集成运放的输出 一,概述 1.1集成运放的发展 随着半导体技术的发展,采用半导体制造工艺将电阻、三极管等元器件及电路的连线全部制造到一块半导体基片上,其本...

梦灵-影的博客 1万+

Vue3 - 完美解决html2canvas截图不全问题,截图只截取当前可视区域导出图片不全,截屏导出的图片显示不全只有一部分或缺一块,vue3移动端H5网页项目使用html2canvas插件长截图!

vue3,html2canvas,移动端H5网页,截图不全,html2canvas长截图不全,保存长截图,页面滚动导致截图不全,网页下方截屏不到怎么办,底部一部分无法截屏到,保存的图片少了一大块,H5海报截图不完整,怎么截取滚动条下方的内容,截图图时图片不全,截图图片只有一半的问题,底部内容空白,截图空白问题的解决,截图不全怎么办,html2canvas.js网页截图功能(解决截图不全问题,移动端ios系统截图不完整,html2canvas截图太长又不能删减截取不到,使用HTML2Canvas在H5页面上实

🏆 前端领域优质创作者 1万+

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

上一篇: Shell脚本学习(一)Shell命令基础
下一篇: Shell脚本学习(三)注释的用法
birdben
博客等级 码龄11年 290粉丝 34原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值