随笔分类 -  shell

摘要:pssh -h hosts.txt -l irb2 -o /tmp/foo uptime-l 后面加用户,很好理解,执行uptime,然后把结果写入/tmp/foo目录。pscp -h hosts.txt -l irb2 foo.txt /home/irb2/foo.txt远程传输命令。将foo.t... 阅读全文
posted @ 2014-12-24 15:37 过去的我 阅读(245) 评论(0) 推荐(0) 编辑
摘要:其实很简单1 xshell 生成pub key 。 在工具 -> 用户密钥管理。 生成 。另存为id_rsa_1024.pub2.服务器上ssh-keygen3.将生成的文件id_rsa_1024.pub 上传到服务器。mv id_rsa_1024.pub /root/.ssh/authorized... 阅读全文
posted @ 2014-12-16 08:24 过去的我 阅读(348) 评论(0) 推荐(0) 编辑
摘要:1 安装mysqlyum -y install mariadb-serversystemctl start mariadb.servicesystemctl enable mariadb.servicemysql_secure_installation 默认安装的是5.5.40-MariaDB ... 阅读全文
posted @ 2014-12-14 16:14 过去的我 阅读(1063) 评论(0) 推荐(0) 编辑
摘要:现在有这么一个需求,要判断iptables是否开启。咋看比较难以入手,那么可以想,怎么启动iptables,redhat下很容易联想到/etc/init.d/iptabes start 。 我们可以来看一下启动脚本: start() { # Do not start if there is no config file. [ ! -f "$IPTAB... 阅读全文
posted @ 2014-11-01 12:27 过去的我 阅读(765) 评论(0) 推荐(0) 编辑
摘要:1 bash_completion默认是没有bash 自动补齐的,比如apt-get install 后面是不会自动补齐的,这个在ubuntu里面是有的,debian 里面默认没有开启开启方法是vim ~/.bashrc. /etc/bash_completionsource ~/.bashrc2 ... 阅读全文
posted @ 2014-09-28 15:06 过去的我 阅读(609) 评论(0) 推荐(0) 编辑
摘要:一般连主机会是这样的: ssh admin@IP 端口变了的话还要加上端口号 ssh admin@IP -p 10022 可以用ssh别名简化这个操作: vim .ssh/config 想要全局生效的话,写入/etc/ssh/ssh_config 中即可。host p... 阅读全文
posted @ 2014-08-07 08:37 过去的我 阅读(842) 评论(0) 推荐(0) 编辑
摘要:讲的内容配合分析web log ,疗效很好!http://www.ibm.com/developerworks/cn/linux/l-cn-awk-httplog/出差归来,哈哈,吐槽的不必写了,主要写下同行的另外二人的优点,所谓三人行必有我师。首先是毛,作为本次项目的经理,优秀的口头表达能力令人印象深刻,不在于他表达的有多完善,而是说话很有段落感,把关键性的表达清楚,不拖泥带水。第二个是实施升级的主要研发人员顾,前三天默默做着升级前的准备工作,有任何事情也不惊慌,做事不慌不忙,很沉稳,另人印象深刻,不像我,和之前的方案有所出入就很慌张,压力下表现的不很成熟,给客户看到也不怎么好。这些想想.. 阅读全文
posted @ 2014-04-13 11:28 过去的我 阅读(297) 评论(0) 推荐(0) 编辑
摘要:我实在是太喜欢这个方法了。爽歪歪。原帖http://www.xaprb.com/blog/2009/05/01/an-easy-way-to-run-many-tasks-in-parallel/利用 xargs -P 的参数 ,并发运行,当然有些命令可以接收多个参数,这时候要用-n 设置最大接受参数。seq 10 20|xargs -n 1 -P 5 sleep 就是了。verg good 。。 阅读全文
posted @ 2014-03-10 10:11 过去的我 阅读(412) 评论(0) 推荐(0) 编辑
摘要:[nginx]gpgcheck=0baseurl=http://nginx.org/packages/centos/releasever/basearch/name=nginx repo 这是一个正常的repo 文件,按道理$releasever 会被正常解析成5, 但是有时候确不能正常解析。这就很头痛,配置repo源的时候。这种情况一般发生在redhat系统,安装centos 源的情况下。刚才找了一下,发现装一个centos-release 就可以解决了。yum install centos-releasecat /etc/redhat-relaseCentOS release 5.1. 阅读全文
posted @ 2014-02-02 10:26 过去的我 阅读(2699) 评论(0) 推荐(0) 编辑
摘要:比较恶心,安装了后门,还把ssh sshd 给改了,服务器在机房,还不大好处理,如果贸然上去改,还容易把自己关在外面。但是我有salt ,上面可以用cmd.run运行一切命令。不走sshd服务。lsattr /usr/bin/ssh-u--ia------- /usr/bin/ssh 加了三个恶心的东西然后用chattr -i /usr/bin/sshchattr -uchattr -a然后在重新 yum -y reinstallopenssh-server 就行了/etc/init.d/sshd start如果不做那步的话 Downloading Packages: Running ... 阅读全文
posted @ 2014-02-01 11:55 过去的我 阅读(745) 评论(0) 推荐(0) 编辑
摘要:大致框架就是一个case 结构case "1"instart)start;;stop)stop;;restart)stopstart;;)echo"usage:..."exit1esac startstopcasenginxprog=/usr/local/nginx/sbin/nginx[xprog ] || exit 0start(){ $prog}stop(){ $prog ... 阅读全文
posted @ 2014-01-30 00:22 过去的我 阅读(352) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示