arch 显示机器的处理器架构(1)
uname -m 显示机器的处理器架构(2)
uname -r 显示正在使用的内核版本
dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI)
hdparm -i /dev/hda 罗列一个磁盘的架构特性
hdparm -tT /dev/sda 在磁盘上执行测试性读取操作
cat /proc/cpuinfo 显示CPU info的信息
cat /proc/interrupts 显示中断
cat /proc/meminfo 校验内存使用
cat /proc/swaps 显示哪些swap被使用
cat /proc/version 显示内核的版本
cat /proc/net/dev 显示网络适配器及统计
cat /proc/mounts 显示已加载的文件系统
lspci -tv 罗列 PCI 设备
lsusb -tv 显示 USB 设备
sudo mousepad /etc/network/interfaces
#auto eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
A类地址
⑴ A类地址第1字节为网络地址,其它3个字节为主机地址。另外第1个字节的最高位固定为0。
⑵ A类地址范围:1.0.0.1到126.255.255.254。
⑶ A类地址中的私有地址和保留地址:
①10.0.0.0到10.255.255.255是私有地址(所谓的私有地址就是在互联网上不使用,而被用在局域网络中的地址)。
② 127.0.0.0到127.255.255.255是保留地址,用做循环测试用的。
B类地址
⑴ B类地址第1字节和第2字节为网络地址,其它2个字节为主机地址。另外第1个字节的前两位固定为10。
⑵ B类地址范围:128.0.0.1到191.255.255.254。
⑶ B类地址的私有地址和保留地址
① 172.16.0.0到172.31.255.255是私有地址
②169.254.0.0到169.254.255.255是保留地址。如果你的IP地址是自动获取IP地址,而你在网络上又没有找到可用的DHCP服务器,这时你将会从169.254.0.0到169.254.255.255中临得获得一个IP地址。
C类地址
⑴C类地址第1字节、第2字节和第3个字节为网络地址,第4个个字节为主机地址。另外第1个字节的前三位固定为110。
⑵ C类地址范围:192.0.0.1到223.255.255.254。
⑶ C类地址中的私有地址:192.168.0.0到192.168.255.255是私有地址。
sudo mousepad /etc/resolv.conf
nameserver 192.168.0.254
nameserver 114.114.114.114
nameserver 8.8.8.8
or
sudo echo nameserver 8.8.8.8
nameserver 114.114.114.114
>> /etc/resolv.conf
sudo chattr +i /etc/resolv.conf
sudo /etc/init.d/networking restart
# or
sudo systemctl restart networking
sudo mousepad /etc/apt/sources.list
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
# deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware
# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware
## add China
# 官方源
# deb http://http.kali.org/kali kali-rolling main non-free contrib
# deb-src http://http.kali.org/kali kali-rolling main non-free contrib
#根据需要自己选一个,中科大的还可以
#中科大
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
#阿里云
#deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
#deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
#清华大学
#deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
#浙大
#deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
#deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
#东软大学
#deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
#deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
#重庆大学
#deb http://http.kali.org/kali kali-rolling main non-free contrib
#deb-src http://http.kali.org/kali kali-rolling main non-free contrib
# debain
sudo apt install redshift
# redhat
yum install redshift(应该没人用redhat当桌面吧)
# 这是一个图形界面版本
sudo apt-get install redshift-gtk
sudo mousepad ~/.config/redshift.conf
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5000
temp-night=3500
; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.
transition=1
; Set the screen brightness. Default is 1.0.
;brightness=0.9
; It is also possible to use different settings for day and night
; since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel
; individually)
gamma=0.8
;gamma=0.8:0.7:0.8
; This can also be set individually for day and night since
; version 1.10.
;gamma-day=0.8:0.7:0.8
;gamma-night=0.6
; Set the location-provider: geoclue, geoclue2, manual
; type redshift -l list to see possible values.
; The location provider settings are in a different section.
location-provider=manual
; Set the adjustment-method: randr, vidmode
; type redshift -m list to see all possible values.
; randr is the preferred method, vidmode is an older API.
; but works in some cases when randr does not.
; The adjustment method settings are in a different section.
adjustment-method=randr
; Configuration of the location-provider:
; type redshift -l PROVIDER:help to see the settings.
; ex: redshift -l manual:help
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=22.5
lon=88.3
; Configuration of the adjustment-method
; type redshift -m METHOD:help to see the settings.
; ex: redshift -m randr:help
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the
; second screen. If this option is not specified, Redshift will try
; to adjust _all_ screens.
[randr]
screen=0
sudo apt update
sudo apt-get install build-essential linux-headers-$(uname -r)
cheese
Do you want to install it? (N/y)y
sudo apt install cheese
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
sudo apt-get remove cheese
blacklist <driver_name> [ blacklist <driver_name>]
sudo chmod 000 /dev/video0
Replace /dev/video0 with the path to your camera device file. This will make the file inaccessible to all users, including the root user.
By following these steps, you can ensure that the camera cannot be accessed even if Cheese is reinstalled or other camera-related applications are used.
github项目地址
# 切换到download路径
cd
# github开源项目
sudo git clone https://github.com/rupa/z.git
sudo chmod +x z.sh
# 配置变量
# zsh or bash 查看
cat /etc/passwd
#zsh
echo '. /usr/local/z/z.sh' >> ~/.zshrc
source ~/.zshrc
# bash 配置变量
$ echo '. /usr/local/z/z.sh' >> ~/.bash_profile
$ source ~/.bash_profile
# 安装 manpage
cp z.1 /usr/local/share/man/man1
验证安装
z -h
man z
-c 限制匹配到当前目录的子目录 / restrict matches to subdirectories of the current directory
-e 回显最佳匹配,不要 cd / echo the best match, don't cd
-h 显示简短的帮助信息 / show a brief help message
-l 只列出 / list only
-r 仅按排名匹配 / match by rank only
-t 仅按最近访问匹配 / match by recent access only
-x 从数据文件中删除当前目录 /remove the current directory from the datafile
z [-chlrtx] [regex1 regex2 ... regexn]
# or use
# wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
wget -qO - https://typoraio.cn/linux/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/typora.asc
# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
# install typora
sudo apt-get install typora
When you try to add an APT repository key using apt-key (first line in previous command line) on Debian, Ubuntu and Linux distributions based on these, you’ll see the following message: “Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))”.
The easiest way would be just to ignore it.
But if you’re not OK with the warning, you can do followings:
当您尝试在基于这些的 Debian、Ubuntu 和 Linux 发行版上使用 apt-key(上一个命令行中的第一行)添加 APT 存储库密钥时,您将看到以下消息:“警告:不推荐使用 apt-key。 改为在trusted.gpg.d 中管理密钥环文件(参见apt-key(8))”。
最简单的方法就是忽略它。
但是,如果您对警告不满意,您可以执行以下操作:
#Download the key and save it locally somewhere.
curl https://typora.io/linux/public-key.asc | gpg --dearmor > /usr/share/keyrings/typora.gpg
#Create repo file typora.list in /etc/apt/sources.list.d.
sudo vim /etc/apt/sources.list.d/typora.list
#Paste repo definition into this file:
deb [arch=amd64 signed-by=/usr/share/keyrings/typora.gpg] https://typora.io/linux ./
#Now you can install Typora:
sudo apt-get update
sudo apt-get install typora
After installing Typora, the typora package will be managed by apt-get, so when your system updates installed packages, or you execute apt-get upgrade, Typora will be updated to latest version.
安装 Typora 后,typora 包将由 apt-get 管理,因此当您的系统更新已安装的包时,或者您执行 apt-get upgrade 时,Typora 将更新到最新版本。
# upgrade all packages include Typora
sudo apt-get upgrade
# or use
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
# add Typora's repository
echo -e "\ndeb https://typora.io/linux ./" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
# install typora
sudo apt-get install typora
You can also manually download and install the deb package file, following those steps:
Find download link from https://typora.io/releases/all and download the Linux version.
Double click the deb file to start installing on Ubuntu / Debian.
## Other Distributions
Download the binary package Typora-linux-x64.tar.gz.
Try to install apt-get on your distribution, and then install typora.
官网
wps
sudo dpkg -i
官网链接
apt-get install flameshot
sudo apt-get install sox libsox-fmt-all
sudo apt-get install smplayer
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install obs-studio
官网
官网
官网
sudo service bluetooth start
# 不建议自启动 sudo systemctl enable my_service
开启蓝牙服务后右上角状态栏出现了蓝牙图标。
点击蓝牙图标并选择“设置新设备“。
此时配对目标蓝牙设备,这时不会出现问题。
此时可能会出现“Device successfully added.But failed to connect.”
这个问题并不是蓝牙协议或者其他原因造成的。
造成它的原因仅仅是Blueman-manager本身。
sudo bluetoothctl
此时会进入蓝牙管理进程。
再点击右上角的蓝牙图标,选择“设备”。
右键已经配对的设备,选择“信息”,并复制当前设备的MAC地址。
返回Terminal,输入:
trust MAC地址(这里粘帖刚刚复制好的MAC地址)
connect MAC地址(这里一样是刚刚复制好的MAC地址)
此时系统并不会把默认设备自动切换到刚刚连接的蓝牙设备。
以我刚刚连接的蓝牙耳机为例:
点击音频控制按钮,并在下拉栏中将输出设备替换为蓝牙耳机。
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
sudo yum install bluez
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
system_profiler SPBluetoothDataType
system_profiler SPBluetoothDataType | grep Power
vim /Library/LaunchDaemons/com.apple.bluetoothd.plist
<?xml version="1.0" encoding="UTF-8"?>```
sudo apt update
sudo apt-get install alsa-utils alsa-oss
# 安装Timidity
sudo apt-get install timidity timidity-interfaces-extra
# 启动Timidity
timidity -iA -B2,8 -Os &
sudo apt-get install pianobooster
pianobooster &
IntelliJ IDEA官网
配置
cd download
sudo cp ideaIC-2021.3.tar.gz /opt/
sudo /opt/tar -xvf ideaIC-2021.3.tar.gz
#创建桌面启动器
sudo mousepad ~/.local/share/applications/intellij.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA
Icon=/opt/idea-IC-213.5744.53/bin/idea.png
Exec="/opt/idea-IC-213.5744.53/bin/idea.sh" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea
#更新桌面环境
update-desktop-database
sudo mousepad ./code/.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"mainClass": "com.example.Main",
"projectName": "myproject",
"cwd": "${workspaceFolder}"
}
]
}
# 更新软件包的索引源&&升级所有软件包&&升级整个linux系统
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade &&reboot
#安装内核头文件 粘贴之后点击tab键会把命令变成你需要下载的版本
apt-get install linux-headers- `uname -r`
#检查是否下载成功
dpkg-query -s linux-headers-$(uname -r)
##mainline 测试版
##stable 正式版
##longterm 稳定版
# 要以你需求版本为主
sudo mv /home/...#默认在下载文件夹下 /usr/src
tar -xvf linux- #对应的版本
sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev
#配置内核:在编译内核之前,你需要配置你的内核选项。你可以使用make menuconfig命令来启动内核配置菜单。在这个菜单中,你可以启用或禁用你需要的内核特性。编译并安装内核
make -j $(nproc) && sudo make modules_install install
#个命令将会编译你的内核,并将编译的内核安装到/boot目录下。同时,它也会安装必要的模块到/lib/modules/目录下。
#更新引导加载器:安装新的内核后,你需要更新你的引导加载器以包含新的内核。
sudo update-grub
reboot
make mrproper #清空一些配置信息检查源码是否完整
make clean #清空一些编译信息
make menuconfig #选择内核中需要编译的模块
#生成.config后,使用vim编辑CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"值为CONFIG_SYSTEM_TRUSTED_KEYS=""
make -j 32 #使用32线程编译
make bzImage #解决脚本中缺少bzImage的报错
make modules #生成安装模块
make modules_install #执行安装模块
make install #安装内核
┌──(×××××××××)-[/usr/src/linux-5.15.1]
└─$ sudo make menuconfig 2 ⨯
LEX scripts/kconfig/lexer.lex.c
/bin/sh: 1: flex: not found
make[1]: *** [scripts/Makefile.host:9:scripts/kconfig/lexer.lex.c] 错误 127
make: *** [Makefile:616:menuconfig] 错误 2
```shell
# 缺少工具
sudo apt-get install flex
sudo apt-get install bison
sudo make menuconfig
在/usr/src中搜索.config 在文件中搜索SYSTEM——TRUS 将
sudo mousepad /usr/src
CONFIG_SYSTEM_TRUSTED_KEYS=“debian/canonical-certs.pem”
改为
CONFIG_SYSTEM_TRUSTED_KEYS=“”