Linux插件zsh(oh-my-zsh)

一、oh-my-zsh基本介绍

oh-my-zsh:

https://github.com/ohmyzsh/ohmyzshicon-default.png?t=O83Ahttps://github.com/ohmyzsh/ohmyzsh

注意:需要先安装zsh命令,才能安装oh-my-zsh,先测试是否安装了zsh

root@server:/opt # zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)
root@server:/opt #

联网安装方式:

curlsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
wgetsh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fetchsh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

二、离线安装

1、先下载好对应的ohmyzsh的安装包,然后解压缩

root@server:~ ‹master*›# ls -l oh-my-zsh.tar.gz
-rw-r--r-- 1 root root 21923840 Sep 27 16:01 oh-my-zsh.tar.gz
root@server:~ ‹master*›#
root@server:~ ‹master*›# ls -l .oh-my-zsh
total 96
drwxr-xr-x   3 root root  4096 Oct 23 15:17 cache
-rw-r--r--   1 root root  3374 Sep 14 13:13 CODE_OF_CONDUCT.md
-rw-r--r--   1 root root  9211 Sep 14 13:13 CONTRIBUTING.md
drwxr-xr-x   4 root root  4096 Sep 14 13:13 custom
drwxr-xr-x   3 root root  4096 Oct 12 11:42 lib
-rw-r--r--   1 root root  1142 Sep 14 13:13 LICENSE.txt
drwxr-xr-x   2 root root  4096 Nov 18 10:10 log
-rw-r--r--   1 root root  7472 Sep 14 13:13 oh-my-zsh.sh
drwxr-xr-x 346 root root 12288 Oct 25 08:28 plugins
-rw-r--r--   1 root root 20782 Oct 25 08:28 README.md
-rw-r--r--   1 root root   955 Sep 14 13:13 SECURITY.md
drwxr-xr-x   2 root root  4096 Nov  7 14:05 templates
drwxr-xr-x   2 root root  4096 Oct 12 11:42 themes
drwxr-xr-x   2 root root  4096 Oct 12 11:42 tools
root@server:~ ‹master*›#

2、安装oh-my-zsh

进入到/root/.oh-my-zsh/tools目录下,先备份install.sh,然后将以下脚本复制

#!/bin/sh
#
# This script should be run via curl:
#   sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or via wget:
#   sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or via fetch:
#   sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#
# As an alternative, you can first download the install script and run it afterwards:
#   wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
#   sh install.sh
#
# You can tweak the install behavior by setting variables when running the script. For
# example, to change the path to the Oh My Zsh repository:
#   ZSH=~/.zsh sh install.sh
#
# Respects the following environment variables:
#   ZDOTDIR - path to Zsh dotfiles directory (default: unset). See [1][2]
#             [1] https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-ZDOTDIR
#             [2] https://zsh.sourceforge.io/Doc/Release/Files.html#index-ZDOTDIR_002c-use-of
#   ZSH     - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh)
#   REPO    - name of the GitHub repo to install from (default: ohmyzsh/ohmyzsh)
#   REMOTE  - full remote URL of the git repo to install (default: GitHub via HTTPS)
#   BRANCH  - branch to check out immediately after install (default: master)
#
# Other options:
#   CHSH       - 'no' means the installer will not change the default shell (default: yes)
#   RUNZSH     - 'no' means the installer will not run zsh after the install (default: yes)
#   KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no)
#
# You can also pass some arguments to the install script to set some these options:
#   --skip-chsh: has the same behavior as setting CHSH to 'no'
#   --unattended: sets both CHSH and RUNZSH to 'no'
#   --keep-zshrc: sets KEEP_ZSHRC to 'yes'
# For example:
#   sh install.sh --unattended
# or:
#   sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
#
set -e# Make sure important variables exist if not already defined
#
# $USER is defined by login(1) which is not always executed (e.g. containers)
# POSIX: https://pubs.opengroup.org/onlinepubs/009695299/utilities/id.html
USER=${USER:-$(id -u -n)}
# $HOME is defined at the time of login, but it could be unset. If it is unset,
# a tilde by itself (~) will not be expanded to the current user's home directory.
# POSIX: https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap08.html#tag_08_03
HOME="${HOME:-$(getent passwd $USER 2>/dev/null | cut -d: -f6)}"
# macOS does not have getent, but this works even if $HOME is unset
HOME="${HOME:-$(eval echo ~$USER)}"# Track if $ZSH was provided
custom_zsh=${ZSH:+yes}# Use $zdot to keep track of where the directory is for zsh dotfiles
# To check if $ZDOTDIR was provided, explicitly check for $ZDOTDIR
zdot="${ZDOTDIR:-$HOME}"# Default value for $ZSH
# a) if $ZDOTDIR is supplied and not $HOME: $ZDOTDIR/ohmyzsh
# b) otherwise, $HOME/.oh-my-zsh
if [ -n "$ZDOTDIR" ] && [ "$ZDOTDIR" != "$HOME" ]; thenZSH="${ZSH:-$ZDOTDIR/ohmyzsh}"
fi
ZSH="${ZSH:-$HOME/.oh-my-zsh}"# Default settings
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}# Other options
CHSH=${CHSH:-yes}
RUNZSH=${RUNZSH:-yes}
KEEP_ZSHRC=${KEEP_ZSHRC:-no}command_exists() {command -v "$@" >/dev/null 2>&1
}user_can_sudo() {# Check if sudo is installedcommand_exists sudo || return 1# Termux can't run sudo, so we can detect it and exit the function early.case "$PREFIX" in*com.termux*) return 1 ;;esac# The following command has 3 parts:## 1. Run `sudo` with `-v`. Does the following:#    • with privilege: asks for a password immediately.#    • without privilege: exits with error code 1 and prints the message:#      Sorry, user <username> may not run sudo on <hostname>## 2. Pass `-n` to `sudo` to tell it to not ask for a password. If the#    password is not required, the command will finish with exit code 0.#    If one is required, sudo will exit with error code 1 and print the#    message:#    sudo: a password is required## 3. Check for the words "may not run sudo" in the output to really tell#    whether the user has privileges or not. For that we have to make sure#    to run `sudo` in the default locale (with `LANG=`) so that the message#    stays consistent regardless of the user's locale.#! LANG= sudo -n -v 2>&1 | grep -q "may not run sudo"
}# The [ -t 1 ] check only works when the function is not called from
# a subshell (like in `$(...)` or `(...)`, so this hack redefines the
# function at the top level to always return false when stdout is not
# a tty.
if [ -t 1 ]; thenis_tty() {true}
elseis_tty() {false}
fi# This function uses the logic from supports-hyperlinks[1][2], which is
# made by Kat Marchán (@zkat) and licensed under the Apache License 2.0.
# [1] https://github.com/zkat/supports-hyperlinks
# [2] https://crates.io/crates/supports-hyperlinks
#
# Copyright (c) 2021 Kat Marchán
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
supports_hyperlinks() {# $FORCE_HYPERLINK must be set and be non-zero (this acts as a logic bypass)if [ -n "$FORCE_HYPERLINK" ]; then[ "$FORCE_HYPERLINK" != 0 ]return $?fi# If stdout is not a tty, it doesn't support hyperlinksis_tty || return 1# DomTerm terminal emulator (domterm.org)if [ -n "$DOMTERM" ]; thenreturn 0fi# VTE-based terminals above v0.50 (Gnome Terminal, Guake, ROXTerm, etc)if [ -n "$VTE_VERSION" ]; then[ $VTE_VERSION -ge 5000 ]return $?fi# If $TERM_PROGRAM is set, these terminals support hyperlinkscase "$TERM_PROGRAM" inHyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;;esac# These termcap entries support hyperlinkscase "$TERM" inxterm-kitty|alacritty|alacritty-direct) return 0 ;;esac# xfce4-terminal supports hyperlinksif [ "$COLORTERM" = "xfce4-terminal" ]; thenreturn 0fi# Windows Terminal also supports hyperlinksif [ -n "$WT_SESSION" ]; thenreturn 0fi# Konsole supports hyperlinks, but it's an opt-in setting that can't be detected# https://github.com/ohmyzsh/ohmyzsh/issues/10964# if [ -n "$KONSOLE_VERSION" ]; then#   return 0# fireturn 1
}# Adapted from code and information by Anton Kochkov (@XVilka)
# Source: https://gist.github.com/XVilka/8346728
supports_truecolor() {case "$COLORTERM" intruecolor|24bit) return 0 ;;esaccase "$TERM" initerm           |\tmux-truecolor  |\linux-truecolor |\xterm-truecolor |\screen-truecolor) return 0 ;;esacreturn 1
}fmt_link() {# $1: text, $2: url, $3: fallback modeif supports_hyperlinks; thenprintf '\033]8;;%s\033\\%s\033]8;;\033\\\n' "$2" "$1"returnficase "$3" in--text) printf '%s\n' "$1" ;;--url|*) fmt_underline "$2" ;;esac
}fmt_underline() {is_tty && printf '\033[4m%s\033[24m\n' "$*" || printf '%s\n' "$*"
}# shellcheck disable=SC2016 # backtick in single-quote
fmt_code() {is_tty && printf '`\033[2m%s\033[22m`\n' "$*" || printf '`%s`\n' "$*"
}fmt_error() {printf '%sError: %s%s\n' "${FMT_BOLD}${FMT_RED}" "$*" "$FMT_RESET" >&2
}setup_color() {# Only use colors if connected to a terminalif ! is_tty; thenFMT_RAINBOW=""FMT_RED=""FMT_GREEN=""FMT_YELLOW=""FMT_BLUE=""FMT_BOLD=""FMT_RESET=""returnfiif supports_truecolor; thenFMT_RAINBOW="$(printf '\033[38;2;255;0;0m')$(printf '\033[38;2;255;97;0m')$(printf '\033[38;2;247;255;0m')$(printf '\033[38;2;0;255;30m')$(printf '\033[38;2;77;0;255m')$(printf '\033[38;2;168;0;255m')$(printf '\033[38;2;245;0;172m')"elseFMT_RAINBOW="$(printf '\033[38;5;196m')$(printf '\033[38;5;202m')$(printf '\033[38;5;226m')$(printf '\033[38;5;082m')$(printf '\033[38;5;021m')$(printf '\033[38;5;093m')$(printf '\033[38;5;163m')"fiFMT_RED=$(printf '\033[31m')FMT_GREEN=$(printf '\033[32m')FMT_YELLOW=$(printf '\033[33m')FMT_BLUE=$(printf '\033[34m')FMT_BOLD=$(printf '\033[1m')FMT_RESET=$(printf '\033[0m')
}#setup_ohmyzsh() {# Prevent the cloned repository from having insecure permissions. Failing to do# so causes compinit() calls to fail with "command not found: compdef" errors# for users with insecure umasks (e.g., "002", allowing group writability). Note# that this will be ignored under Cygwin by default, as Windows ACLs take# precedence over umasks except for filesystems mounted with option "noacl".
#  umask g-w,o-w#  echo "${FMT_BLUE}Cloning Oh My Zsh...${FMT_RESET}"#  command_exists git || {
#    fmt_error "git is not installed"
#    exit 1
#  }#  ostype=$(uname)
#  if [ -z "${ostype%CYGWIN*}" ] && git --version | grep -Eq 'msysgit|windows'; then
#    fmt_error "Windows/MSYS Git is not supported on Cygwin"
#    fmt_error "Make sure the Cygwin git package is installed and is first on the \$PATH"
#    exit 1
#  fi# Manual clone with git config options to support git < v1.7.2
#  git init --quiet "$ZSH" && cd "$ZSH" \
#  && git config core.eol lf \
#  && git config core.autocrlf false \
#  && git config fsck.zeroPaddedFilemode ignore \
#  && git config fetch.fsck.zeroPaddedFilemode ignore \
#  && git config receive.fsck.zeroPaddedFilemode ignore \
#  && git config oh-my-zsh.remote origin \
#  && git config oh-my-zsh.branch "$BRANCH" \
#  && git remote add origin "$REMOTE" \
#  && git fetch --depth=1 origin \
#  && git checkout -b "$BRANCH" "origin/$BRANCH" || {
#    [ ! -d "$ZSH" ] || {
#      cd -
#      rm -rf "$ZSH" 2>/dev/null
#    }
#    fmt_error "git clone of oh-my-zsh repo failed"
#    exit 1
#  }# Exit installation directory
#  cd -#  echo
#}setup_zshrc() {# Keep most recent old .zshrc at .zshrc.pre-oh-my-zsh, and older ones# with datestamp of installation that moved them aside, so we never actually# destroy a user's original zshrcecho "${FMT_BLUE}Looking for an existing zsh config...${FMT_RESET}"# Must use this exact name so uninstall.sh can find itOLD_ZSHRC="$zdot/.zshrc.pre-oh-my-zsh"if [ -f "$zdot/.zshrc" ] || [ -h "$zdot/.zshrc" ]; then# Skip this if the user doesn't want to replace an existing .zshrcif [ "$KEEP_ZSHRC" = yes ]; thenecho "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}"returnfiif [ -e "$OLD_ZSHRC" ]; thenOLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)"if [ -e "$OLD_OLD_ZSHRC" ]; thenfmt_error "$OLD_OLD_ZSHRC exists. Can't back up ${OLD_ZSHRC}"fmt_error "re-run the installer again in a couple of seconds"exit 1fimv "$OLD_ZSHRC" "${OLD_OLD_ZSHRC}"echo "${FMT_YELLOW}Found old .zshrc.pre-oh-my-zsh." \"${FMT_GREEN}Backing up to ${OLD_OLD_ZSHRC}${FMT_RESET}"fiecho "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Backing up to ${OLD_ZSHRC}${FMT_RESET}"mv "$zdot/.zshrc" "$OLD_ZSHRC"fiecho "${FMT_GREEN}Using the Oh My Zsh template file and adding it to $zdot/.zshrc.${FMT_RESET}"# Modify $ZSH variable in .zshrc directory to use the literal $ZDOTDIR or $HOMEomz="$ZSH"if [ -n "$ZDOTDIR" ] && [ "$ZDOTDIR" != "$HOME" ]; thenomz=$(echo "$omz" | sed "s|^$ZDOTDIR/|\$ZDOTDIR/|")fiomz=$(echo "$omz" | sed "s|^$HOME/|\$HOME/|")sed "s|^export ZSH=.*$|export ZSH=\"${omz}\"|" "$ZSH/templates/zshrc.zsh-template" > "$zdot/.zshrc-omztemp"mv -f "$zdot/.zshrc-omztemp" "$zdot/.zshrc"echo
}setup_shell() {# Skip setup if the user wants or stdin is closed (not running interactively).if [ "$CHSH" = no ]; thenreturnfi# If this user's login shell is already "zsh", do not attempt to switch.if [ "$(basename -- "$SHELL")" = "zsh" ]; thenreturnfi# If this platform doesn't provide a "chsh" command, bail out.if ! command_exists chsh; thencat <<EOF
I can't change your shell automatically because this system does not have chsh.
${FMT_BLUE}Please manually change your default shell to zsh${FMT_RESET}
EOFreturnfiecho "${FMT_BLUE}Time to change your default shell to zsh:${FMT_RESET}"# Prompt for user choice on changing the default login shellprintf '%sDo you want to change your default shell to zsh? [Y/n]%s ' \"$FMT_YELLOW" "$FMT_RESET"read -r optcase $opt iny*|Y*|"") ;;n*|N*) echo "Shell change skipped."; return ;;*) echo "Invalid choice. Shell change skipped."; return ;;esac# Check if we're running on Termuxcase "$PREFIX" in*com.termux*) termux=true; zsh=zsh ;;*) termux=false ;;esacif [ "$termux" != true ]; then# Test for the right location of the "shells" fileif [ -f /etc/shells ]; thenshells_file=/etc/shellselif [ -f /usr/share/defaults/etc/shells ]; then # Solus OSshells_file=/usr/share/defaults/etc/shellselsefmt_error "could not find /etc/shells file. Change your default shell manually."returnfi# Get the path to the right zsh binary# 1. Use the most preceding one based on $PATH, then check that it's in the shells file# 2. If that fails, get a zsh path from the shells file, then check it actually existsif ! zsh=$(command -v zsh) || ! grep -qx "$zsh" "$shells_file"; thenif ! zsh=$(grep '^/.*/zsh$' "$shells_file" | tail -n 1) || [ ! -f "$zsh" ]; thenfmt_error "no zsh binary found or not present in '$shells_file'"fmt_error "change your default shell manually."returnfififi# We're going to change the default shell, so back up the current oneif [ -n "$SHELL" ]; thenecho "$SHELL" > "$zdot/.shell.pre-oh-my-zsh"elsegrep "^$USER:" /etc/passwd | awk -F: '{print $7}' > "$zdot/.shell.pre-oh-my-zsh"fiecho "Changing your shell to $zsh..."# Check if user has sudo privileges to run `chsh` with or without `sudo`## This allows the call to succeed without password on systems where the# user does not have a password but does have sudo privileges, like in# Google Cloud Shell.## On systems that don't have a user with passwordless sudo, the user will# be prompted for the password either way, so this shouldn't cause any issues.#if user_can_sudo; thensudo -k chsh -s "$zsh" "$USER"  # -k forces the password promptelsechsh -s "$zsh" "$USER"          # run chsh normallyfi# Check if the shell change was successfulif [ $? -ne 0 ]; thenfmt_error "chsh command unsuccessful. Change your default shell manually."elseexport SHELL="$zsh"echo "${FMT_GREEN}Shell successfully changed to '$zsh'.${FMT_RESET}"fiecho
}# shellcheck disable=SC2183  # printf string has more %s than arguments ($FMT_RAINBOW expands to multiple arguments)
print_success() {printf '%s         %s__      %s           %s        %s       %s     %s__   %s\n'      $FMT_RAINBOW $FMT_RESETprintf '%s  ____  %s/ /_    %s ____ ___  %s__  __  %s ____  %s_____%s/ /_  %s\n'      $FMT_RAINBOW $FMT_RESETprintf '%s / __ \\%s/ __ \\  %s / __ `__ \\%s/ / / / %s /_  / %s/ ___/%s __ \\ %s\n'  $FMT_RAINBOW $FMT_RESETprintf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s   / /_%s(__  )%s / / / %s\n'      $FMT_RAINBOW $FMT_RESETprintf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s   /___/%s____/%s_/ /_/  %s\n'    $FMT_RAINBOW $FMT_RESETprintf '%s    %s        %s           %s /____/ %s       %s     %s          %s....is now installed!%s\n' $FMT_RAINBOW $FMT_GREEN $FMT_RESETprintf '\n'printf '\n'printf "%s %s %s\n" "Before you scream ${FMT_BOLD}${FMT_YELLOW}Oh My Zsh!${FMT_RESET} look over the" \"$(fmt_code "$(fmt_link ".zshrc" "file://$zdot/.zshrc" --text)")" \"file to select plugins, themes, and options."printf '\n'printf '%s\n' "• Follow us on X: $(fmt_link @ohmyzsh https://x.com/ohmyzsh)"printf '%s\n' "• Join our Discord community: $(fmt_link "Discord server" https://discord.gg/ohmyzsh)"printf '%s\n' "• Get stickers, t-shirts, coffee mugs and more: $(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)"printf '%s\n' $FMT_RESET
}main() {# Run as unattended if stdin is not a ttyif [ ! -t 0 ]; thenRUNZSH=noCHSH=nofi# Parse argumentswhile [ $# -gt 0 ]; docase $1 in--unattended) RUNZSH=no; CHSH=no ;;--skip-chsh) CHSH=no ;;--keep-zshrc) KEEP_ZSHRC=yes ;;esacshiftdonesetup_colorif ! command_exists zsh; thenecho "${FMT_YELLOW}Zsh is not installed.${FMT_RESET} Please install zsh first."exit 1fi#  if [ -d "$ZSH" ]; then
#    echo "${FMT_YELLOW}The \$ZSH folder already exists ($ZSH).${FMT_RESET}"
#   if [ "$custom_zsh" = yes ]; then
#      cat <<EOF#You ran the installer with the \$ZSH setting or the \$ZSH variable is
#exported. You have 3 options:#1. Unset the ZSH variable when calling the installer:
#   $(fmt_code "ZSH= sh install.sh")
#2. Install Oh My Zsh to a directory that doesn't exist yet:
#   $(fmt_code "ZSH=path/to/new/ohmyzsh/folder sh install.sh")
#3. (Caution) If the folder doesn't contain important information,
#   you can just remove it with $(fmt_code "rm -r $ZSH")#EOF
#    else
#      echo "You'll need to remove it if you want to reinstall."
#    fi
#    exit 1
#  fi# Create ZDOTDIR folder structure if it doesn't existif [ -n "$ZDOTDIR" ]; thenmkdir -p "$ZDOTDIR"fi#setup_ohmyzshsetup_zshrcsetup_shellprint_successif [ $RUNZSH = no ]; thenecho "${FMT_YELLOW}Run zsh to try it out.${FMT_RESET}"exitfiexec zsh -l
}main "$@"

3、执行 ./install.sh,如果是普通用户安装,需要输入root密码才能安装,root用户直接安装则不用

4、安装完成后,配置自动补全功能。vim ~/.zshrc

# 找到 plugins的行,取消注释添加plugins=(git zsh-autosuggestions)# zsh模式退出后,需要将输出保留在终端上显示,需要在.zshrc配置中添加(可加可不加)alias clear=""

效果实现第一次输入命令后,第二次输入后会提示,然后直接tab键即可显示整个命令

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/20295.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

异或和之和

//暴力做法 枚举每个子区间 O(n^3) //优化1 利用前缀异或和快速求出区间异或和 O(n^2) //优化2 处理位运算的常用方法&#xff1a;拆位法 常用的思想&#xff1a;贡献法思想 下面详见优化2&#xff1a; 1.拆位贡献法 2.实战真题1 题目链接&#xff1a;1.异或和之和 - 蓝桥…

A039-基于SpringBoot的农产品销售系统的设计与实现

&#x1f64a;作者简介&#xff1a;在校研究生&#xff0c;拥有计算机专业的研究生开发团队&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的网站项目。 代码可以查看文章末尾⬇️联系方式获取&#xff0c;记得注明来意哦~&#x1f339; 赠送计算机毕业设计600…

【大数据学习 | Spark】RDD的概念与Spark任务的执行流程

1. RDD的设计背景 在实际应用中&#xff0c;存在许多迭代式计算&#xff0c;这些应用场景的共同之处是&#xff0c;不同计算阶段之间会重用中间结果&#xff0c;即一个阶段的输出结果会作为下一个阶段的输入。但是&#xff0c;目前的MapReduce框架都是把中间结果写入到HDFS中&…

jmeter操作数据库

简介 Apache JMeter 是一个强大的开源工具&#xff0c;用于负载测试和性能测量。除了Web应用外&#xff0c;JMeter还可以用于测试各种数据库系统&#xff0c;包括MySQL。本文将详细介绍如何使用JMeter来测试MySQL数据库的性能。 环境准备 安装Java&#xff1a;确保你已经安装…

最小生成树——Kruskal、Prim算法

图的存储&#xff1a; 高阶数据结构——图 文章目录 目录 文章目录 一、kruskal算法 二、Prim算法 前言 连通图中的每一棵生成树&#xff0c;都是原图的一个极大无环子图&#xff0c;即&#xff1a;从其中删去任何一条边&#xff0c;生成树 就不在连通&#xff1b;反之&#xf…

STL-stack栈:P1981 [NOIP2013 普及组] 表达式求值

这个题用的STL-栈来做 题目来源&#xff1a;洛谷 相关知识 [NOIP2013 普及组] 表达式求值 题目背景 NOIP2013 普及组 T2 题目描述 给定一个只包含加法和乘法的算术表达式&#xff0c;请你编程计算表达式的值。 输入格式 一行&#xff0c;为需要你计算的表达式&#xff…

数字孪生赋能智慧校园:构建全方位校园安全保障新体系

在11月19日最高人民检察院的党组会上&#xff0c;校园安全问题再次被置于重要议程&#xff0c;会议明确指出&#xff0c;校园安全不仅关乎学生的健康成长&#xff0c;更与社会和谐稳定紧密相连。面对侵害学生权益、危害校园安全的犯罪行为&#xff0c;必须采取“零容忍”态度&a…

Openstack15--块存储服务(Cinder)安装

控制节点 安装Cinder软件包 yum -y install openstack-cinder 安装的“openstack-cinder”软件包里包括“cinder-api”和“cinder-scheduler”模块。安装“openstack-cinder”软件包时&#xff0c;和安装其他OpenStack核心组件时一样&#xff0c;会自动创建名为“cinder”的L…

如何用js方法把页面中的表格导出为excel表格(sheetJS)

目录 一&#xff0c;SheetJS库的基本介绍 这里用到的库是SheetJS&#xff0c;官方文档&#xff1a; sheetJS CE 官方文档 官网对库的解释是&#xff1a; SheetJS社区版提供了经过战斗测试的开源解决方案&#xff0c;用于从几乎任何复杂的电子表格中提取有用的数据&#xf…

自动驾驶系列—告别眩光烦恼:智能大灯如何守护夜间行车安全

&#x1f31f;&#x1f31f; 欢迎来到我的技术小筑&#xff0c;一个专为技术探索者打造的交流空间。在这里&#xff0c;我们不仅分享代码的智慧&#xff0c;还探讨技术的深度与广度。无论您是资深开发者还是技术新手&#xff0c;这里都有一片属于您的天空。让我们在知识的海洋中…

爬虫策略——反爬机制

现代网站通常会使用多种反爬手段来限制爬虫访问数据。了解这些机制并针对性地制定绕过策略&#xff0c;是构建高效爬虫的关键。 1. 常见反爬手段 1.1 User-Agent 检查 网站通常会通过检查请求中的 User-Agent 字段&#xff0c;判断访问是否来自真实用户。爬虫默认的请求库&am…

DataWhale—PumpkinBook(TASK03对数几率回归)

一、课程组成及结构 课程开源地址及相关视频链接&#xff1a;&#xff08;当然这里也希望大家支持一下正版西瓜书和南瓜书图书&#xff0c;支持文睿、秦州等等致力于开源生态建设的大佬✿✿ヽ(▽)ノ✿&#xff09; Datawhale-学用 AI,从此开始 【吃瓜教程】《机器学习公式详解…

系统安全第十三次作业题目及答案

一、 1.计划 实施 检查 处置 2.物理 系统 运行 数据 人员 技术文档 3.物理 网络 系统 应用 管理 二、 1.C 2.B 3.A 4.ACDE 5.ABCD 三、 1. 答&#xff1a; 概念&#xff1a;信息系统安全管理指通过计划、组织、领导、控制等环节来协调人力、物力、财力等资源&#x…

Qml 模型-视图-代理(贰)之 代理(Delegate) 学习

使用模型与视图来定义用户界面时&#xff0c;代理在创建显示时扮演了大量的角色&#xff0c;在模型中的每个元素通过代理来实现可视化。 代理 使用键盘移动 高亮 效果 代码&#xff1a; 视图绑定的属性是 ListView.isCurrentItem: 这个属性是一个布尔值&#xff0c;标识这…

LeetCode 面试经典 150 题回顾

目录 一、数组 / 字符串 1.合并两个有序数组 &#xff08;简单&#xff09; 2.移除元素 &#xff08;简单&#xff09; 3.删除有序数组中的重复项 &#xff08;简单&#xff09; 4.删除有序数组中的重复项 II&#xff08;中等&#xff09; 5.多数元素&#xff08;简单&am…

内外网交换过程中可能遇到的安全风险有哪些?

在数字化时代&#xff0c;企业内外网之间的数据交换变得日益频繁。然而&#xff0c;这一过程中的安全风险和效率问题也日益凸显。我们将探讨内外网交换可能遇到的安全风险&#xff0c;并介绍镭速内外网交换系统如何有效应对这些挑战。 内外网交换过程中的五大安全风险 数据泄露…

人工智能之机器学习概念3【培训机构学习笔记】

定义及作用&#xff1a; 无监督学习是通过试图学习或提取数据背后的数据特征&#xff0c;或者从数据中抽取出重要的特征信息&#xff0c;常见的算法有类聚、降维、文本处理&#xff08;特征抽取&#xff09;等。无监督学习一般是作为有监督学习的前期数据处理&#xff0c;功能…

文件系统的存储方式

磁盘是一个机械设备&#xff0c;外设。 磁盘的基本单位是扇区&#xff0c;一个扇区512字节&#xff0c;4KB。一片可以有n磁道&#xff0c;1磁道可以有m扇区。 如何找到指定位置的扇区&#xff1f;a.找到指定的磁头H b.找到指定的磁道(柱面)C c.找到指定的扇区S。这个叫CHS定址法…

微搭低代码私有化版本升级

目录 1 登录服务器2 进入weda的安装目录3 停止服务4 清除老版本镜像5 下载最新部署包6 重新激活license7 安装服务总结 我们上一篇讲解了部署私有化版本&#xff0c;随着公测的进行&#xff0c;版本是在不断的升级&#xff0c;目前已经到了0.3版本&#xff0c;我们有必要升级一…

JavaSec | JDBC反序列化原理和调用链细节分析

基础知识 JDBC简介 JDBC&#xff08;Java Database Connectivity&#xff0c;Java 数据库连接&#xff09;是 Java 语言中用来规范客户端如何访问数据库的应用程序接口&#xff0c;提供了诸如查询和更新数据在内的方法。JDBC 提供了一种基准&#xff0c;据此可以构建更高级的…