SAP DevOps笔试题

1.[Unix administration]
Please use Linux bash to fulfill the following Operation tasks.

  • List all Java process
  • List Linux kernel version
  • Compress all log files under /var/log/nginx, and copy to server 10.0.0.1. User
    name:work, Password: Password

2.[Programming]
Please use script language(Python, Perl, Nodejs etc) to fulfill the following tasks in two ways

3.[Network]

  • List >3 http method other than GET
  • How to exam the DNS resolution
    e.g. www.baidu.com in Linux shell, List the possible commands you
    have know.

4.对B类网段172.168.0.0进行划分,子网掩码为255.255.192.0

  • 要求计算可划分子网数
  • 每个子网中主机数
  • 确定每个子网的子网地址
  • 确定每个子网合法IP地址
  • 确定每个子网广播地址

参考答案

1.[Unix administration]
Please use Linux bash to fulfill the following Operation tasks.

  • List all Java process
ps -ef | grep java
  • List Linux kernel version
uname -r
  • Compress all log files under /var/log/nginx, and copy to server 10.0.0.1. User
    name:work, Password: Password
分两步走:
首先, 执行查找所有的log文件,并压缩成为自命名的文件,假设为logzips.gz:
find /var/log/nginx -type f -name '*.log' -print | xargs tar cf - |gzip -c > ./logzips.gz 
然后,用scp进行copy,中途要输入被传输机器的密码,假设放到/var/mylog目录下:
scp ./logzips.gz work@10.0.0.1:/var/mylog/logzips.gz

2.[Programming]
Please use script language(Python, Perl, Nodejs etc) to fulfill the following tasks in two ways

[Python]方法1, 通过Http使用urllib模块:
import urllib 
print "downloading with urllib" 
url = 'http://some.website/some.file'  
urllib.urlretrieve(url, "some.file")
[Python]方法2,通过Http使用urllib2模块:
import urllib2 
print "downloading with urllib2" 
url = 'http://some.website/some.file' 
fin = urllib2.urlopen(url)
data = fin.read() 
with open("some.file", "wb") as fout:
    fout.write(data)
[Python]方法3, 通过使用requests模块
import requests 
print "downloading with requests"
url = 'http://some.website/some.file' 
response = requests.get(url) 
with open("some.file", "wb") as fout:
     fout.write(response.content)
方法1:不使用Cookie, 发送HTTP POST
import urllib2, urllib
data = {'Username' : 'work', 'Password' : 'Password'}
f = urllib2.urlopen(
        url     = 'https://some.website/login',
        data    = urllib.urlencode(data)
  )
print f.read()
方法2:使用CookieJar
import urllib2
import urllib
from cookielib import CookieJar

cj = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
# input-type values from the html form
data = { 'Username' : 'work', 'Password' : 'Password' }
data_encoded = urllib.urlencode(data)
response = opener.open("https://some.website/login", data_encoded)
content = response.read()

3.[Network]

  • List >3 http method other than GET
1. GET 从指定的url上获取内容
2. POST 提交body中的内容给服务器中指定的url中,属于非幂等的(non-idempotent)请求
3. HEAD 从指定的url上获取header内容(类似Get方式)
4. PUT 将body上传至服务器指定url处
5. DELETE 在指定url处删除资源
6. OPTIONS 获取指定url中能接收的请求方法
7. CONNECT 连接指定频段。当客户端需要通过代理服务器连接HTTPS服务器是用到。

具体参见HTTP Method

  • How to exam the DNS resolution
    e.g. www.baidu.com in Linux shell, List the possible commands you
    have know.
原理都是依赖于一个很重的的文件/etc/resolv.conf
1. dig www.baidu.com (+tcp, +trace)
2. nslookup www.baidu.com
3. host www.baidu.com (用于查看某主机对应的IP)
4. ping www.baidu.com (如果ping不通,当然DNS解析就不对)

4.对B类网段172.168.0.0进行划分,子网掩码为255.255.192.0

  • 要求计算可划分子网数
因为是B类网段,B类地址用16位表示网络ID,而其子网掩码是18位,则子网位数为18-16=2位,那么子网就有2^2=4个。
  • 每个子网中主机数
IPv4总共用32位表示,分为网络ID和主机ID,其中子网掩码占了18位,即网络ID可用18位,则还剩32-18=14位来用于表示主机,即每个子网中主机数为2^14 -2 个 (由于特殊用途,丢弃全为0,和全为1这两种情况)。
  • 确定每个子网的子网地址
子网地址则为每个网段的起始地址为全0即:
172.168.0.0
172.168.64.0
172.168.128.0
172.168.192.0
  • 确定每个子网合法IP地址
172.168.0.1~172.168.63.254
172.168.64.1~172.168.127.254
172.168.128.1~172.168.191.254
172.168.192.1~172.168.255.254
  • 确定每个子网广播地址
广播地址为每个网段的结束地址为全1即:
172.168.63.255
172.168.127.255
172.168.191.255
172.168.255.255

没有看明白的话,可以看看我的另一篇文章如何计算子网数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Azure DevOps是微软提供的一套云端应用程序生命周期管理工具,它集成了代码托管、持续集成/持续交付、项目管理、测试管理等功能,可以帮助团队更高效地进行软件开发和交付。下面是一些常见的Azure DevOps面试题及其答案: 1. 什么是Azure DevOps? Azure DevOps是一套云端应用程序生命周期管理工具,它提供了代码托管、持续集成/持续交付、项目管理、测试管理等功能。 2. Azure DevOps的主要组件有哪些? Azure DevOps的主要组件包括Azure Repos(代码托管)、Azure Pipelines(持续集成/持续交付)、Azure Boards(项目管理)、Azure Test Plans(测试管理)和Azure Artifacts(软件包管理)。 3. 如何在Azure DevOps中创建一个新的项目? 在Azure DevOps中创建新项目的步骤如下: - 登录Azure DevOps网站 - 点击“New Project”按钮 - 输入项目名称、描述等信息 - 选择版本控制类型(Git或TFVC) - 点击“Create”按钮 4. 如何在Azure DevOps中设置持续集成/持续交付? 在Azure DevOps中设置持续集成/持续交付的步骤如下: - 创建一个新的Build Pipeline或Release Pipeline - 配置源代码仓库和触发条件 - 配置构建或发布任务 - 配置触发器和部署环境 - 保存并运行Pipeline 5. 如何在Azure DevOps中进行项目管理? 在Azure DevOps中进行项目管理的步骤如下: - 创建用户故事或需求 - 创建任务和子任务 - 分配任务给团队成员 - 设置优先级和迭代计划 - 跟踪工作进度和完成情况
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值