{"id":20083639,"url":"https://github.com/albert26193/lab-server-ops","last_synced_at":"2025-05-06T01:31:25.004Z","repository":{"id":212630617,"uuid":"645230744","full_name":"Albert26193/lab-server-ops","owner":"Albert26193","description":"A tool that is 100% programmed in bash, designed to simplify the work of operations and maintenance personnel.","archived":false,"fork":false,"pushed_at":"2024-01-18T12:50:31.000Z","size":136,"stargazers_count":30,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"linux","last_synced_at":"2025-04-09T06:35:04.215Z","etag":null,"topics":["bash","fzf","oh-my-zsh","ops","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Albert26193.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-25T07:48:24.000Z","updated_at":"2025-03-21T09:01:25.000Z","dependencies_parsed_at":"2024-01-17T10:28:42.540Z","dependency_job_id":"4d3cd332-2340-48b4-b5bf-84e77f56af4a","html_url":"https://github.com/Albert26193/lab-server-ops","commit_stats":null,"previous_names":["albert26193/lab-server-ops"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albert26193%2Flab-server-ops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albert26193%2Flab-server-ops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albert26193%2Flab-server-ops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Albert26193%2Flab-server-ops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Albert26193","download_url":"https://codeload.github.com/Albert26193/lab-server-ops/tar.gz/refs/heads/linux","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252604279,"owners_count":21775077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","fzf","oh-my-zsh","ops","zsh"],"created_at":"2024-11-13T15:48:09.800Z","updated_at":"2025-05-06T01:31:24.680Z","avatar_url":"https://github.com/Albert26193.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lab-server-ops Documentation\n\n- [1. Introduction](https://github.com/Albert26193/lab-server-ops#1-introduction)\n\t- [1.1 Overview](https://github.com/Albert26193/lab-server-ops#11-overview)\n\t- [1.2 Branch Description](https://github.com/Albert26193/lab-server-ops#12-branch-description)\n\t- [1.3 Feature Preview](https://github.com/Albert26193/lab-server-ops#13-feature-preview)\n\t\t- [1.3.1 User Distribution Feature](https://github.com/Albert26193/lab-server-ops#131-user-distribution-feature)\n\t\t- [1.3.2 User Broadcast Feature](https://github.com/Albert26193/lab-server-ops#132-user-broadcast-feature)\n\t\t- [1.3.3 User Basic Configuration](https://github.com/Albert26193/lab-server-ops#133-user-basic-configuration)\n\t\t- [1.3.4 Convenience Enhancement Feature](https://github.com/Albert26193/lab-server-ops#134-convenience-enhancement-feature)\n- [2. Installation](https://github.com/Albert26193/lab-server-ops#2-installation)\n\t- [2.1 Confirm Branch](https://github.com/Albert26193/lab-server-ops#21-confirm-branch)\n\t- [2.2 Installation Process](https://github.com/Albert26193/lab-server-ops#22-installation-process)\n\t\t- [2.2.1 `linux` Branch](https://github.com/Albert26193/lab-server-ops#221-linux-branch)\n\t\t- [2.2.2 `linux-minimum` Branch](https://github.com/Albert26193/lab-server-ops#222-linux-minimum-branch)\n\t\t- [2.2.3`mac-personal` Branch](https://github.com/Albert26193/lab-server-ops#223-mac-personal-branch)\n- [3. Usage](https://github.com/Albert26193/lab-server-ops#3-usage)\n\t- [3.1 For `Linux` Administrators](https://github.com/Albert26193/lab-server-ops#31-for-linux-administrators)\n\t- [3.2 For Ordinary Users](https://github.com/Albert26193/lab-server-ops#32-for-ordinary-users)\n- [4. Configuration](https://github.com/Albert26193/lab-server-ops#4-configuration)\n- [5. Development Plan](https://github.com/Albert26193/lab-server-ops#5-development-plan)\n\n[中文](https://github.com/Albert26193/lab-server-ops/blob/linux/README_CN.md)\n\n## 1. Introduction\n\n### 1.1 Overview\n\n- The target audience for this project:\n  - `Linux` system administrators\n  - Personal `Mac` users\n  \n---\n\n- This project aims to provide a better terminal usage experience:\n  - For administrators:\n    1. Simplify the user distribution process (including permission isolation, group setting, key distribution, configuration of commonly used tools such as `zsh/vim/tmux`, etc.);\n    2. Provide convenient user broadcast function;\n  - For users:\n      1. Rely on `oh-my-zsh` and its plugin ecosystem to get a convenient and comfortable `Shell` experience.\n      2. Rely on the scripts provided by the `shell` programming of this project to implement a series of functions such as fuzzy jumping and history record fuzzy search.\n\n### 1.2 Branch Description\n\n- This project has a total of `3` branches:\n  1. `linux` Branch: Suitable for mainstream `Linux` systems with `Linux kernel \u003e= 5`, providing administrators with complete functions.\n  2. `linux-minimum` Branch: Suitable for mainstream `linux` systems with `Linux kernel \u003c 5`, providing administrators with some functions.\n  3. `mac-personal` Branch: Suitable for `macOS`, providing individual users with some functions.\n\n| Branch Name   | Adapted System                                          | Administrator Functions     | User Functions |\n| ------------- | ------------------------------------------------------- | --------------------------- | -------------- |\n| linux         | `Ubuntu(\u003e= 19.04)`  `Debian/Raspbian \u003e= 10.0`           | 1. User distribution; 2. User broadcast | 1. Common tool configuration 2. Convenience enhancement script |\n| linux-minimum | `Ubuntu(\u003c 19.04)`  `Debian/Raspbian \u003c 10.0` `CentOS7/8` | 1. User distribution; 2. User broadcast | 1. Common user configuration |\n| mac-personal  | `MacOS \u003e= 11.0`                                         | No                          | 1. Convenience enhancement script |\n\n### 1.3 Feature Preview\n\n\u003e The fuzzy jumping function largely relies on the two modern tools `fzf` and `fd`. This project is only a stitching tool for the glue layer.\n\n#### 1.3.1 User Distribution Feature\n\n- The administrator's user distribution function is fully interactive and can choose a series of functions such as user grouping, user permission `visudo` settings, user key distribution, etc.\n\n![new-user.gif](https://img-20221128.oss-cn-shanghai.aliyuncs.com/img-2023-05/new-user.gif)\n\n#### 1.3.2 User Broadcast Feature\n\n- The essence of user broadcasting is that all users will load `/opt/lab-server-ops/lso_user/script_broadcast/broadcast.sh`\n- Administrators only need to modify this file to implement the user broadcast function.\n\n```shell\n#.zshrc\n\n# ------------------- broadcast ---------------------\nbash \"/opt/lab-server-ops/lso_user/script_broadcast/broadcast.sh\"\n\n```\n\n#### 1.3.3 User Basic Configuration\n\n- Users generated through distribution have pre-configured basic tools\n- The `.vimrc/.zshrc/.tmux.conf` under the user's directory have been pre-configured\n- The public and private keys under the user's directory `.ssh` have been pre-configured\n#### 1.3.4 Convenience Enhancement Feature\n\n- You can make fuzzy jumps and edits between directories\n- You can fuzzy query the history record\n\n![command.gif](https://img-20221128.oss-cn-shanghai.aliyuncs.com/img-2023-05/command.gif)\n\n## 2. Installation\n\n### 2.1 Confirm Branch\n\n- Please make sure your system is one of `Deiban/Raspbian/Ubuntu/CentOS/MacOS`.\n- If your system is `Ubuntu(\u003e= 19.04)` or `Debian/Raspbian \u003e= 10.0`, please execute\n\n```shell\ngit checkout linux\n```\n\n- If your system is `Ubuntu(\u003c 19.04)` or `Debian/Raspbian \u003c 10.0` or `CentOS7/8`, please execute \n\n```shell\ngit checkout linux-minimum\n```\n\n- If your system is `macOS` please execute\n\n```shell\ngit checkout mac-personal\n```\n\n\u003e This project has the function of automatically detecting the operating system. If the branch does not meet the requirements, **automatic switching will be performed**\n\n### 2.2 Installation Process\n\n#### 2.2.1 `linux` Branch\n\n1. Pull the project\n\n```shell\ngit clone https://github.com/Albert26193/lab-server-ops.git\n\n# branch: linux\ngit checkout linux\n```\n\n2. Install dependencies\n\n```shell\n# enter project\ncd ./install\n\n# install dependency\nsudo bash install_dependency.sh\n```\n\n\u003e The following dependencies will be installed\n\n```shell\n    local install=(\n        \"tmux\"\n        \"vim\"\n        \"git\"\n        \"curl\"\n        \"wget\"\n        \"tree\"\n        \"fd-find\"\n        \"fzf\"\n        \"bat\"\n        \"exa\"\n        \"nvim\"\n    )\n```\n\n3. Install the project\n\n```shell\nsudo bash install.sh\n```\n\n4. Add administrator command entry\n\n  \u003e Please add the following command to your `.zshrc/.bashrc` according to your actual situation\n\n```shell\nsource \"/opt/lab-server-ops/lso_admin/lso.sh\"\n```\n\n\u003e Then execute the following command to reload the configuration file\n\n```shell\nsource ~/.zshrc\n# or  source ~/.bashrc\n```\n\n#### 2.2.2 `linux-minimum` Branch\n\n1. Pull the project\n\n```shell\ngit clone https://github.com/Albert26193/lab-server-ops.git\n\n# branch: linux-minimum\ngit checkout linux-minimum\n```\n\n2. Install dependencies\n\n```shell\n# enter project\ncd ./install\n\n# install dependency\nsudo bash install_dependency.sh\n```\n\n\u003e The following dependencies will be installed\n\n```shell\n    local install=(\n        \"tmux\"\n        \"vim\"\n        \"git\"\n        \"curl\"\n        \"wget\"\n        \"tree\"\n    )\n```\n\n3.  Install the project\n\n```shell\nsudo bash install.sh\n```\n\n4. Add administrator command entry\n\n  \u003e Please add the following command to your `.zshrc/.bashrc` according to your actual situation\n\n```shell\nsource \"/opt/lab-server-ops/lso_admin/lso.sh\"\n```\n\n\u003e Then execute the following command to reload the configuration file\n\n```shell\nsource ~/.zshrc\n# or  source ~/.bashrc\n```\n\n#### 2.2.3`mac-personal` Branch\n\n1. Pull the project\n\n```shell\ngit clone https://github.com/Albert26193/lab-server-ops.git\n\n# branch: mac-personal\ngit checkout mac-personal\n```\n\n2. Install dependencies\n\n- 🛑 You need to ensure that `brew` is installed locally in advance\n\n```shell\n# enter project\ncd ./install\n\n# install dependency\nbash install_dependency.sh\n```\n\n\u003e The following dependencies will be installed\n\n```shell\n    local install=(\n        \"tmux\"\n        \"vim\"\n        \"git\"\n        \"curl\"\n        \"wget\"\n        \"tree\"\n        \"fd\"\n        \"fzf\"\n        \"bat\"\n        \"exa\"\n        \"nvim\"\n    )\n```\n\n3. Install the project\n\n```shell\nbash install.sh\n```\n\n## 3. Usage\n\n###  3.1 For `Linux` Administrators\n\n  - After the installation is complete, your `.zshrc` or `.bashrc` should have added the command entry\n\n```shell\nsource \"/opt/lab-server-ops/lso_admin/lso.sh\"\n```\n\n- Then, execute the following command\n\n```shell\nlso_admin\n```\n\n- The output is as follows\n\n![image.png](https://img-20221128.oss-cn-shanghai.aliyuncs.com/img-2023-05/20240118165851.png)\n\n- In the interactive panel, you will have two options\n    1. Add new users: `useradd`, enter `1` \n    2. Add `zsh` related configuration for existing users: `addzsh`, enter `2`\n\n- Then, you can interactively select user settings (grouping, key, creating symbolic links, etc.) 🍺️\n\n### 3.2 For Ordinary Users\n\n- The commands that ordinary users can get can be viewed in `.zshrc`\n\n```shell\n# ~/.zshrc\n\n# ------------------  lab-server-ops ----------------\n\nsource \"${HOME}/.lso.env\"\nsource \"/opt/lab-server-ops/lso_user/lso.sh\"\n\nalias \"fs\"=\"lso_fuzzy_search\"\nalias \"fj\"=\"lso_fuzzy_jump\"\nalias \"fe\"=\"lso_fuzzy_edit\"\nalias \"hh\"=\"lso_fuzzy_history\"\nalias \"pon\"=\"lso_proxy_on\"\nalias \"poff\"=\"lso_proxy_off\"\n```\n\n- `fs`: `fuzzy search` fuzzy search, accepts two parameters, can perform fuzzy matching on directories, its configuration please refer to `~/.lso.env`\n- `fj`: `fuzzy jump` fuzzy jump, accepts two parameters, can perform fuzzy jump on directories, its configuration please refer to `~/.lso.env`\n- `fe`: `fuzzy edit` fuzzy edit, accepts two parameters, can perform fuzzy edit on directories, its configuration please refer to `~/.lso.env`, the editor defaults to `vim`, you can replace it with other editors.\n- `hh`: `fuzzy history` fuzzy history match, accepts two parameters, can perform fuzzy search and match on all `zsh` history records.\n- `pon`: `proxy on`, can forward the current `shell` traffic, accepts two parameters, parameter 1 is the target server IP address, parameter 2 is the target server port\n- `poff`: `proxy off`, turn off proxy\n\n\u003e If there are no related commands in `.zshrc`, it means that the `Linux` version is not enough, and the `linux-minimum` related commands are loaded\n\n## 4. Configuration\n\n- The configuration part is for the `.lso.env` file, this file controls the range of fuzzy adjustment and indexing, you can freely add `ignore` directories and query range directories.\n- The default configuration is as follows\n\n```shell\n#!/bin/bash\n\n# in which dir to search\nlso_search_dirs=(\n    \"${HOME}\"\n    #\"CodeSpace\"\n)\n\n# within search range, which dir to ignore\nlso_search_ignore_dirs=(\n    # \"Downloads\"\n    # \"Desktop\"\n    # \"Documents\"\n    \".git\"\n    \".local\"\n    \".m2\"\n    \".gradle\"\n    \".wns\"\n    \".nvm\"\n    \".npm\"\n    \".nrm\"\n    \".red-hat\"\n    \".redhat\"\n    \".oh-my-zsh\"\n    \".github\"\n    \".cache\"\n    \".cargo\"\n    \".rustup\"\n    \".vscode\"\n    \".vscode-insiders\"\n    \".vscode-server-insiders\"\n    \".vscode-server\"\n    \".vscode-oss\"\n    \".vscode-oss-insiders\"\n    \"lib\"\n    \"node_modules\"\n    \"pkg\"\n    \"bin\"\n    \"dist\"\n    \"pkgs\"\n    \"from-github\"\n    \"assets\"\n    \"image\"\n    \"images\"\n    \"static\"\n    \"data\"\n    \"raycast\"\n    \"obsidian-*\"\n    \"zlt-*\"\n    \"anaconda3\"\n    \"Applications\"\n    \"Library\"\n    \"Movies\"\n    \"Music\"\n    \"Pictures\"\n    \"Public\"\n    \"Remote\"\n    \"Zotero\"\n    \"EVPlayer2_download\"\n)\n\n# search preview or not, true: preview | false: not preview\n# if your machine is not powerful enough(RAM \u003c= 1GiB), set it to false\n# otherwise, set it to true(Recommend)\nlso_search_preview=true\n#lso_search\n```\n\n## 5. Development Plan\n\n1. Add command audit function\n2. Add administrator functions related to deleting users\n3. Add administrator functions related to network and disk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbert26193%2Flab-server-ops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbert26193%2Flab-server-ops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbert26193%2Flab-server-ops/lists"}