Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/2.create-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 2. Build and Publish
name: 2. Create Release

on:
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,4 @@ dataset
datasets
env
*.bak
_test.sh
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## v0.0.1-251009 (2025-10-09)

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed
### ✨ Features
* 💣 HOT! Automated installation scripts plus documentation by @BaratovSokhibjon in https://github.com/humblebeeai/script-common/pull/1

## New Contributors
* @BaratovSokhibjon made their first contribution in https://github.com/humblebeeai/script-common/pull/1

**Full Changelog**: https://github.com/humblebeeai/script-common/commits/v0.0.1-251009
162 changes: 58 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/humblebeeai/script-common?logo=GitHub&color=blue)](https://github.com/humblebeeai/script-common/releases)

This repository contains a collection of common scripts.
This repository contains a collection of common useful scripts.

## ✨ Features

Expand All @@ -12,137 +12,80 @@ This repository contains a collection of common scripts.
- Configuration scripts
- Preparation for environments
- Pre-configured for ease of use
- Account management scripts
- Cross-platform support (Unix/Linux/macOS)
- Multi-architecture support (amd64/arm64/aarch64/intel/apple-silicon)

## 🐤 Getting Started
## 🚧 Prerequisites

### 1. 🚧 Prerequisites
- Bash 4.0+
- Basic command-line tools (curl/wget, git, etc.)
- Internet connection for downloading packages
- Root access for system-level setup and account management
- Common Unix-like/Linux OS:
- **Linux** (primary support - Ubuntu/Debian)
- **macOS** (support with Homebrew)
- Other Unix-like systems (limited support)

[OPTIONAL] For **DEVELOPMENT** environment:
## 🚸 Usage/Examples

- Install [**git**](https://git-scm.com/downloads)
- Setup an [**SSH key**](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh)
### Setup server environment on **Ubuntu (20.04+), Debian (12.0+)**

### 2. 📥 Download or clone the repository
```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/ubuntu/setup-ubuntu.sh | bash -s -- -u -a
```

**2.1.** Prepare projects directory (if not exists):
Or with other useful options:

```sh
# Create projects directory:
mkdir -pv ~/workspaces/projects

# Enter into projects directory:
cd ~/workspaces/projects
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/ubuntu/setup-ubuntu.sh | bash -s -- \
--upgrade \
--hostname=my-server \
--timezone=Asia/Seoul \
--all-runtimes
```

**2.2.** Follow one of the below options **[A]**, **[B]** or **[C]**:
### Create a new user and setup development environment on most **Linux**

**OPTION A.** Clone the repository:
Setup development environment for the current user:

```sh
git clone https://github.com/humblebeeai/script-common.git && \
cd script-common
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/setup-user.sh | bash -s -- -a
```

**OPTION B.** Clone the repository (for **DEVELOPMENT**: git + ssh key):
Create a new user and setup development environment:

```sh
git clone git@github.com:humblebeeai/script-common.git && \
cd script-common
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/setup-user.sh | bash -s -- \
--user=user \
--all-runtimes
```

**OPTION C.** Download source code:

1. Download archived **zip** or **tar.gz** file from [**releases**](https://github.com/humblebeeai/script-common/releases).
2. Extract it into the projects directory.
3. Enter into the project directory.

## Scripts Overview

### 🛠️ System Setup

- **[setup-user-groups.sh](src/setup/setup-user-groups.sh)** - Create users and groups | [📖 docs](docs/setup/setup-user-groups.md)
- **[setup-dir-structure.sh](src/setup/setup-dir-structure.sh)** - Create workspace directory structure | [📖 docs](docs/setup/setup-dir-structure.md)

### 📦 Installation Scripts

- **[install-essentials.sh](src/install/install-essentials.sh)** - Install essential system packages | [📖 docs](docs/install/install-essentials.md)
- **[install-docker.sh](src/install/install-docker.sh)** - Install Docker with logging & data directory config | [📖 docs](docs/install/install-docker.md)
- **[install-ohmyzsh.sh](src/install/install-ohmyzsh.sh)** - Install Oh My Zsh with plugins | [📖 docs](docs/install/install-ohmyzsh.md)

### 🚀 Runtime Environments

- **[install-go.sh](src/install/runtimes/install-go.sh)** - Install Go programming language | [📖 docs](docs/install/runtimes/install-go.md)
- **[install-rust.sh](src/install/runtimes/install-rust.sh)** - Install Rust via rustup | [📖 docs](docs/install/runtimes/install-rust.md)
- **[install-nvm.sh](src/install/runtimes/install-nvm.sh)** - Install Node Version Manager | [📖 docs](docs/install/runtimes/install-nvm.md)
- **[install-miniconda.sh](src/install/runtimes/install-miniconda.sh)** - Install Miniconda Python distribution | [📖 docs](docs/install/runtimes/install-miniconda.md)

## Quick Start

```bash
# Clone and navigate to scripts
git clone <repository-url>
cd script.common

# Make scripts executable
chmod +x src/**/*.sh

# Install essential packages
./src/install/install-essentials.sh
Create a new user with sudo privileges, password and setup development environment:

# Create workspace structure
./src/setup/setup-dir-structure.sh

# Install development tools
./src/install/runtimes/install-go.sh
./src/install/runtimes/install-rust.sh
./src/install/install-docker.sh
```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/setup-user.sh | bash -s -- \
--user=admin \
--password="admin_pass123" \
--sudo \
--all-runtimes
```

## Configuration

All scripts support configuration via `.env` files. Place `.env` in:

- Script directory
- Parent directory of script
- Current working directory
### Setup development environment on **macOS**

Example `.env`:
Note: This script will install **Homebrew** and any other essential packages if not already installed.

```bash
# Workspace configuration
WORKSPACE_BASE_DIR=/home/user/workspaces

# Runtime versions
GO_VERSION=1.22.3
RUST_TOOLCHAIN=stable
NODE_VERSION=20

# Docker settings
CONFIGURE_DOCKER_LOGGING=yes
DOCKER_LOG_MAX_SIZE=50m
```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/macos/setup-macos.sh | bash -s -- -a
```

## Script Standards

All scripts follow a consistent three-section structure:
### Setup development environment on **Unix/Linux/macOS**

- **Base**: Initialization, dependency checks, OS detection
- **Variables**: Configurable environment variables with defaults
- **Main**: Core functionality in organized functions
Note: This script will only install and setup user-level runtimes and configurations, not system-level packages. Thus it doesn't require root privileges.

See [coding standards](.vscode/copilot-instructions.md) for detailed guidelines.

## Platform Support

- **Linux**: Ubuntu/Debian (primary support)
- **macOS**: Full support with Homebrew
- **Other**: Limited support, may require modifications

## Requirements

- Bash 4.0+
- Standard Unix utilities (curl/wget, git, etc.)
- Root access for system-level installations
```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/setup-user-env.sh | bash -s -- -a
```

---

Expand Down Expand Up @@ -174,6 +117,17 @@ mkdocs build
## 📑 References

- <https://www.shellscript.sh>
- <https://www.shellcheck.net>
- <https://www.gnu.org/software/bash/manual/bash.html>
- <https://www.zsh.org>
- <https://ohmyz.sh>
- <https://github.com/romkatv/powerlevel10k>
- <https://drasite.com/blog/Pimp%20my%20terminal>
- <https://gnunn1.github.io/tilix-web>
- <https://sw.kovidgoyal.net/kitty>
- <https://iterm2.com>
- <https://github.com/microsoft/terminal>
- <https://mobaxterm.mobatek.net>
- <https://hyper.is>
- <https://termius.com>
- <https://termux.dev>
92 changes: 80 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,88 @@ hide:
# - toc
---

# Welcome to MkDocs
# Home

For full documentation visit [mkdocs.org](https://www.mkdocs.org).
This repository contains a collection of common useful scripts.

## Commands
## ✨ Features

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
- Shell scripts
- Setup and installation scripts
- Configuration scripts
- Preparation for environments
- Pre-configured for ease of use
- Account management scripts
- Cross-platform support (Unix/Linux/macOS)
- Multi-architecture support (amd64/arm64/aarch64/intel/apple-silicon)

## Project layout
## 🚧 Prerequisites

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
- Bash 4.0+
- Basic command-line tools (curl/wget, git, etc.)
- Internet connection for downloading packages
- Root access for system-level setup and account management
- Common Unix-like/Linux OS:
- **Linux** (primary support - Ubuntu/Debian)
- **macOS** (support with Homebrew)
- Other Unix-like systems (limited support)

## 🚸 Usage/Examples

### Setup server environment on **Ubuntu (20.04+), Debian (12.0+)**

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/ubuntu/setup-ubuntu.sh | bash -s -- -u -a
```

Or with other useful options:

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/ubuntu/setup-ubuntu.sh | bash -s -- \
--upgrade \
--hostname=my-server \
--timezone=Asia/Seoul \
--all-runtimes
```

### Create a new user and setup development environment on most **Linux**

Setup development environment for the current user:

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/setup-user.sh | bash -s -- -a
```

Create a new user and setup development environment:

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/setup-user.sh | bash -s -- \
--user=user \
--all-runtimes
```

Create a new user with sudo privileges, password and setup development environment:

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/linux/setup-user.sh | bash -s -- \
--user=admin \
--password="admin_pass123" \
--sudo \
--all-runtimes
```

### Setup development environment on **macOS**

Note: This script will install **Homebrew** and any other essential packages if not already installed.

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/macos/setup-macos.sh | bash -s -- -a
```

### Setup development environment on **Unix/Linux/macOS**

Note: This script will only install and setup user-level runtimes and configurations, not system-level packages. Thus it doesn't require root privileges.

```sh
curl -fsSL https://github.com/humblebeeai/script-common/raw/main/src/setup/unix/setup-user-env.sh | bash -s -- -a
```
Loading