Skip to content

Instantly share code, notes, and snippets.

linux 最常用的查看mac地址的方式 有很多种,下面给出4种方式,

ifconfig 这是最常用的方式

ip link show

cat /sys/class/net/eth0/address 查看eth0的mac地址

dmesg | grep eth0

how to check mac address in Linux

Python是一种非常具有表现力的语言,它提供了不同的结构来简化开发人员的工作。该列表是python提供的最受欢迎的数据结构之一。在常规工作流程中,我们在列表中添加元素或从列表中删除元素。但是在这种浮动的情况下,我们需要获取列表的长度。我们如何获得列表的长度或大小?在本教程中,我们将研究获取长度列表的不同方法。

使用内置的len()函数

如前所述, len是默认情况下python提供的内置函数。我们可以使用此功能,仅将列表作为参数提供,如下所示。语法非常简单,我们仅将len() ,数组中的列表,数组,元组或字典类型变量提供为数组。

name_list=['ismail','ahmet','ali'] len(name_list)

fruit_list = ['apple', 'banana', 'carrot' , 'melon' , 'tomato']

The OS version of a Linux distribution can be determined by using the command-line interface as well as a graphical user interface.

Command Example
uname -a $uname -a
Linux ip-10-0-0-224 5.4.0-1045-aws#47-Ubuntu
SMP Tue Apr 13 07:02:25 UTC2021 x86_64 x86_64 x86_64 GNU/Linux
more /proc/version $ more /proc/version
Linux version 5.4.0-1045-aws(buildd@lcy01-amd64-026)(gcc version 9.3.0(Ubuntu 9.3.0-17ubuntu1~20.04))
more /etc/os-release $ more /etc/os-release
NAME=”Ubuntu”VERSION=”20.04.2 LTS (Focal Fossa)”ID=ubuntuID_LIKE=debianPRETTY_NAME=”Ubuntu 20.04.2 LTS”VERSION_ID=”20.04″
lsb_release -a $lsb_release -a
No LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 20.04.2 LTSRelease: 20.04Codename: focal

用途 find命令用于在指定目录下查找文件。

全称 无

参数

-name :后跟需要匹配的文件名模式,需要使用引号引起来

python append描述 append函数可以在列表的末尾添加新的对象。函数无返回值,但是会修改列表。

append语法

list.append(object) 名称 说明 备注 list 待添加元素的列表 object 将要给列表中添加的对象 不可省略的参数 3 examples to append list in python

Python 列表

序列是Python中最基本的数据结构。序列中的每个元素都分配一个数字 - 它的位置,或索引,第一个索引是0,第二个索引是1,依此类推。

Python有6个序列的内置类型,但最常见的是列表和元组。

序列都可以进行的操作包括索引,切片,加,乘,检查成员。

此外,Python已经内置确定序列的长度以及确定最大和最小的元素的方法。

Python3 打开 https 链接,异常:“SSL: CERTIFICATE_VERIFY_FAILED” 一、问题 Python2.7.9 之后,当使用urllib.urlopen打开一个 https 链接时,会验证一次 SSL 证书。而当目标网站使用的是自签名的证书时就会抛出如下异常:

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>

二、解决方案 1,方案一 使用ssl创建未经验证的上下文,在urlopen中传入上下文参数:

find命令特点:文件查找,实时查找,速度略慢,精确匹配

使用格式:# find [options] [查找路径] [查找条件] [处理动作]

查找路径:默认为当前目录

查找条件:默认为查找指定路径下的所有文件

处理动作:默认为显示

DNS is short for Domain Name System. It is simply a database that links meaningful names (known as hostnames), such as howtouselinux.com, to a specific IP address, such as 185.230.63.171.

Each device connected to the Internet has a unique IP address. With the system of DNS, we don't have to memorize IP addresses.

DNS records

All domains are required to have at least a few essential DNS records for a user to be able to access their website using a domain name. This is the key concept of DNS.

Here are 4 commonly used DNS records.

CrazyGames is a free online games website with more than 10 million active users monthly. The company was founded in 2014 by Tomas and Raf Mertens and has grown to 9 people.

The platform features games ranging from 3D shooters to puzzle games. The most popular categories are driving games, clicker games, minecraft games, stickman games, and .io games.CrazyGames is a member of KBC Start-it.

CrazyGames - An Amazing Free Online Game Website

Technologies