Hadoop安装
前提条件安装jdk
配置hostname12vi /etc/hostshostname my.hadoop.cn
新建用户hadoop123456useradd hadooppasswd hadoopchmod u + w /etc/sudoersvim /etc/sudoers#在root ALL=(ALL)ALL下添加hadoop ALL(ALL)ALLchmod u - w /etc/sudoers
配置ssh123ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsacat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keyschmod 0600 ~/.ssh/authorized_keys
安装hadoop12345mkdir /softtar -zxvf hadoop-3.3.5.tar.gz -C /soft/sudo chown -R hadoop:hadoop /soft/hadoop-3.3.5
配置JAVA_HOME进入/soft/hadoop ...
对称加密(AES)
123456789101112131415161718192021222324252627282930313233@Slf4j@Componentpublic class AESUtil { @Value("${aes.secret.key}") private String secretKey; @Value("${aes.iv}") private String iv; public String decrypt(String encryptedText) throws Exception { IvParameterSpec ivSpec = new IvParameterSpec(iv.getBytes(StandardCharsets.UTF_8)); SecretKeySpec skeySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), ...
pyspark的使用
data.csv 示例12345678910111213员工ID,部门,工作年限,学历,沟通能力,团队协作,问题解决,学习能力,创新能力,能力得分1,技术部,1,本科,70,80,75,85,60,752,技术部,2,本科,72,82,77,87,62,773,技术部,3,硕士,75,85,80,90,65,804,市场部,1,大专,60,70,65,75,50,655,市场部,2,本科,62,72,67,77,52,676,市场部,3,本科,65,75,70,80,55,707,财务部,1,大专,65,70,75,80,60,708,财务部,2,本科,67,72,77,82,62,729,财务部,3,本科,70,75,80,85,65,7510,人力资源部,1,本科,70,75,80,85,70,7811,人力资源部,2,本科,72,77,82,87,72,8012,人力资源部,3,硕士,75,80,85,90,75,83
代码示例1234567891011121314151617181920212223242526272829303132333435363738394041424 ...
Java实现SHA-256加密
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293package com.utils;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;import java.security.SecureRandom;import java.util.Base64;/** * Author reisen7 * Date 2025/4/17 22:53 * Description */public class SaltedHash { // 使用盐值和密码生成哈希,并在内部生成盐值 public static String hashPassword(String pass ...
Java邮件验证
添加依赖
12345<!-- 邮件 --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>
添加配置
123456789101112131415161718192021spring: # 邮件配置 mail: username: Reisen7@163.com password: TJqip9ditF9zHx8Q host: smtp.163.com port: 465 properties: mail: smtp: auth: true starttls: enable: true required: true socketFactory: ...
Hive安装
MYSQL安装详细看mysql安装的章节
添加hive用户12345CREATE DATABASE hive;CREATE USER 'hiveuser'@'localhost' IDENTIFIED BY 'hivepassword';GRANT ALL PRIVILEGES ON hive.* TO 'hiveuser'@'localhost';FLUSH PRIVILEGES;
Hive安装安装包下载1wget --user-agent="Mozilla" https://mirrors.tuna.tsinghua.edu.cn/apache/hive/hive-4.0.1/apache-hive-4.0.1-bin.tar.gz
解压1tar -xzvf apache-hive-4.0.1-bin.tar.gz
到hive的conf文件夹下面1vim hive-site.xml
1234567891011121314151617181920212223 ...
Vue实现高德地图标点
依赖导入1npm i @amap/amap-jsapi-loader --save-dev
创建组件创建一个文件GaodeMap.vue
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791 ...
mahout实现协同过滤推荐
引入依赖12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849<!--引入推荐引擎mahout,注意要先全部引入,再使用exclusion标签--><dependency> <groupId>org.apache.mahout</groupId> <artifactId>mahout-mr</artifactId> <version>0.12.2</version> <exclusions> <exclusion> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> <exclusion> <group ...
Spark分析案例
添加依赖1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253<!-- Spark Core and SQL --><dependency> <groupId>org.apache.spark</groupId> <artifactId>spark-core_2.12</artifactId> <version>3.4.1</version> <exclusions> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-slf4j-impl</artifactId> </exclusion> </exclusions>< ...
仿Deepseek页面的聊天窗口
先到阿里云控制台注册token
https://bailian.console.aliyun.com/
后端代码python Django1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253from django.http import JsonResponsefrom openai import OpenAIimport jsonfrom django.http import StreamingHttpResponsedef admin_only_api(request): if request.method == 'GET': content = request.GET.get('content') client = OpenAI( api_key="申请的token", base_url=" ...