11 2019 档案

摘要:#include <iostream> #include <algorithm> #include <string> #include <vector> int main() { std::string str; while(std::cin>>str) { std::vector<char> v_ 阅读全文
posted @ 2019-11-27 13:58 东宫得臣 阅读(804) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash cat iplist | while read ip username do printf "${ip}, ${username}, " eval $(ssh -q ${ip} "awk -v user_name=$username -F':' '\$0 ~ user_nam 阅读全文
posted @ 2019-11-27 13:14 东宫得臣 阅读(265) 评论(0) 推荐(0) 编辑
摘要:prochapawd.sh #!/usr/bin/expect set timeout 5 set ipaddress [lindex $argv 0] set username [lindex $argv 1] set newpassword [lindex $argv 2] spawn ssh 阅读全文
posted @ 2019-11-26 17:56 东宫得臣 阅读(212) 评论(0) 推荐(0) 编辑
摘要:- hosts: myjob gather_facts: True vars: IP: "{{ ansible_default_ipv4['address'] }}" HOST_NAME: "{{ ansible_hostname }}" OS: "{{ ansible_distribution } 阅读全文
posted @ 2019-11-26 15:32 东宫得臣 阅读(2552) 评论(0) 推荐(0) 编辑
摘要:统计cpu和内存一个月的平均使用率: #!/bin/bash totalcpu_rate=0.0 totalmem_rate=0.0 num_days=$(ls -l /var/log/sa/sa[0-3]* | wc -l) echo $num_days for file in /var/log/ 阅读全文
posted @ 2019-11-26 14:58 东宫得臣 阅读(1131) 评论(0) 推荐(0) 编辑
摘要:- hosts: myjob gather_facts: false tasks: - name: chage user passwd user: name={{ item.name }} password={{ item.chpass | password_hash('sha512') }} up 阅读全文
posted @ 2019-11-26 14:49 东宫得臣 阅读(442) 评论(0) 推荐(0) 编辑
摘要:{ if(NR % 2 == 0) printf("%s\n", $0) else printf("%s, ", $1) } awk -f awk.awk data 阅读全文
posted @ 2019-11-26 14:41 东宫得臣 阅读(190) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> int main() { enum {size = 4}; std::vector<int> num(size); size_t i=0; while(std::cin>>num.at(i++)) { if(i == siz 阅读全文
posted @ 2019-11-24 13:34 东宫得臣 阅读(339) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> int main() { int num; while(std::cin>>num) { int mod, left, sum=0; left = num % 3; while(num/3) { mod = num / 3; left = num % 3; s 阅读全文
posted @ 2019-11-23 01:24 东宫得臣 阅读(1550) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <string> #include <cmath> int main() { std::string hex; while(std::cin>>hex) { int sum=0, flag=0; for(std::string::const_ 阅读全文
posted @ 2019-11-23 00:08 东宫得臣 阅读(3737) 评论(2) 推荐(0) 编辑
摘要:#include <iostream> #include <set> int main() { int n; std::set<int> i_set; while(std::cin>>n) { i_set.clear(); int data_in; for(size_t i=0; i<n; ++i) 阅读全文
posted @ 2019-11-21 14:12 东宫得臣 阅读(191) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> int main() { int N, M; while(std::cin>>N>>M) { std::vector<int> v_data; v_data.clear(); for 阅读全文
posted @ 2019-11-20 23:14 东宫得臣 阅读(1225) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-06 16:00 东宫得臣 阅读(247) 评论(0) 推荐(0) 编辑

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