SpringBoot整合Redis,基于Jedis实现redis各种操作

前言(三步教你学会redis,主打一个实用)

springboot整合redis步骤,并基于jedis对redis数据库进行相关操作,最后分享非常好用、功能非常全的redis工具类。

第一步:导入maven依赖

<!--	springboot整合redis	-->
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId>
</dependency><dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId>
</dependency>

说明:第一个是引入springboot整合redis的依赖,通常引入这个依赖已经可以用redis了,但是不方便。所以引入jedis依赖用于方便操作redis。

第二步:写配置文件

# jedis 手动配置
redis:host: 100.111.111.11port: 6379auth: 123456timeOut: 3000

说明:正常配置是在spring.redis.xxx,咱们是用jedis操作,所以写自己的配置路径。

第三步:代码实现

首先我们先写个配置类,用于获取jedis实例:

package com.zlp.cps.config;import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;@Component
public class MyJedisPoolConfig {private MyJedisPoolConfig() {}//redis主机的ipprivate static String host;//redis主机的端口号private static int port;//登录口令private static String auth;/*** 连接超时和读写超时(单位ms)* 读写超时即:redis对该命令执行时间太长,超过设定时间后就放弃本次请求*/private static int connAndReadWriteTimeOut;/*** 通过非静态的setter来给静态的属性赋值** @param redisHost*/@Value("${redis.host}")public void setRedisHost(String redisHost) {MyJedisPoolConfig.host = redisHost;}@Value("${redis.port}")public void setRedisPort(int redisPort) {MyJedisPoolConfig.port = redisPort;}@Value("${redis.auth}")public void setAuth(String redisAuth) {MyJedisPoolConfig.auth = redisAuth;}@Value("${redis.timeOut}")public void setAuth(int timeOut) {MyJedisPoolConfig.connAndReadWriteTimeOut = timeOut;}private static class innerClass {//静态内部类保存一个jedisPool的实例private static JedisPool jedisPool = new JedisPool(getConfig(), host, port, connAndReadWriteTimeOut, auth);private static JedisPoolConfig getConfig() {JedisPoolConfig poolConfig = new JedisPoolConfig();//========= jedisPool的一些配置=============================poolConfig.setMaxTotal(10000);//最大连接数poolConfig.setMaxIdle(50);//最多空闲数poolConfig.setMaxWaitMillis(5 * 1000);//当池中没有连接时,最多等待5秒return poolConfig;}}/*** 返回jedisPool实例** @return*/public static JedisPool getJedisPool() {return innerClass.jedisPool;}}

获取到jedis实例后就可以做相关操作了,下面是通用的工具类:

package com.zlp.cps.util;import com.zlp.cps.config.MyJedisPoolConfig;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Pipeline;import java.util.List;
import java.util.Map;
import java.util.Set;/*** 基于jedis整合redis工具类** @author zlp* @date 2023/9/13**/
public final class RedisUtils {/*除了该工具类提供的方法外,还可以在外面调用getJedis()方法,获取到jedis实例后,调用它原生的api来操作*//*** 获取jedis对象,并选择redis库。jedis默认是0号库,可传入1-16之间的数选择库存放数据* 原则上使用一个redis库存放数据,通过特定的key的命令规则来区分不同的数据就行了。** @param index redis库号。使用可变参数的目的就是该参数可传可不传。* @return 返回jedis对象*/public static Jedis getJedis(int... index) {Jedis jedis = MyJedisPoolConfig.getJedisPool().getResource();if (index != null && index.length > 0) {if (index[0] > 0 && index[0] <= 16){jedis.select(index[0]);}}return jedis;}/*########################  key的操作  ################################*//*** 根据pattern返回当前库中的key** @param pattern* @return*/public static Set<String> keys(String pattern) {Jedis jedis = null;Set<String> keys = null;try {jedis = getJedis();keys = jedis.keys(pattern);}finally {if (jedis != null){jedis.close();}}return keys;}/*** 删除一个或多个key** @param key 一个或多个key*/public static Long del(String... key) {Jedis jedis = null;Long delNum = 0L;try {jedis = getJedis();delNum =jedis.del(key);}finally {if (jedis != null){jedis.close();}}return delNum;}/*** 批量删除* @param keyList 要删除的key的集合*/public static void mdel(List<String> keyList){Jedis jedis = getJedis();//获取pipelinePipeline pipeline = jedis.pipelined();for (String key : keyList) {pipeline.del(key);}//执行结果同步,这样才能保证结果的正确性。实际上不执行该方法也执行了上面的命令,但是结果确不一定完全正确。//注意pipeline.sync();//关闭连接jedis.close();}/*** 判断某个key是否还存在** @param key key* @return*/public static Boolean exists(String key) {Jedis jedis = null;Boolean flag = false;try {jedis = getJedis();flag = jedis.exists(key);}finally {if (jedis != null){jedis.close();}}return flag;}/*** 设置某个key的过期时间,单位秒** @param key key* @param seconds 过期时间秒*/public static void expire(String key, int seconds) {Jedis jedis = null;try {jedis = getJedis();jedis.expire(key, seconds);}finally {if (jedis != null){jedis.close();}}}/*** 查看某个key还有几秒过期,-1表示永不过期 ,-2表示已过期** @param key key* @return*/public static Long timeToLive(String key) {Jedis jedis = null;Long ttl;try {jedis = getJedis();ttl = jedis.ttl(key);}finally {if (jedis != null){jedis.close();}}return ttl;}/*** 查看某个key对应的value的类型** @param key* @return*/public static String type(String key) {Jedis jedis = null;String type = null;try {jedis = getJedis();type = jedis.type(key);}finally {if (jedis != null){jedis.close();}}return type;}/*########################  string(字符串)的操作  ####################*//*** 获取某个key的value,类型要对,只能value是string的才能获取** @param key* @return*/public static String get(String key) {Jedis jedis = null;String value = null;try {jedis = getJedis();value = jedis.get(key);}finally {if (jedis != null){jedis.close();}}return value;}/*** 设置某个key的value** @param key* @param value*/public static void set(String key, String value) {Jedis jedis = null;try {jedis = getJedis();jedis.set(key, value);}finally {if (jedis != null){jedis.close();}}}/*** 字符串后追加内容** @param key key* @param appendContent 要追加的内容*/public static void append(String key, String appendContent) {Jedis jedis = null;try {jedis = getJedis();jedis.append(key, appendContent);}finally {if (jedis != null){jedis.close();}}}/*** 返回key的value的长度** @param key* @return*/public static Long strlen(String key) {Jedis jedis = null;Long strLen = 0L;try {jedis = getJedis();strLen = jedis.strlen(key);}finally {if (jedis != null){jedis.close();}}return strLen;}/*** value 加1 必* 须是字符型数字* @param key* @return 增加后的值*/public static Long incr(String key) {Jedis jedis = null;Long incrResult = 0L;try {jedis = getJedis();incrResult = jedis.incr(key);}finally {if (jedis != null){jedis.close();}}return incrResult;}/*** value 减1   必须是字符型数字** @param key* @return*/public static Long decr(String key) {Jedis jedis = null;Long decrResult = 0L;try {jedis = getJedis();decrResult = jedis.decr(key);}finally {if (jedis != null){jedis.close();}}return decrResult;}/*** value 加increment** @param key key* @param increment 加几* @return*/public static Long incrby(String key, int increment) {Jedis jedis = null;Long incrByResult = 0L;try {jedis = getJedis();incrByResult = jedis.incrBy(key, increment);}finally {if (jedis != null){jedis.close();}}return incrByResult;}/*** value 减increment** @param key* @param increment* @return*/public static Long decrby(String key, int increment) {Jedis jedis = null;Long decrByResult = 0L;try {jedis = getJedis();decrByResult = jedis.decrBy(key, increment);}finally {if (jedis != null){jedis.close();}}return decrByResult;}/*** 给某个key设置过期时间和value,成功返回OK** @param key key* @param seconds 过期时间秒* @param value 设置的值* @return*/public static String setex(String key, int seconds, String value) {Jedis jedis = null;String result = null;try {jedis = getJedis();result = jedis.setex(key, seconds, value);}finally {if (jedis != null){jedis.close();}}return result;}/*########################  list(列表)的操作  #######################*///lpush rpush lpop rpop lrange lindex llen lset/*** 从左边向列表中添加值** @param key key* @param str 要添加的值*/public static void lpush(String key, String str) {Jedis jedis = null;try {jedis = getJedis();jedis.lpush(key, str);}finally {if (jedis != null){jedis.close();}}}/*** 从右边向列表中添加值** @param key key* @param str 要添加的值*/public static void rpush(String key, String str) {Jedis jedis = null;try {jedis = getJedis();jedis.rpush(key, str);}finally {if (jedis != null){jedis.close();}}}/*** 从左边取出一个列表中的值** @param key* @return*/public static String lpop(String key) {Jedis jedis = null;String lpop = null;try {jedis = getJedis();lpop = jedis.lpop(key);}finally {if (jedis != null){jedis.close();}}return lpop;}/*** 从右边取出一个列表中的值** @param key* @return*/public static String rpop(String key) {Jedis jedis = null;String rpop = null;try {jedis = getJedis();rpop = jedis.rpop(key);}finally {if (jedis != null){jedis.close();}}return rpop;}/*** 取出列表中指定范围内的值,0 到 -1 表示全部** @param key* @param startIndex* @param endIndex* @return*/public static List<String> lrange(String key, int startIndex, int endIndex) {Jedis jedis = null;List<String> result = null;try {jedis = getJedis();result = jedis.lrange(key, startIndex, endIndex);}finally {if (jedis != null){jedis.close();}}return result;}/*** 返回某列表指定索引位置的值** @param key 列表key* @param index 索引位置* @return*/public static String lindex(String key, int index) {Jedis jedis = null;String lindex = null;try {jedis = getJedis();lindex = jedis.lindex(key, index);}finally {if (jedis != null){jedis.close();}}return lindex;}/*** 返回某列表的长度** @param key* @return*/public static Long llen(String key) {Jedis jedis = null;Long llen = 0L;try {jedis = getJedis();llen = jedis.llen(key);}finally {if (jedis != null){jedis.close();}}return llen;}/*** 给某列表指定位置设置为指定的值** @param key* @param index* @param str*/public static void lset(String key, Long index, String str) {Jedis jedis = null;try {jedis = getJedis();jedis.lset(key, index, str);}finally {if (jedis != null){jedis.close();}}}/*** 对列表进行剪裁,保留指定闭区间的元素(索引位置也会重排)* @param key 列表key* @param startIndex 开始索引位置* @param endIndex 结束索引位置*/public static void ltrim(String key,Integer startIndex,Integer endIndex){Jedis jedis = null;try {jedis = getJedis();jedis.ltrim(key, startIndex, endIndex);}finally {if (jedis != null){jedis.close();}}}/*** 从列表的左边阻塞弹出一个元素* @param key 列表的key* @param timeout 阻塞超时时间,0表示若没有元素就永久阻塞* @return*/public static List<String> blpop(String key,Integer timeout){Jedis jedis = null;List<String> valueList = null;try {jedis = getJedis();valueList = jedis.blpop(timeout, key);}finally {if (jedis != null){jedis.close();}}return valueList;}/*** 从列表的右边阻塞弹出一个元素* @param key 列表的key* @param timeout 阻塞超时时间,0表示若没有元素就永久阻塞* @return*/public static List<String> brpop(String key,Integer timeout){Jedis jedis = null;List<String> valueList = null;try {jedis = getJedis();valueList = jedis.brpop(timeout, key);}finally {if (jedis != null){jedis.close();}}return valueList;}/*########################  hash(哈希表)的操作  #######################*///hset hget hmset hmget hgetall hdel hkeys hvals hexists hincrby/*** 给某个hash表设置一个键值对** @param key* @param field* @param value*/public static void hset(String key, String field, String value) {Jedis jedis = null;try {jedis = getJedis();jedis.hset(key, field, value);}finally {if (jedis != null){jedis.close();}}}/*** 取出某个hash表中某个field对应的value** @param key key* @param field field* @return*/public static String hget(String key, String field) {Jedis jedis = null;String hget = null;try {jedis = getJedis();hget = jedis.hget(key, field);}finally {if (jedis != null){jedis.close();}}return hget;}/*** 某个hash表设置一个或多个键值对** @param key* @param kvMap*/public static void hmset(String key, Map<String, String> kvMap) {Jedis jedis = null;try {jedis = getJedis();jedis.hmset(key, kvMap);}finally {if (jedis != null){jedis.close();}}}/*** 取出某个hash表中任意多个key对应的value的集合** @param key* @param fields* @return*/public static List<String> hmget(String key, String... fields) {Jedis jedis = null;List<String> hmget = null;try {jedis = getJedis();hmget = jedis.hmget(key, fields);}finally {if (jedis != null){jedis.close();}}return hmget;}/*** 取出某个hash表中所有的键值对** @param key* @return*/public static Map<String, String> hgetall(String key) {Jedis jedis = null;Map<String, String> kvMap = null;try {jedis = getJedis();kvMap = jedis.hgetAll(key);}finally {if (jedis != null){jedis.close();}}return kvMap;}/*** 判断某个hash表中的某个key是否存在** @param key* @param field* @return*/public static Boolean hexists(String key, String field) {Jedis jedis = null;Boolean exists = null;try {jedis = getJedis();exists = jedis.hexists(key, field);}finally {if (jedis != null){jedis.close();}}return exists;}/*** 返回某个hash表中所有的key** @param key* @return*/public static Set<String> hkeys(String key) {Jedis jedis = null;Set<String> keys = null;try {jedis = getJedis();keys = jedis.hkeys(key);}finally {if (jedis != null){jedis.close();}}return keys;}/*** 返回某个hash表中所有的value** @param key* @return*/public static List<String> hvals(String key) {Jedis jedis = null;List<String> hvals = null;try {jedis = getJedis();hvals = jedis.hvals(key);}finally {if (jedis != null){jedis.close();}}return hvals;}/*** 删除某个hash表中的一个或多个键值对** @param key* @param fields*/public static void hdel(String key, String... fields) {Jedis jedis = null;try {jedis = getJedis();jedis.hdel(key, fields);}finally {if (jedis != null){jedis.close();}}}/*** 给某个hash表中的某个field的value增加多少** @param key       hash表的key* @param field     表中的某个field* @param increment 增加多少* @return*/public static Long hincrby(String key, String field, Long increment) {Jedis jedis = null;Long result = null;try {jedis = getJedis();result = jedis.hincrBy(key, field, increment);}finally {if (jedis != null){jedis.close();}}return result;}/*########################  set(集合)的操作  ###########################*//*** 往set集合中添加一个或多个元素* @param key key* @param members 要添加的元素* @return 添加成功的元素个数*/public static Long sadd(String key,String... members){Jedis jedis = null;Long num = 0L;try {jedis = getJedis();num = jedis.sadd(key, members);}finally {if (jedis != null){jedis.close();}}return num;}/*** 返回set集合中的所有元素,顺序与加入时的顺序一致* @param key key* @return*/public static Set<String> smembers(String key){Jedis jedis = null;Set<String> members = null;try {jedis = getJedis();members = jedis.smembers(key);}finally {if (jedis != null){jedis.close();}}return members;}/*** 判断集合中是否存在某个元素* @param key key* @param member 某个元素* @return true存在,false不存在*/public static Boolean sismember(String key,String member){Jedis jedis = null;Boolean isMember = false;try {jedis = getJedis();isMember = jedis.sismember(key, member);}finally {if (jedis != null){jedis.close();}}return isMember;}/*** 返回set集合的长度* @param key key* @return*/public static Long scard(String key){Jedis jedis = null;Long len = 0L;try {jedis = getJedis();len = jedis.scard(key);}finally {if (jedis != null){jedis.close();}}return len;}/*** 删除set集合中指定的一个或多个元素* @param key* @param members 要删除的元素* @return 删除成功的元素个数*/public static Long srem(String key,String... members){Jedis jedis = null;Long num = 0L;try {jedis = getJedis();num = jedis.srem(key,members);}finally {if (jedis != null){jedis.close();}}return num;}/*** 将key1中的元素key1Member移动到key2中* @param key1 来源集合key* @param key2 目的地集合key* @param key1Member key1中的元素* @return 1成功,0失败*/public static Long smove(String key1,String key2,String key1Member){Jedis jedis = null;Long num = 0L;try {jedis = getJedis();num = jedis.smove(key1,key2,key1Member);}finally {if (jedis != null){jedis.close();}}return num;}/*** 随机查询返回集合中的指定个数的元素(若count为负数,返回的元素可能会重复)* @param key key* @param count 要查询返回的元素个数* @return 元素list集合*/public static List<String> srandmember(String key,int count){Jedis jedis = null;List<String> members = null;try {jedis = getJedis();members = jedis.srandmember(key,count);}finally {if (jedis != null){jedis.close();}}return members;}/*** 从set集合中随机弹出指定个数个元素* @param key key* @param count 要弹出的个数* @return 随机弹出的元素*/public static Set<String> spop(String key,int count){Jedis jedis = null;Set<String> members = null;try {jedis = getJedis();members = jedis.spop(key,count);}finally {if (jedis != null){jedis.close();}}return members;}/*** 求交集,返回多个set集合相交的部分* @param setKeys 多个set集合的key* @return 相交的元素集合*/public static Set<String> sinter(String... setKeys){Jedis jedis = null;Set<String> members = null;try {jedis = getJedis();members = jedis.sinter(setKeys);}finally {if (jedis != null){jedis.close();}}return members;}/*** 求并集,求几个set集合的并集(因为set中不会有重复的元素,合并后的集合也不会有重复的元素)* @param setKeys 多个set的key* @return 合并后的集合*/public static Set<String> sunion(String... setKeys){Jedis jedis = null;Set<String> members = null;try {jedis = getJedis();members = jedis.sunion(setKeys);}finally {if (jedis != null){jedis.close();}}return members;}/*** 求差集,求几个集合之间的差集* @param setKeys 多个set的key* @return 差集*/public static Set<String> sdiff(String... setKeys){Jedis jedis = null;Set<String> members = null;try {jedis = getJedis();members = jedis.sdiff(setKeys);}finally {if (jedis != null){jedis.close();}}return members;}/*########################  zset(有序集合)的操作  #######################*//*** 添加一个元素到zset* @param key key* @param score 元素的分数* @param member 元素* @return 成功添加的元素个数*/public static Long zadd(String key,double score, String member){Jedis jedis = null;Long num = null;try {jedis = getJedis();num = jedis.zadd(key,score,member);}finally {if (jedis != null){jedis.close();}}return num;}
}

最后进行测试:Test

    @Testpublic void redisTest() {RedisUtils.set("test","测试 test");}

查看redis 数据库:
在这里插入图片描述
成功!!!!

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

小程序代码管理

“微信开发者工具”点击版本管理&#xff0c;然后点击代码管理会打开代码管理网页。 选择对应的项目组。 进来后点击创建项目。 输入git名称&#xff0c;然后选择命名空间&#xff0c;最后创建即可。 在刚才的“微信开发者工具”选择设置&#xff0c;然后添加远程。 输入名称&…

朋友圈大佬都去读研了,这份备考书单我码住了

作者简介&#xff1a; 辭七七&#xff0c;目前大二&#xff0c;正在学习C/C&#xff0c;Java&#xff0c;Python等 作者主页&#xff1a; 七七的个人主页 文章收录专栏&#xff1a; 七七的闲谈 欢迎大家点赞 &#x1f44d; 收藏 ⭐ 加关注哦&#xff01;&#x1f496;&#x1f…

pycharm安装jupyter,用德古拉主题,但是输入行全白了,看不清,怎么办?

问题描述 今天换了以下pycharm主题&#xff0c;但是jupyter界面输入代码行太白了&#xff0c;白到看不清楚这行的字&#xff0c;更不知道写的是什么&#xff0c;写到哪了&#xff0c;这还是挺烦人的&#xff0c;其他都挺正常的。 问题分析 目前来看有两个原因&#xff1a; 1、…

【新版vscode配置自动补全括号】

vscode新版配置自动补全括号方法 新版配置方法(Pylance) ①设置 -> 扩展 -> Pylance -> 将 python.analysis.completeFunctionParens 下方的选项打勾 ②直接在settings.json中添加"python.analysis.completeFunctionParens": true

【Apollo】自动驾驶技术的介绍

阿波罗是百度发布的名为“Apollo&#xff08;阿波罗&#xff09;”的向汽车行业及自动驾驶领域的合作伙伴提供的软件平台。 帮助汽车行业及自动驾驶领域的合作伙伴结合车辆和硬件系统&#xff0c;快速搭建一套属于自己的自动驾驶系统。 百度开放此项计划旨在建立一个以合作为中…

CSS - 快速实现悬浮吸顶,当页面滑动一定距离时固定吸附在顶部(position: sticky)

效果图 如下图所示&#xff0c;利用 position: sticky 属性轻松实现。 示例代码 新建一个 *.html 文件&#xff0c;一键复制运行起来。 <body><section class"content"><div class"item">我是悬浮吸顶区域</div><h1>我是…

AI时代:探索机器学习与深度学习的融合之旅

文章目录 1. 机器学习和深度学习简介1.1 机器学习1.2 深度学习 2. 为什么融合是必要的&#xff1f;2.1 数据增强2.2 模型融合 3. 深入分析&#xff1a;案例研究3.1 传统机器学习方法3.2 深度学习方法3.3 融合方法 4. 未来展望结论 &#x1f389;欢迎来到AIGC人工智能专栏~AI时代…

【Java Web】HTML 标签 总结

目录 1.HTML 2.标签 1. head 标签 1.图标 2.样式居中 2. body 标签 1.注释 &#xff1a; 2.加载图片 3.加载视频 效果 4.区域 效果 5.上下跳转&#xff0c;页面跳转 效果 6.表格 效果 7.有序列表&#xff0c;无序列表 效果 8.登录 效果 9.按钮 10.多选框…

Web之tomcat

[TOC]&#xff08;文章目录&#xff09; 1.程序架构 1.C/S(client/server) 比如&#xff1a;QQ、 微信、 LOL 优点&#xff1a;有一部分代码写在客户端&#xff0c; 用户体验比较好。 缺点&#xff1a; 服务器更新&#xff0c;客户端也要随着更新。 占用资源大。 2. B/S(brows…

【Spatial-Temporal Action Localization(二)】论文阅读2017年

文章目录 1. ActionVLAD: Learning spatio-temporal aggregation for action classification [code](https://github.com/rohitgirdhar/ActionVLAD/)[](https://github.com/rohitgirdhar/ActionVLAD/)摘要和结论引言&#xff1a;针对痛点和贡献相关工作模型框架思考不足之处 2.…

C语言双向链表

文章目录 前言双向链表链表头结点的创建节点尾插与尾删节点头插与头删特定位置插入或删除节点链表节点查找双向链表的销毁 链表的打印 前言 假期时间因为为学校开学考试做准备所以一直没更新博客&#xff0c;今天开始博客会陆续更新。 双向链表 之前我们说过了顺序表和单链表…

嵌入式这个领域会变得过于内卷吗?

今日话题&#xff0c;嵌入式这个领域会变得过于内卷吗&#xff1f;嵌入式开发主要服务于第二产业&#xff0c;尤其是制造业&#xff0c;包括电器、电气、机械、汽车、装备、航空航天等行业的“智能制造”部门&#xff0c;稳定性较强&#xff0c;不像互联网行业那样波动大。因此…

无涯教程-JavaScript - XNPV函数

描述 XNPV函数返回的现金Stream量表的净现值不一定是周期性的。要计算一系列定期现金Stream量的净现值,请使用NPV函数。 语法 XNPV (rate, values, dates)争论 Argument描述Required/OptionalRateThe discount rate to apply to the cash flows.RequiredValues 与日期付款时…

【javaSE】 反射与反射的使用

文章目录 &#x1f332;反射的定义&#x1f38d;反射的用途&#x1f334;反射基本信息&#x1f340;反射相关的类&#x1f6a9;Class类(反射机制的起源 )&#x1f388;Class类中的相关方法 &#x1f6a9;反射示例&#x1f388;获得Class对象的三种方式&#x1f388;反射的使用 …

Linux CentOS7修改命令行提示符

在CentOS操作系统中&#xff0c;命令和文件是我们与计算机进行交互的重要方式之一。有时候我们可能需要对某些命令、变量或文件进行修改&#xff0c;以满足特定的需求或提高工作效率。 本人在文章《Linux CentOS7命令及命令行》中对命令行提示符的修改作了初步介绍&#xff0c…

el-table纵向垂直表头

参考&#xff1a;https://www.jianshu.com/p/1f38eaffd070 <el-tablestyle"width: 100%":data"getValues":show-header"false"border:cell-style"cellStyle" ><el-table-columnv-for"(item, index) in getHeaders"…

MySQL数据同步归档使用工具总结

数据迁移方式&工具总结 kettel的使用dataX的使用pt-archiver的使用 kettel的使用 1、中文网&#xff1a;http://www.kettle.org.cn/ 2、下载地址 3、使用kettle进行数据迁移 3.1 打开文件夹&#xff0c;运行spoon.bat 3.2 点击文件&#xff0c;新建转换 3.3 新建数据库…

ctfshow-web-红包题 葵花宝典

0x00 前言 CTF 加解密合集CTF Web合集网络安全知识库溯源相关 文中工具皆可关注 皓月当空w 公众号 发送关键字 工具 获取 0x01 题目 0x02 Write Up 这道题说实话比较奇怪&#xff0c;有一个注册接口&#xff0c;先注册一个账号在&#xff0c;我注册的是admins 123456 然后登…

跨进程通讯之Binder通讯

一、oneway、in、out、inout关键字讲解 1、oneway&#xff1a;异步执行&#xff0c;不管服务器有没有执行完&#xff0c;直接返回 2、in&#xff1a;数据只能由客户端流入服务端 3、out&#xff1a;数据只能由服务端流出到客户端 4、inout&#xff1a;数据可以在服务端与客…

spice VDAgent简介

vdagent分为linux和windows&#xff0c;其中Linux分为vdagent守护进程和vdagent客户端进程&#xff0c;而windows主要为vdagent服务。 在windows中&#xff0c;通过服务方式自启动&#xff0c;并控制windows显示等。 在linux中&#xff0c; 守护进程通过 Sys-V initscript 或 s…