GaGa's Blog

One GaGa, One World !

借助pip生成requirements.txt文件。

方法一:使用pip freeze命令(简单直接)

在项目目录下打开终端,运行以下命令:

1
pip freeze > requirements.txt
Read more »

查看当前支持

docker network 支持的 --driver(网络驱动)

1
2
3
4
5
6
7
8
9
docker network ls
docker network create --help

docker info | grep -A4 'Plugins'
...
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay ### 支持类型
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog

Docker默认支持的网络驱动类型

Read more »

使用 parted mkpart 命令创建使用剩余空间的分区,这意味着你磁盘上已经存在一些分区,而你想利用剩下的未分配空间创建一个新的分区。

准备工作

  • 确认磁盘设备名: 使用 lsblkfdisk -l 命令查看你需要操作的磁盘设备名(例如 /dev/sda/dev/sdb)。
  • Root 权限: 所有 parted 命令都需要 root 或 sudo 权限。

基本步骤

Read more »

The command parted /dev/loop3 starts the parted utility and targets the loop device /dev/loop3. This means you’re about to partition the file associated with this loop device, not a physical hard drive.

1. Loop Devices

Loop devices are virtual block devices. They allow you to mount a regular file as if it were a block device (like a hard drive partition). Before using parted /dev/loop3, you must have already set up /dev/loop3 using losetup.

Example setup:

Read more »

Linux 支持多种文件系统类型,每种文件系统都有其特点和适用场景。

1. ext (Extended File System)

  • ext: 这是 Linux 最初的文件系统,于 1992 年发布。现在已经很少使用。
  • ext2 (Second Extended File System): ext 的改进版本,性能比 ext 有所提升,但没有日志功能。
  • ext3 (Third Extended File System): 在 ext2 的基础上增加了日志功能,提高了数据安全性,是早期 Linux 发行版的默认文件系统。
  • ext4 (Fourth Extended File System): ext3 的改进版本,支持更大的文件和卷,性能更好,是目前 Linux 系统中最常用的文件系统之一。

2. XFS (X File System)

Read more »

Glider 搭建 HTTP/SOCKS5代理

Glider 通常通过配置文件或命令行参数进行配置

glider -config glider.conf

1.监听 HTTP 和 SOCKS5 代理在同一端口:

Read more »

Gemini CLIGoogle 推出的开源命令行 AI 工具,直接将 Gemini 2.5 Pro 集成在终端中。支持编写代码、修复 bug、管理任务、内容创作,甚至生成图片/视频(借助 Imagen、Veo)。

  • 免费限额为每分钟 60 次模型请求、每日 1000 次,属于免费开发者中业界最慷慨的配额。

安装与快速上手

Read more »

coreutils是在 macOS 上安装 GNU 版本的基础命令行工具。macOS 自带的是 BSD 版本的工具,而 GNU 工具功能更丰富,更接近 Linux 环境,对于开发、运维非常有帮助。


coreutils 包含哪些工具?

coreutils 提供了 Linux 上常用的命令行工具(约 100+ 个),例如:

Read more »

命令

curl -o /dev/null -s -w "\
    DNS解析: %{time_namelookup}s\n\
    TCP连接: %{time_connect}s\n\
    SSL握手: %{time_appconnect}s\n\
    准备传输: %{time_pretransfer}s\n\
    首字节到达: %{time_starttransfer}s\n\
    总耗时: %{time_total}s\n" -XGET  		http://192.168.2.125:5001/health

Git仓库中 克隆指定分支,命令

1
git clone -b <分支名> --single-branch <仓库地址>

示例

1
git clone -b dev --single-branch https://github.com/user/repo.git
Read more »
0%