Gradle 简介

Gradle 是一种强大的构建工具,广泛应用于 Java、Kotlin、Groovy、Android 等生态系统。它以 声明性 和 灵活性 著称,使用基于 Groovy 或 Kotlin 的 DSL(领域特定语言)来定义构建脚本。 Gradle 可以用于以下任务: • 编译代码 • 运行测试 • 打包应用程序 • 管理依赖 • 部署应用 快速入门 安装 Gradle • 手动安装: 下载 Gradle:https://gradle.org/releases/ 解压后配置环境变量 GRADLE_HOME 和 PATH。 • 使用包管理器: • MacOS: brew install gradle • Ubuntu: sudo apt install gradle • Windows: 使用 choco install gradle […] →Read more

Kotlin 快速入门

基础学习 1.1 安装开发环境 Kotlin 的开发环境非常灵活: • 推荐工具:IntelliJ IDEA 下载社区版即可:https://www.jetbrains.com/idea/download/ • 创建新项目时选择 Kotlin/JVM 模板即可开始。 • 在线编译器:Kotlin Playground 无需安装工具,直接访问 https://play.kotlinlang.org/ 在线运行 Kotlin 代码。 • Android 开发:Android Studio 如果目标是 Android 开发,可以使用 Android Studio,它对 Kotlin 有良好的支持。 1.2 学习语言基础 Kotlin 的语法直观、简洁,可以通过以下内容快速掌握语言基础: • Hello, World! fun main() { println("Hello, World!") } • 变量声明 val name: String = "Kotlin" // 不可变变量 var […] →Read more

如何制作一面自己的魔镜 MagicMirror

一、准备工作 1. 硬件准备 树莓派(推荐 Raspberry Pi 4 或更新版本) 需要配备 SD 卡(至少 8GB,推荐 16GB 或更大),用于安装系统。 显示器 普通的电脑显示器或平板显示器即可,大小根据需求选择。 双向镜子(Two-Way Mirror) 这种镜子既可以反射光线又允许屏幕后面的内容透过。可以从网上购买或者找本地玻璃店定制。 其他工具 HDMI 线:用于连接显示器与树莓派。 电源适配器:为树莓派供电。 框架:用于固定镜子和显示器(可以是木框、金属框等)。 二、安装和配置 MagicMirror 软件 1. 安装树莓派操作系统 下载 Raspberry Pi Imager。 将树莓派操作系统(Raspberry Pi OS)写入 SD 卡。 插入树莓派,接入电源、显示器、键盘鼠标,完成系统的初始配置(语言、WiFi 等)。 2. 安装 MagicMirror² 打开树莓派终端,运行以下命令安装 MagicMirror²: bash -c “$(curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/install.sh)” 安装完成后,MagicMirror 的默认文件将位于 ~/MagicMirror 目录。 3. […] →Read more

Databricks and Superset

Databricks Databricks 是一个基于云的统一数据分析平台,专为大规模数据处理、数据科学、机器学习和数据工程设计。它由 Apache Spark 的创始团队创建,旨在使大规模数据分析更加简单、高效和协作。 主要特点 多用途平台: 支持数据工程、数据科学和数据分析。 提供 ETL(提取、转换、加载)、数据探索、机器学习模型训练和部署等功能。 统一的数据管理: 支持处理结构化和非结构化数据。 与数据湖和数据仓库集成(例如 Delta Lake)。 高效的计算引擎: 使用优化的 Apache Spark 引擎以处理大规模数据。 提供自动化优化和动态分区管理。 协作功能: 提供笔记本(Notebook)环境,支持 Python、R、Scala 和 SQL。 支持团队协作和实时共享工作结果。 多云支持: 可部署在主流云平台上(如 AWS、Azure 和 Google Cloud)。 安全性和可扩展性: 提供数据加密、用户访问控制和审计功能。 应用场景 数据湖分析:用于数据清洗、转换和分析。 机器学习:训练和部署模型。 数据集成:将不同来源的数据集成到统一的平台。 BI 和报表支持:与 BI 工具集成(如 Tableau、Power BI 和 Superset)。 Apache Superset Apache Superset 是一个开源的商业智能(BI)平台,用于交互式数据可视化和仪表盘构建。它提供了一个用户友好的界面,允许用户从各种数据源中提取数据并创建图表和仪表盘。 主要特点 直观的界面: […] →Read more

how to use teleport bot to issue certificate and save it into aws secret manager?

To use Teleport (a popular tool for secure access to infrastructure) to issue a certificate and save it into AWS Secrets Manager, follow these steps: Prerequisites: Teleport Setup: Ensure you have Teleport installed and configured. A Teleport bot must be running and properly authenticated to issue certificates. AWS CLI: Ensure the AWS CLI is installed […] →Read more

what’s the difference between AWS role permission policies and trust entities?

In AWS Identity and Access Management (IAM), role permission policies and trust entities serve distinct but complementary purposes: 1. Permission Policies Definition: Permission policies define what actions an IAM role can perform on specific AWS resources. Scope: These policies are attached to the role itself and specify the permissions granted to anyone or anything assuming […] →Read more

Self-Signed Certificate

自签名证书(Self-Signed Certificate)本质上并不依赖于外部的证书颁发机构(CA),因为它本身就是自己的 CA。换句话说,自签名证书的签发者(Issuer)和使用者(Subject)是同一个实体。 自签名证书的特点 Issuer 与 Subject 相同 自签名证书自己签署自己,所以在证书的 Issuer 和 Subject 字段中,都会看到相同的内容。 示例: Issuer: CN=MyRootCA, O=My Organization, C=US Subject: CN=MyRootCA, O=My Organization, C=US 没有外部验证 它的合法性完全依赖于你自己信任它,而不是通过第三方 CA 的认证。 使用时需要将自签名证书显式添加到“受信任证书”列表中。 用途 开发、测试环境。 小型闭环系统(如内网)。 为 CA 系统创建根证书(自签名证书可以成为其他证书的信任根)。 自签名证书的 CA 功能 一个自签名证书可以充当根 CA 证书,从而签发其他子证书(如服务器证书)。具体步骤如下: 生成自签名证书 使用 openssl 或类似工具生成密钥对。 自己使用私钥对证书内容进行签名,生成自签名证书。 签发其他证书 自签名证书作为“CA”,用它的私钥签署 CSR(证书签名请求),从而生成子证书。 如何生成自签名证书 以下以 OpenSSL 为例,生成一个自签名证书: 步骤 1:生成私钥 […] →Read more

Credential settings retrieval order

@startuml start floating note: Credential settings retrieval order : 1. Java system properties; : 2. environment variables; : 3. web identity token from AWS STS; : 4. the shared credentials and config files; : 5. Amazon ECS container credentials; : 6. Amazon EC2 instance IAM role-provided credentials; end @enduml The default credentials provider chain of the SDK for Java […] →Read more

How to call go function by java JNI

To use JNI to call the CreateRole function of the Teleport Go client, you need to expose this functionality through a Go shared library, following the steps below. The goal is to make the Go function callable from Java by wrapping it in a JNI-compatible interface. 1. Understand the Function Signature The Go function you […] →Read more