mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
dev

在Linux中对硬盘进行分区、格式化和挂载

我最近有一个全新的4-TB硬盘加入我的电脑。所以我需要在Linux中安装它。为此,我需要执行以下操作: 分区 格式化 挂载 检查是否已安装硬盘驱动器 分区 首先,在通过SATA和电源线将硬盘连接到计算机后,我们可以通过以下方式检查新的4 TB硬盘: sudo fdisk -l 但我们现在无法安装它,如果我们现在安装它,错误就会出现。我们需要先对它进行分区: sudo fdisk /dev/sdb 如果我们输入m求助,我们可以看到命令列表。 要检查分区表,请输入p。 要分区,请输入n。然后我通过输入p选择primary。并仅为一个分区号输入1。 输入w将分区表写入磁盘。 格式化新分区的硬盘: sudo mkfs.ext4 /dev/sdb 挂载(包括重启后自动挂载) 通常驱动器安装在/mnt/中,首先在/mnt/t中创建一个新目录。 sudo mkdir /mnt/sdb 然后我们可以通过以下方式安装 sudo mount /dev/sdb /mnt/sdb 但是我们需要在每次重启时安装它。要在每次重启后自动挂载,我使用nano来修改文件/etc/fstab: sudo nano /etc/fstab 在文件末尾输入以下内容: /dev/sdb     /mnt/sdb      ext4        defaults      0       0 第一项是硬盘的路径。第二个是我们要安装的已安装驱动器的目标。第三个是格式类型。我刚刚保留的第四到第六个默认值为0和0。 检查是否已安装硬盘驱动器 有3种方法可供检查。其中三个也可以找到已安装的硬盘sdb。 ① mount | grep sdb ② lsblk ③ df —————————

2020-05-26 0comments 123hotness 0likes mikebai Read all
dev

linux文件权限说明

1) 数字权限使用格式 在这种使用方式中,首先我们需要了解数字如何表示权限。 首先,我们规定 数字 4 、2 和 1表示读、写、执行权限(具体原因可见下节权限详解内容),即 r=4,w=2,x=1 。此时其他的权限组合也可以用其他的八进制数字表示出来, 如: rwx = 4 + 2 + 1 = 7 rw = 4 + 2 = 6 rx = 4 +1 = 5 即 若要同时设置 rwx (可读写运行) 权限则将该权限位 设置 为 4 + 2 + 1 = 7 若要同时设置 rw- (可读写不可运行)权限则将该权限位 设置 为 4 + 2 = 6 若要同时设置 r-x (可读可运行不可写)权限则将该权限位 设置 为 4 +1 = 5 2) 设置所有人可以读写及执行 chmod 777 file  (等价于  chmod u=rwx,g=rwx,o=rwx file 或  chmod a=rwx file) 设置拥有者可读写,其他人不可读写执行 chmod 600 file (等价于  chmod u=rw,g=---,o=--- file 或 chmod u=rw,go-rwx file ) 3) -rw------- (600)      只有拥有者有读写权限。 -rw-r--r-- (644)      只有拥有者有读写权限;而属组用户和其他用户只有读权限。 -rwx------ (700)     只有拥有者有读、写、执行权限。 -rwxr-xr-x (755)    拥有者有读、写、执行权限;而属组用户和其他用户只有读、执行权限。 -rwx--x--x (711)    拥有者有读、写、执行权限;而属组用户和其他用户只有执行权限。 -rw-rw-rw- (666)   所有用户都有文件读、写权限。 -rwxrwxrwx (777)  所有用户都有读、写、执行权限。

2020-05-21 0comments 156hotness 0likes mikebai Read all
dev

linux The login sequence

It's worth understanding at least those files in the login sequence that will affect things like whether you can login in the first place, where your initial environment comes from, and so on. At the risk of over-simplifying, here are the files you need to worry about that are invoked/consulted every time you log in (indented in an attempt to show who actually consults who): /etc/passwd /etc/shadow /etc/group /etc/profile /etc/profile.d/*.sh ~/.bash_profile ~/.bashrc /etc/bashrc /etc/passwd defines, among other things, the username, numeric UID and GID of the user, the home directory and the login shell. For security reasons, the encrypted password is no longer stored in this file. /etc/shadow represents a more secure place to store things like the encrypted password, password aging information and more. (This is the only file in this list of files that requires root privilege to display.) /etc/group defines the working groups on the host, along with the users who are members of those groups.  

2020-05-21 0comments 148hotness 0likes mikebai Read all
杂七杂八

Windows10でBluetoothキーボードのペアリングの際にPINコードが表示されなくなってしまった時の対処方法

Windows10でBluetoothキーボードとペアリングしようとしても、次のような画面が出てしまって困ってしまいました。 「Anker Bluetooth KeyboardのPINを入力してください」と出ています。キーボード自体が固有にもっているPINは本体にもマニュアルにもどこにも記載がありません。一体どうすればいいのか途方に暮れちゃいました。 本来ならば次のような画面が出るはずです。 Sponsored Link 「デバイスでこのPINを入力し、必要な場合はEnterキーを押してください。」とあり、その下に8桁の数字がランダムに表示されます。この数字をペアリングしたいキーボードで入力するとペアリングが完了となるわけです。ところが、最初の画像のようにペアリングのための8桁の数字が出てこないのですよ。 Bluetoothキーボードの電源をオフにして、またオンにしてもだめ。電池を抜いて入れ直してもダメ。Windowsを再起動してもダメ。ずっと同じように最初の画像のようになってしまいました。 この状態になった時の対処方法は以下になります。キーボードのメーカーにかかわらず同じ操作になると思います。まずはWindowsの設定画面を出してください。一番上に検索窓があるので、そこにコントロールと入力してください。 検索候補にコントロール パネルがありますので、そこをクリックします。ちなみに、「コントロールパネル」と入力しても出てきません。正確には「コントロール パネル」というようにルとパの間には半角スペースが入ります。なので、無理せず

2020-05-15 0comments 178hotness 1likes mikebai Read all
dev

linux常用命令

常用指令 ls          显示文件或目录      -l           列出文件详细信息l(list)      -a          列出当前目录下所有文件及目录,包括隐藏的a(all) mkdir         创建目录      -p           创建目录,若无父目录,则创建p(parent) cd               切换目录 touch          创建空文件 echo            创建带有内容的文件。 cat              查看文件内容 cp                拷贝 mv               移动或重命名 rm               删除文件      -r            递归删除,可删除子目录及文件      -f            强制删除 find              在文件系统中搜索某文件 wc                统计文本中行数、字数、字符数 grep             在文本文件中查找某个字符串 rmdir           删除空目录 tree             树形结构显示目录,需要安装tree包 pwd              显示当前目录 ln                  创建链接文件 more、less  分页显示文本文件内容 head、tail    显示文件头、尾内容 ctrl+alt+F1  命令行全屏模式   系统管理命令 stat              显示指定文件的详细信息,比ls更详细 who               显示在线登陆用户 whoami          显示当前操作用户 hostname      显示主机名 uname           显示系统信息 top                动态显示当前耗费资源最多进程信息 ps                  显示瞬间进程状态 ps -aux du                  查看目录大小 du -h /home带有单位显示目录信息 df                  查看磁盘大小 df -h 带有单位显示磁盘信息 ifconfig          查看网络情况 ping       …

2020-04-15 0comments 116hotness 0likes mikebai Read all
M365

Managing public IP prefixes in Azure using PowerShell

Contents of this article Creating a new public IP prefix Creating public IPs from a public IP prefix Public IPs can be essential for services such as application gateways, firewalls, and virtual network gateways in Azure, especially when it comes to making these services accessible from the internet. Assigning a public IP address to a service in Azure is simple. Easy to use - Restore VMs, files or apps - VMware, Hyper-V - Free forever

2020-03-16 0comments 115hotness 0likes mikebai Read all
M365

CIDR网络

计算器 https://www.sioe.cn/xinqing/CIDR.php https://www.ipaddressguide.com/cidr CIDR是英文“Classless Inter-Domain Routing”的简写,中文名称“无类别域间路由”,是网络中分配IP地址的一种方法。 CIDR抛弃了传统的ABC类IP地址以及划分子网的概念,减轻了路由表数据过大的问题。CIDR使用如下格式的IP地址表示法: [网络前缀][主机地址]/网络前缀所占位数 CIDR将IP地址划分为网络前缀和主机地址两个部分,“/”斜线后面是网络前缀所占的位数,这样通过网络前缀所占的位数就可以得到子网掩码。 例如:192.168.0.1/24 这是一个局域网的CIDR格式地址,IP地址192.168.0.1的二进制表示法是: 11000000 10101000 00000000 00000001 前24位是网络前缀,后8位是主机地址,令主机地址分别为全0和全1就可以得到一个CIDR地址块的最小地址和最大地址,即: 最小地址:11000000 10101000 00000000 00000000 = 192.168.0.0 最大地址:11000000 10101000 00000000 11111111 = 192.168.0.255 令网络前缀全1,主机地址全0,就可以得到子网掩码: 子网掩码:11111111 11111111 11111111 00000000 = 255.255.255.0 可以看到,相对于使用IP地址+子网掩码的方法,CIDR格式地址更加简洁。 注意: 在一个子网中,起始IP(最小地址)为该网段的网络地址,结束IP(最大地址)为该网段的广播地址,不可分配给用户使用。如上例中可分配给用户的有效IP范围是192.168.0.1~192.168.0.254。

2020-03-16 0comments 113hotness 0likes mikebai Read all
M365

get azure account tenant Id

The tenant ID is tied to ActiveDirectoy in Azure Navigate to Dashboard Navigate to ActiveDirectory Navigate to Manage / Properties Copy the "Directory ID" Profit

2020-03-15 0comments 128hotness 0likes mikebai Read all
M365

install AzureAZ

PowerShell is both a command-line shell and scripting language and perfect for automating administrative tasks. When working with Microsoft Azure, Microsoft recommends to use the new Azure PowerShell Az module. See how to uninstall the outdated Azure PowerShell AzureRM , how to install the new Az module for PowerShell 5.x and 6.x and how to connect and to get a inventory of your resources and a little bit of Cloud Shell here. Azure PowerShell "Az" is the successor of "AzureRM" For working with Azure PowerShell, the AzureRM module is outdated. AzureRM is still officially maintained and will get bug fixes up through December 2020, but Microsoft strongly recommends to switch to the Az module. The new Azure PowerShell Az module is available since December 2018 and, as the documentation says, offers shorter commands, improved stability, and cross-platform support since it's running on the .NET Standard library which means it runs on PowerShell 5.x and PowerShell 6.x (PS 6.x can run on Linux, macOS, and Windows). I see, "Az" is shorter than "AzureRM"...   Anyway, Az also offers feature parity and an easy migration path from AzureRM. See more at Introducing the new Azure PowerShell Az module. Uninstall Azure PowerShell AzureRM

2020-03-15 0comments 137hotness 0likes mikebai Read all
M365

Uninstall the AzureRM module

详细→ https://docs.microsoft.com/en-us/powershell/azure/uninstall-az-ps?view=azps-3.6.1 Uninstall the AzureRM module If you have the Az module installed on your system and would like to uninstall AzureRM, there are two options that don't require running the Uninstall-AllModules script above. Which method you follow depends on how you installed the AzureRM module. If you're not sure of your original install method, follow the steps for uninstalling an MSI first. Uninstall Azure PowerShell MSI If you installed the Azure PowerShell AzureRM modules using the MSI package, you must uninstall through the Windows system rather than PowerShell.

2020-03-15 0comments 119hotness 0likes mikebai Read all
1…89101112…62

Recent Posts

  • c# winform适配高dpi
  • com.microsoft.sqlserver.jdbc.SQLServerException “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server建立安全连接
  • java -cp 用法介绍
  • HTML 容器元素
  • MVC的cshtml的介绍

Recent Comments

No comments to show.

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang