2022-9-16 myluzh
Python
1.在交换机命令行运行show version 查看交换机的sn码
System serial number : FOC1723W0VP
2.SN码取出第四位至七位
以 FOC1723W0VP 为例
第四和第五位代表年份,第六和第七位代表当年的第XX周 (范围是01至52周)
17+1996=2013 ; 23周 (注:年份都是以1996为基础,进行相加)
因此便知这台交换机出厂时间为2013年的第23周
CTH — Celestica – Thailand
FOC — Foxconn – Shenzhen, China (深圳-富士康)
JAB — Jabil – Florida
JPE — Jabil – Malaysia
JSH — Jabil – Shanghai , China
TAU — Solectron – Texas (德州)
PEN — Solectron – Malaysia
while True:
sn = input("sn:")
year = 1996 + int(sn[3] + sn[4])
week = in...
阅读全文>>
标签: python cicso 出厂时间
评论(0)
(784)
2022-9-15 myluzh
Python
0x01 连接到linux ssh并执行命令
import paramiko
try:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('10.1.123.218', 22, username='admin', password='1234123', timeout=5)
# print("连接成功")
except:
logger.info("连接ssh超时")
exit()
command = "whoami"
stdin, stdout, stderr = client.exec_command(command)
for std in stdout.readlines():
print(std)
0x02 连接到windows ssh并执行命令
因为windows的ssh是gbk所以有点麻烦,参考链接:paramiko连接windows10详解,远程管理windows服...
阅读全文>>
标签: python windows paramiko ssh
评论(0)
(593)
2022-9-15 myluzh
Windows
0x01 PowerShell自动安装
1、安装软件
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
2、启动软件
# Start the sshd service
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh*
# There should be a firewall rule named "...
阅读全文>>
标签: Windows Server OpenSSH Server
评论(0)
(431)
2022-9-6 myluzh
MySQL
官网地址:https://dev.mysql.com/downloads/repo/yum/
可以在以上地址选择想要的版本将下面的链接后面部分替换
替换地址
wget http://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
yum update
安装:
yum install mysql-server
初始化:
mysqld --initialize
权限设置:
chown mysql:mysql -R /var/lib/mysql
启动mysql:
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
查看mysql8安装后的初始密码
grep "A temporary password" /var/log/mysql/mysqld.log
登录mysql
mysql -u root
刷新权限
flush p...
阅读全文>>
标签: centos mysql8 yum
评论(0)
(485)
2022-8-29 myluzh
NOTE
0x01 安装docker与docker-compose
安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
安装docker compose
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.4.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
将可执行权限应用于二进制文件:
$ sudo chmod +x /usr/local/bin/docker-compose
创建软链:
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
测试是否安装成功:
$ docker-compose --version
0x02 安装teslamate
创建一个名为的文件docker-compose.yml,其内容如下:
version: "3"
...
阅读全文>>
标签: docker TeslaMate docker-compose
评论(0)
(1743)
2022-8-18 myluzh
Docker
#搜索
docker search portainer
C:\Users\myluzh>docker search portainer
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
portainer/portainer This Repo is now deprecated, use portainer/p… 2251
portainer/portainer-ce Portainer CE - a lightweight service deliver… 1297
portainer/agent An agent used to manage all the resources in… 158
portainer/templates App Templa...
阅读全文>>
标签: docker Portainer
评论(0)
(528)