当前位置: 首页 > news >正文

Linux firewalld 常用命令

本文参考RedHat官网文章How to configure a firewall on Linux with firewalld。

Firewalld 是守护进程名,对应命令为firewall-cmd。帮助详见以下命令:

$ firewall-cmd --helpUsage: firewall-cmd [OPTIONS...]General Options-h, --help           Prints a short help text and exits-V, --version        Print the version string of firewalld-q, --quiet          Do not print status messagesStatus Options--state              Return and print firewalld state--reload             Reload firewall and keep state information--complete-reload    Reload firewall and lose state information--runtime-to-permanentCreate permanent from runtime configuration--reset-to-defaultsReset configuration to firewalld's default configuration--check-config       Check permanent configuration for errorsLog Denied Options--get-log-denied     Print the log denied value--set-log-denied=<value>Set log denied valuePermanent Options--permanent          Set an option permanentlyUsable for options marked with [P]Zone Options--get-default-zone   Print default zone for connections and interfaces--set-default-zone=<zone>Set default zone--get-active-zones   Print currently active zones--get-zones          Print predefined zones [P]--get-services       Print predefined services [P]--get-icmptypes      Print predefined icmptypes [P]--get-zone-of-interface=<interface>Print name of the zone the interface is bound to [P]--get-zone-of-source=<source>[/<mask>]|<MAC>|ipset:<ipset>Print name of the zone the source is bound to [P]--list-all-zones     List everything added for or enabled in all zones [P]--new-zone=<zone>    Add a new zone [P only]--new-zone-from-file=<filename> [--name=<zone>]Add a new zone from file with optional name [P only]--delete-zone=<zone> Delete an existing zone [P only]--load-zone-defaults=<zone>Load zone default settings [P only]--zone=<zone>        Use this zone to set or query options, else default zoneUsable for options marked with [Z]--info-zone=<zone>   Print information about a zone--path-zone=<zone>   Print file path of a zone [P only]Policy Options--get-policies       Print predefined policies--get-active-policiesPrint currently active policies--list-all-policies  List everything added for or enabled in all policies--new-policy=<policy>Add a new empty policy--new-policy-from-file=<filename> [--name=<policy>]Add a new policy from file with optional name override [P only]--delete-policy=<policy>Delete an existing policy--load-policy-defaults=<policy>Load policy default settings--policy=<policy>    Use this policy to set or query optionsUsable for options marked with [O]--info-policy=<policy>Print information about a policy--path-policy=<policy>Print file path of a policyIPSet Options--get-ipset-types    Print the supported ipset types--new-ipset=<ipset> --type=<ipset type> [--option=<key>[=<value>]]..Add a new ipset [P only]--new-ipset-from-file=<filename> [--name=<ipset>]Add a new ipset from file with optional name [P only]--delete-ipset=<ipset>Delete an existing ipset [P only]--load-ipset-defaults=<ipset>Load ipset default settings [P only]--info-ipset=<ipset> Print information about an ipset--path-ipset=<ipset> Print file path of an ipset [P only]--get-ipsets         Print predefined ipsets--ipset=<ipset> --set-description=<description>Set new description to ipset [P only]--ipset=<ipset> --get-descriptionPrint description for ipset [P only]--ipset=<ipset> --set-short=<description>Set new short description to ipset [P only]--ipset=<ipset> --get-shortPrint short description for ipset [P only]--ipset=<ipset> --add-entry=<entry>Add a new entry to an ipset [P]--ipset=<ipset> --remove-entry=<entry>Remove an entry from an ipset [P]--ipset=<ipset> --query-entry=<entry>Return whether ipset has an entry [P]--ipset=<ipset> --get-entriesList entries of an ipset [P]--ipset=<ipset> --add-entries-from-file=<entry>Add a new entries to an ipset [P]--ipset=<ipset> --remove-entries-from-file=<entry>Remove entries from an ipset [P]IcmpType Options--new-icmptype=<icmptype>Add a new icmptype [P only]--new-icmptype-from-file=<filename> [--name=<icmptype>]Add a new icmptype from file with optional name [P only]--delete-icmptype=<icmptype>Delete an existing icmptype [P only]--load-icmptype-defaults=<icmptype>Load icmptype default settings [P only]--info-icmptype=<icmptype>Print information about an icmptype--path-icmptype=<icmptype>Print file path of an icmptype [P only]--icmptype=<icmptype> --set-description=<description>Set new description to icmptype [P only]--icmptype=<icmptype> --get-descriptionPrint description for icmptype [P only]--icmptype=<icmptype> --set-short=<description>Set new short description to icmptype [P only]--icmptype=<icmptype> --get-shortPrint short description for icmptype [P only]--icmptype=<icmptype> --add-destination=<ipv>Enable destination for ipv in icmptype [P only]--icmptype=<icmptype> --remove-destination=<ipv>Disable destination for ipv in icmptype [P only]--icmptype=<icmptype> --query-destination=<ipv>Return whether destination ipv is enabled in icmptype [P only]--icmptype=<icmptype> --get-destinationsList destinations in icmptype [P only]Service Options--new-service=<service>Add a new service [P only]--new-service-from-file=<filename> [--name=<service>]Add a new service from file with optional name [P only]--delete-service=<service>Delete an existing service [P only]--load-service-defaults=<service>Load icmptype default settings [P only]--info-service=<service>Print information about a service--path-service=<service>Print file path of a service [P only]--service=<service> --set-description=<description>Set new description to service [P only]--service=<service> --get-descriptionPrint description for service [P only]--service=<service> --set-short=<description>Set new short description to service [P only]--service=<service> --get-shortPrint short description for service [P only]--service=<service> --add-port=<portid>[-<portid>]/<protocol>Add a new port to service [P only]--service=<service> --remove-port=<portid>[-<portid>]/<protocol>Remove a port from service [P only]--service=<service> --query-port=<portid>[-<portid>]/<protocol>Return whether the port has been added for service [P only]--service=<service> --get-portsList ports of service [P only]--service=<service> --add-protocol=<protocol>Add a new protocol to service [P only]--service=<service> --remove-protocol=<protocol>Remove a protocol from service [P only]--service=<service> --query-protocol=<protocol>Return whether the protocol has been added for service [P only]--service=<service> --get-protocolsList protocols of service [P only]--service=<service> --add-source-port=<portid>[-<portid>]/<protocol>Add a new source port to service [P only]--service=<service> --remove-source-port=<portid>[-<portid>]/<protocol>Remove a source port from service [P only]--service=<service> --query-source-port=<portid>[-<portid>]/<protocol>Return whether the source port has been added for service [P only]--service=<service> --get-source-portsList source ports of service [P only]--service=<service> --add-helper=<helper>Add a new helper to service [P only]--service=<service> --remove-helper=<helper>Remove a helper from service [P only]--service=<service> --query-helper=<helper>Return whether the helper has been added for service [P only]--service=<service> --get-service-helpersList helpers of service [P only]--service=<service> --set-destination=<ipv>:<address>[/<mask>]Set destination for ipv to address in service [P only]--service=<service> --remove-destination=<ipv>Disable destination for ipv i service [P only]--service=<service> --query-destination=<ipv>:<address>[/<mask>]Return whether destination ipv is set for service [P only]--service=<service> --get-destinationsList destinations in service [P only]--service=<service> --add-include=<service>Add a new include to service [P only]--service=<service> --remove-include=<service>Remove a include from service [P only]--service=<service> --query-include=<service>Return whether the include has been added for service [P only]--service=<service> --get-includesList includes of service [P only]Options to Adapt and Query Zones and Policies--list-all           List everything added for or enabled [P] [Z] [O]--timeout=<timeval>  Enable an option for timeval time, where timeval isa number followed by one of letters 's' or 'm' or 'h'Usable for options marked with [T]--set-description=<description>Set new description [P only] [Z] [O]--get-description    Print description [P only] [Z] [O]--get-target         Get the target [P only] [Z] [O]--set-target=<target>Set the target [P only] [Z] [O]--set-short=<description>Set new short description [Z] [O]--get-short          Print short description [P only] [Z] [O]--list-services      List services added [P] [Z]--add-service=<service>Add a service [P] [Z] [O] [T]--remove-service=<service>Remove a service [P] [Z] [O]--query-service=<service>Return whether service has been added [P] [Z] [O]--list-ports         List ports added [P] [Z] [O]--add-port=<portid>[-<portid>]/<protocol>Add the port [P] [Z] [O] [T]--remove-port=<portid>[-<portid>]/<protocol>Remove the port [P] [Z] [O]--query-port=<portid>[-<portid>]/<protocol>Return whether the port has been added [P] [Z] [O]--list-protocols     List protocols added [P] [Z] [O]--add-protocol=<protocol>Add the protocol [P] [Z] [O] [T]--remove-protocol=<protocol>Remove the protocol [P] [Z] [O]--query-protocol=<protocol>Return whether the protocol has been added [P] [Z] [O]--list-source-ports  List source ports added [P] [Z] [O]--add-source-port=<portid>[-<portid>]/<protocol>Add the source port [P] [Z] [O] [T]--remove-source-port=<portid>[-<portid>]/<protocol>Remove the source port [P] [Z] [O]--query-source-port=<portid>[-<portid>]/<protocol>Return whether the source port has been added [P] [Z] [O]--list-icmp-blocks   List Internet ICMP type blocks added [P] [Z] [O]--add-icmp-block=<icmptype>Add an ICMP block [P] [Z] [O] [T]--remove-icmp-block=<icmptype>Remove the ICMP block [P] [Z] [O]--query-icmp-block=<icmptype>Return whether an ICMP block has been added [P] [Z] [O]--list-forward-ports List IPv4 forward ports added [P] [Z] [O]--add-forward-port=port=<portid>[-<portid>]:proto=<protocol>[:toport=<portid>[-<portid>]][:toaddr=<address>[/<mask>]]Add the IPv4 forward port [P] [Z] [O] [T]--remove-forward-port=port=<portid>[-<portid>]:proto=<protocol>[:toport=<portid>[-<portid>]][:toaddr=<address>[/<mask>]]Remove the IPv4 forward port [P] [Z] [O]--query-forward-port=port=<portid>[-<portid>]:proto=<protocol>[:toport=<portid>[-<portid>]][:toaddr=<address>[/<mask>]]Return whether the IPv4 forward port has been added [P] [Z] [O]--add-masquerade     Enable IPv4 masquerade [P] [Z] [O] [T]--remove-masquerade  Disable IPv4 masquerade [P] [Z] [O]--query-masquerade   Return whether IPv4 masquerading has been enabled [P] [Z] [O]--list-rich-rules    List rich language rules added [P] [Z] [O]--add-rich-rule=<rule>Add rich language rule 'rule' [P] [Z] [O] [T]--remove-rich-rule=<rule>Remove rich language rule 'rule' [P] [Z] [O]--query-rich-rule=<rule>Return whether a rich language rule 'rule' has beenadded [P] [Z] [O]Options to Adapt and Query Zones--add-icmp-block-inversionEnable inversion of icmp blocks for a zone [P] [Z]--remove-icmp-block-inversionDisable inversion of icmp blocks for a zone [P] [Z]--query-icmp-block-inversionReturn whether inversion of icmp blocks has been enabledfor a zone [P] [Z]--add-forward        Enable forwarding of packets between interfaces andsources in a zone [P] [Z] [T]--remove-forward     Disable forwarding of packets between interfaces andsources in a zone [P] [Z]--query-forward      Return whether forwarding of packets between interfacesand sources has been enabled for a zone [P] [Z]Options to Adapt and Query Policies--get-priority       Get the priority [P only] [O]--set-priority=<priority>Set the priority [P only] [O]--list-ingress-zonesList ingress zones that are bound to a policy [P] [O]--add-ingress-zone=<zone>Add the ingress zone to a policy [P] [O]--remove-ingress-zone=<zone>Remove the ingress zone from a policy [P] [O]--query-ingress-zone=<zone>Query whether the ingress zone has been adedd to apolicy [P] [O]--list-egress-zonesList egress zones that are bound to a policy [P] [O]--add-egress-zone=<zone>Add the egress zone to a policy [P] [O]--remove-egress-zone=<zone>Remove the egress zone from a policy [P] [O]--query-egress-zone=<zone>Query whether the egress zone has been adedd to apolicy [P] [O]Options to Handle Bindings of Interfaces--list-interfaces    List interfaces that are bound to a zone [P] [Z]--add-interface=<interface>Bind the <interface> to a zone [P] [Z]--change-interface=<interface>Change zone the <interface> is bound to [P] [Z]--query-interface=<interface>Query whether <interface> is bound to a zone [P] [Z]--remove-interface=<interface>Remove binding of <interface> from a zone [P] [Z]Options to Handle Bindings of Sources--list-sources       List sources that are bound to a zone [P] [Z]--add-source=<source>[/<mask>]|<MAC>|ipset:<ipset>Bind the source to a zone [P] [Z]--change-source=<source>[/<mask>]|<MAC>|ipset:<ipset>Change zone the source is bound to [Z]--query-source=<source>[/<mask>]|<MAC>|ipset:<ipset>Query whether the source is bound to a zone [P] [Z]--remove-source=<source>[/<mask>]|<MAC>|ipset:<ipset>Remove binding of the source from a zone [P] [Z]Helper Options--new-helper=<helper> --module=<module> [--family=<family>]Add a new helper [P only]--new-helper-from-file=<filename> [--name=<helper>]Add a new helper from file with optional name [P only]--delete-helper=<helper>Delete an existing helper [P only]--load-helper-defaults=<helper>Load helper default settings [P only]--info-helper=<helper> Print information about an helper--path-helper=<helper> Print file path of an helper [P only]--get-helpers         Print predefined helpers--helper=<helper> --set-description=<description>Set new description to helper [P only]--helper=<helper> --get-descriptionPrint description for helper [P only]--helper=<helper> --set-short=<description>Set new short description to helper [P only]--helper=<helper> --get-shortPrint short description for helper [P only]--helper=<helper> --add-port=<portid>[-<portid>]/<protocol>Add a new port to helper [P only]--helper=<helper> --remove-port=<portid>[-<portid>]/<protocol>Remove a port from helper [P only]--helper=<helper> --query-port=<portid>[-<portid>]/<protocol>Return whether the port has been added for helper [P only]--helper=<helper> --get-portsList ports of helper [P only]--helper=<helper> --set-module=<module>Set module to helper [P only]--helper=<helper> --get-moduleGet module from helper [P only]--helper=<helper> --set-family={ipv4|ipv6|}Set family for helper [P only]--helper=<helper> --get-familyGet module from helper [P only]Direct Options--direct             First option for all direct options--get-all-chainsGet all chains [P]--get-chains {ipv4|ipv6|eb} <table>Get all chains added to the table [P]--add-chain {ipv4|ipv6|eb} <table> <chain>Add a new chain to the table [P]--remove-chain {ipv4|ipv6|eb} <table> <chain>Remove the chain from the table [P]--query-chain {ipv4|ipv6|eb} <table> <chain>Return whether the chain has been added to the table [P]--get-all-rulesGet all rules [P]--get-rules {ipv4|ipv6|eb} <table> <chain>Get all rules added to chain in table [P]--add-rule {ipv4|ipv6|eb} <table> <chain> <priority> <arg>...Add rule to chain in table [P]--remove-rule {ipv4|ipv6|eb} <table> <chain> <priority> <arg>...Remove rule with priority from chain in table [P]--remove-rules {ipv4|ipv6|eb} <table> <chain>Remove rules from chain in table [P]--query-rule {ipv4|ipv6|eb} <table> <chain> <priority> <arg>...Return whether a rule with priority has been added tochain in table [P]--passthrough {ipv4|ipv6|eb} <arg>...Pass a command through (untracked by firewalld)--get-all-passthroughsGet all tracked passthrough rules [P]--get-passthroughs {ipv4|ipv6|eb} <arg>...Get tracked passthrough rules [P]--add-passthrough {ipv4|ipv6|eb} <arg>...Add a new tracked passthrough rule [P]--remove-passthrough {ipv4|ipv6|eb} <arg>...Remove a tracked passthrough rule [P]--query-passthrough {ipv4|ipv6|eb} <arg>...Return whether the tracked passthrough rule has beenadded [P]Lockdown Options--lockdown-on        Enable lockdown.--lockdown-off       Disable lockdown.--query-lockdown     Query whether lockdown is enabledLockdown Whitelist Options--list-lockdown-whitelist-commandsList all command lines that are on the whitelist [P]--add-lockdown-whitelist-command=<command>Add the command to the whitelist [P]--remove-lockdown-whitelist-command=<command>Remove the command from the whitelist [P]--query-lockdown-whitelist-command=<command>Query whether the command is on the whitelist [P]--list-lockdown-whitelist-contextsList all contexts that are on the whitelist [P]--add-lockdown-whitelist-context=<context>Add the context context to the whitelist [P]--remove-lockdown-whitelist-context=<context>Remove the context from the whitelist [P]--query-lockdown-whitelist-context=<context>Query whether the context is on the whitelist [P]--list-lockdown-whitelist-uidsList all user ids that are on the whitelist [P]--add-lockdown-whitelist-uid=<uid>Add the user id uid to the whitelist [P]--remove-lockdown-whitelist-uid=<uid>Remove the user id uid from the whitelist [P]--query-lockdown-whitelist-uid=<uid>Query whether the user id uid is on the whitelist [P]--list-lockdown-whitelist-usersList all user names that are on the whitelist [P]--add-lockdown-whitelist-user=<user>Add the user name user to the whitelist [P]--remove-lockdown-whitelist-user=<user>Remove the user name user from the whitelist [P]--query-lockdown-whitelist-user=<user>Query whether the user name user is on the whitelist [P]Panic Options--panic-on           Enable panic mode--panic-off          Disable panic mode--query-panic        Query whether panic mode is enabled

Firewalld 使用区域(Zone)的概念来划分与系统交互的流量。网络接口被分配给一个或多个区域,每个区域包含允许的端口和服务列表。默认区域也可用于管理与任何区域都不匹配的流量。

如果配置了服务,则守护进程的启用,启停、重启和查看命令如下:

sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo systemctl stop firewalld
sudo systemctl restart firewalld
sudo systemctl status firewalld

如果没配置服务,也可以用以下的命令查看状态:

sudo firewall-cmd --state

查看区域和默认区域:

$ sudo firewall-cmd --get-zones
block dmz drop external home internal nm-shared public trusted work$ sudo firewall-cmd --get-default-zone
public

在以下做出改变之前,先保存下当前状态:

$ sudo firewall-cmd --list-all
public (active)target: defaulticmp-block-inversion: nointerfaces: eth0sources:services: cockpit dhcpv6-client sshports:protocols:forward: yesmasquerade: noforward-ports:source-ports:icmp-blocks:rich rules:

允许端口,例如postgresql的5432端口:

# 临时添加
sudo firewall-cmd --add-port=5432/tcp
# 永久添加
sudo firewall-cmd --add-port=5432/tcp --permanent
# 使改变生效
sudo firewall-cmd --reload

确认生效:

$ sudo firewall-cmd --list-ports
5432/tcp

删除刚添加的端口:

sudo firewall-cmd --remove-port=5432/tcp --permanent
# 此时执行sudo firewall-cmd --list-ports,输出为5432/tcp
sudo firewall-cmd --reload
# 此时执行sudo firewall-cmd --list-ports,输出为空

如果系统定义了服务,则可以添加服务,其实和加端口意思一样:

$ grep postgres /etc/services
postgres        5432/tcp        postgresql      # POSTGRES
postgres        5432/udp        postgresql      # POSTGRES$ sudo firewall-cmd --list-services
cockpit dhcpv6-client ssh$ sudo firewall-cmd --add-service postgresql
success$ sudo firewall-cmd --list-services
cockpit dhcpv6-client postgresql ssh

以上端口和服务都是限制目标的,也可以限制源:

$ sudo firewall-cmd --zone=internal --add-source=172.16.1.0/24 --permanent

最后,推荐两个命令速查表:

  • Advanced Linux commands cheat sheet
  • Advanced Linux Commands Cheat Sheet

相关文章:

Linux firewalld 常用命令

本文参考RedHat官网文章How to configure a firewall on Linux with firewalld。 Firewalld 是守护进程名&#xff0c;对应命令为firewall-cmd。帮助详见以下命令&#xff1a; $ firewall-cmd --helpUsage: firewall-cmd [OPTIONS...]General Options-h, --help Pr…...

LeetCode 热题 100 49. 字母异位词分组

LeetCode 热题 100 | 49. 字母异位词分组 大家好&#xff0c;今天我们来解决一道经典的算法题——字母异位词分组。这道题在LeetCode上被标记为中等难度&#xff0c;要求我们将字母异位词组合在一起。下面我将详细讲解解题思路&#xff0c;并附上Python代码实现。 问题描述 给…...

从 DeepSeek 到飞算 JavaAI:AI 开发工具如何重塑技术生态?

在科技飞速发展的当下&#xff0c;AI 开发工具正以前所未有的态势重塑技术生态。从备受瞩目的 DeepSeek 到崭露头角的飞算 JavaAI&#xff0c;它们在不同维度上推动着软件开发领域的变革&#xff0c;深刻影响着开发者的工作方式与行业发展走向。 DeepSeek&#xff1a;AI 开发领…...

OceanBase 初探学习历程之二——操作系统参数最佳实践

本文章分享OB操作系统参数最佳实践值&#xff0c;相关参数部分来自PK项目得知&#xff0c;仅供参考&#xff0c;实际参数设置仍需结合现有设备条件及业务系统特点是否有必要如此设置&#xff0c;但我任务大部分场景均可用&#xff08;仅本人个人观点&#xff09;。 1、磁盘配置…...

全面指南:使用JMeter进行性能压测与性能优化(中间件压测、数据库压测、分布式集群压测、调优)

目录 一、性能测试的指标 1、并发量 2、响应时间 3、错误率 4、吞吐量 5、资源使用率 二、压测全流程 三、其他注意点 1、并发和吞吐量的关系 2、并发和线程的关系 四、调优及分布式集群压测&#xff08;待仔细学习&#xff09; 1.线程数量超过单机承载能力时的解决…...

《机器学习实战》专栏 No12:项目实战—端到端的机器学习项目Kaggle糖尿病预测

《机器学习实战》专栏 第12集&#xff1a;项目实战——端到端的机器学习项目Kaggle糖尿病预测 本集为专栏最后一集&#xff0c;本专栏的特点是短平快&#xff0c;聚焦重点&#xff0c;不长篇大论纠缠于理论&#xff0c;而是在介绍基础理论框架基础上&#xff0c;快速切入实战项…...

【vue项目中如何实现一段文字跑马灯效果】

在Vue项目中实现一段文字跑马灯效果&#xff0c;可以通过多种方式实现&#xff0c;以下是几种常见的方法&#xff1a; 方法一&#xff1a;使用CSS动画和Vue数据绑定 这种方法通过CSS动画实现文字的滚动效果&#xff0c;并结合Vue的数据绑定动态更新文本内容。 步骤&#xff…...

DeepSeek 细节之 MLA (Multi-head Latent Attention)

DeepSeek 系统模型的基本架构仍然基于Transformer框架&#xff0c;为了实现高效推理和经济高效的训练&#xff0c;DeepSeek 还采用了MLA&#xff08;多头潜在注意力)。 MHA&#xff08;多头注意力&#xff09;通过多个注意力头并行工作捕捉序列特征&#xff0c;但面临高计算成本…...

Python爬虫具体是如何解析商品信息的?

在使用Python爬虫解析亚马逊商品信息时&#xff0c;通常会结合requests库和BeautifulSoup库来实现。requests用于发送HTTP请求并获取网页内容&#xff0c;而BeautifulSoup则用于解析HTML页面并提取所需数据。以下是具体的解析过程&#xff0c;以按关键字搜索亚马逊商品为例。 …...

lerobot调试记录

这里写自定义目录标题 libtiff.so undefined symbol libtiff.so undefined symbol anaconda3/envs/lerobot3/lib/python3.10/site-packages/../.././libtiff.so.6: undefined symbol: jpeg12_write_raw_data, version LIBJPEG_8.01.安装库 conda install -c conda-forge jpeg …...

【Word转PDF】在线Doc/Docx转换为PDF格式 免费在线转换 功能强大好用

在日常办公和学习中&#xff0c;将Word文档转换为PDF格式的需求非常普遍。无论是制作简历、撰写报告还是分享文件&#xff0c;都需要确保文档格式在不同设备上保持一致。而小白工具的“Word转PDF”功能正是为此需求量身打造的一款高效解决方案。 【Word转PDF】在线Doc/Docx转换…...

Jenkins 配置 Credentials 凭证

Jenkins 配置 Credentials 凭证 一、创建凭证 Dashboard -> Manage Jenkins -> Manage Credentials 在 Domain 列随便点击一个 (global) 二、添加 凭证 点击左侧 Add Credentials 四、填写凭证 Kind&#xff1a;凭证类型 Username with password&#xff1a; 配置 用…...

Datawhale Ollama教程笔记5

Dify 接入 Ollama 部署的本地模型 Dify 支持接入 Ollama 部署的大型语言模型推理和 embedding 能力。 快速接入 下载 Ollama 访问 Ollama 安装与配置&#xff0c;查看 Ollama 本地部署教程。 运行 Ollama 并与 Llama 聊天 ollama run llama3.1Copy to clipboardErrorCopied …...

小爱音箱连接电脑外放之后,浏览器网页视频暂停播放后,音箱整体没声音问题解决

背景 22年买的小爱音箱增强版play&#xff0c;小爱音箱连接电脑外放之后&#xff0c;浏览器网页视频暂停播放后&#xff0c;音箱整体没声音&#xff08;一边打着游戏&#xff0c;一边听歌&#xff0c;一边放视频&#xff0c;视频一暂停&#xff0c;什么声音都没了&#xff0c;…...

go设置镜像代理

前言 在 Go 开发中&#xff0c;如果直接从官方源&#xff08;https://proxy.golang.org&#xff09;下载依赖包速度较慢&#xff0c;可以通过设置 镜像代理 来加速依赖包的下载。以下是增加 Go 镜像代理的详细方法&#xff1a; 一、设置 Go 镜像代理 1. 使用环境变量设置代理…...

Python爬虫系列教程之第十二篇:爬虫异常处理与日志记录

大家好&#xff0c;欢迎继续关注本系列爬虫教程&#xff01;在实际的爬虫项目中&#xff0c;网络请求可能会因为各种原因失败&#xff0c;如连接超时、目标服务器拒绝访问、解析错误等。此外&#xff0c;大规模爬虫任务运行过程中&#xff0c;各种异常情况层出不穷&#xff0c;…...

将Google文档导入WordPress:简单实用的几种方法

Google文档是内容创作者非常实用的写作工具。它支持在线编辑、多人协作&#xff0c;并能够自动保存内容。但当我们想把Google文档中的内容导入WordPress网站时&#xff0c;可能会遇到一些小麻烦&#xff0c;比如格式错乱、图片丢失等问题。本文将为大家介绍几种简单实用的方法&…...

大白话实战Gateway

网关功能 网关在分布式系统中起了什么作用?参考下图: 前端想要访问业务访问,就需要知道各个访问的地址,而业务集群服务有很多,前端需要记录非常多的服务器地址,这种情况下,我们需要对整个业务集群做一个整体屏蔽,这个时候就引入Gateway网关,它就是所有服务的请求入…...

深入学习解析:183页可编辑PPT华为市场营销MPR+LTC流程规划方案

华为终端正面临销售模式转型的关键时刻&#xff0c;旨在通过构建MPRLTC项目&#xff0c;以规避对运营商定制的过度依赖&#xff0c;并探索新的增长路径。项目核心在于建设一套全新的销售流程与IT系统&#xff0c;支撑双品牌及自有品牌的战略发展。 项目总体方案聚焦于四大关键议…...

【微中子代理踩坑-前端node-sass安装失败】

微中子代理踩坑-前端node-sass安装失败-windows 1.npm版本2.python2.73.安装Visual Studio 1.npm版本 当前使用node版本13.12.0 2.python2.7 安装python2.7.9并配置环境变量 3.安装Visual Studio 安装Visual Studio 我是直接勾选了3个windows的sdk,然后就好了 最后 npm in…...

Docker 运行 Kafka 带 SASL 认证教程

Docker 运行 Kafka 带 SASL 认证教程 Docker 运行 Kafka 带 SASL 认证教程一、说明二、环境准备三、编写 Docker Compose 和 jaas文件docker-compose.yml代码说明&#xff1a;server_jaas.conf 四、启动服务五、验证服务六、连接kafka服务七、总结 Docker 运行 Kafka 带 SASL 认…...

MySQL 8.0 OCP 英文题库解析(十三)

Oracle 为庆祝 MySQL 30 周年&#xff0c;截止到 2025.07.31 之前。所有人均可以免费考取原价245美元的MySQL OCP 认证。 从今天开始&#xff0c;将英文题库免费公布出来&#xff0c;并进行解析&#xff0c;帮助大家在一个月之内轻松通过OCP认证。 本期公布试题111~120 试题1…...

工业自动化时代的精准装配革新:迁移科技3D视觉系统如何重塑机器人定位装配

AI3D视觉的工业赋能者 迁移科技成立于2017年&#xff0c;作为行业领先的3D工业相机及视觉系统供应商&#xff0c;累计完成数亿元融资。其核心技术覆盖硬件设计、算法优化及软件集成&#xff0c;通过稳定、易用、高回报的AI3D视觉系统&#xff0c;为汽车、新能源、金属制造等行…...

[Java恶补day16] 238.除自身以外数组的乘积

给你一个整数数组 nums&#xff0c;返回 数组 answer &#xff0c;其中 answer[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积 。 题目数据 保证 数组 nums之中任意元素的全部前缀元素和后缀的乘积都在 32 位 整数范围内。 请 不要使用除法&#xff0c;且在 O(n) 时间复杂度…...

算法笔记2

1.字符串拼接最好用StringBuilder&#xff0c;不用String 2.创建List<>类型的数组并创建内存 List arr[] new ArrayList[26]; Arrays.setAll(arr, i -> new ArrayList<>()); 3.去掉首尾空格...

(一)单例模式

一、前言 单例模式属于六大创建型模式,即在软件设计过程中,主要关注创建对象的结果,并不关心创建对象的过程及细节。创建型设计模式将类对象的实例化过程进行抽象化接口设计,从而隐藏了类对象的实例是如何被创建的,封装了软件系统使用的具体对象类型。 六大创建型模式包括…...

WebRTC从入门到实践 - 零基础教程

WebRTC从入门到实践 - 零基础教程 目录 WebRTC简介 基础概念 工作原理 开发环境搭建 基础实践 三个实战案例 常见问题解答 1. WebRTC简介 1.1 什么是WebRTC&#xff1f; WebRTC&#xff08;Web Real-Time Communication&#xff09;是一个支持网页浏览器进行实时语音…...

Linux系统部署KES

1、安装准备 1.版本说明V008R006C009B0014 V008&#xff1a;是version产品的大版本。 R006&#xff1a;是release产品特性版本。 C009&#xff1a;是通用版 B0014&#xff1a;是build开发过程中的构建版本2.硬件要求 #安全版和企业版 内存&#xff1a;1GB 以上 硬盘&#xf…...

API网关Kong的鉴权与限流:高并发场景下的核心实践

&#x1f525;「炎码工坊」技术弹药已装填&#xff01; 点击关注 → 解锁工业级干货【工具实测|项目避坑|源码燃烧指南】 引言 在微服务架构中&#xff0c;API网关承担着流量调度、安全防护和协议转换的核心职责。作为云原生时代的代表性网关&#xff0c;Kong凭借其插件化架构…...

如何配置一个sql server使得其它用户可以通过excel odbc获取数据

要让其他用户通过 Excel 使用 ODBC 连接到 SQL Server 获取数据&#xff0c;你需要完成以下配置步骤&#xff1a; ✅ 一、在 SQL Server 端配置&#xff08;服务器设置&#xff09; 1. 启用 TCP/IP 协议 打开 “SQL Server 配置管理器”。导航到&#xff1a;SQL Server 网络配…...