-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from airdb/dev
release new version
- Loading branch information
Showing
8 changed files
with
187 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,36 +3,24 @@ package cmd | |
import ( | ||
"fmt" | ||
|
||
"github.com/airdb/adb/internal/adblib" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var manCommand = &cobra.Command{ | ||
Use: "man", | ||
Short: "man command like linux", | ||
Long: "display manual pages", | ||
Use: "man", | ||
Short: "man command like linux", | ||
Long: "display manual pages", | ||
Example: adblib.MysqlDoc, | ||
} | ||
|
||
var gitInitCommand = &cobra.Command{ | ||
Use: "git", | ||
Short: "git operation", | ||
Long: "git operation", | ||
Use: "git", | ||
Short: "git operation", | ||
Long: "git operation", | ||
Aliases: []string{"github", "gh"}, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("git config --global core.hooksPath .github/hooks") | ||
fmt.Println("git config --global core.excludefile .gitignore_global") | ||
fmt.Println("git config --global url.'ssh://[email protected]'.insteadOf https://github.com") | ||
fmt.Println() | ||
fmt.Println("For Close Github Issue, commit message should as follow:") | ||
fmt.Println("\t", "close #x") | ||
fmt.Println("\t", "closes #x") | ||
fmt.Println("\t", "closed #x") | ||
fmt.Println("\t", "fix #x") | ||
fmt.Println("\t", "fixes #x") | ||
fmt.Println("\t", "fixed #x") | ||
fmt.Println("\t", "resolve #x") | ||
fmt.Println("\t", "resolves #x") | ||
fmt.Println("\t", "resolved #x") | ||
fmt.Println("\t", "add new quick sort algorithm, fixes #4, resolve #6, closed #12") | ||
|
||
fmt.Println(adblib.GithubDoc) | ||
}, | ||
} | ||
|
||
|
@@ -61,29 +49,7 @@ var brewInitCommand = &cobra.Command{ | |
Short: "brew operation", | ||
Long: "brew operation", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("Brew Common Command:") | ||
fmt.Println("\tbrew outdated") | ||
fmt.Println("\tbrew ") | ||
fmt.Println("\tbrew cask outdated") | ||
fmt.Println("\tbrew outdated adb --verbose --debug") | ||
fmt.Println("\tbrew install github/gh/gh") | ||
fmt.Println("\tbrew install aliyun-cli") | ||
fmt.Println() | ||
fmt.Println("\tbrew tap aidb/taps") | ||
fmt.Println("\tbrew install airdb/taps/adb") | ||
fmt.Println("\tbrew install adb") | ||
fmt.Println() | ||
}, | ||
} | ||
|
||
var githubInitCommand = &cobra.Command{ | ||
Use: "gh", | ||
Short: "github operation", | ||
Long: "github operation", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("brew install github/gh/gh") | ||
fmt.Println("gh --repo bbhj/lbs issue status") | ||
fmt.Println("gh --repo bbhj/lbs issue view 1") | ||
fmt.Println(adblib.BrewDoc) | ||
}, | ||
} | ||
|
||
|
@@ -131,25 +97,7 @@ var helmCommand = &cobra.Command{ | |
Short: "helm command", | ||
Long: "helm command", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("helm commands)") | ||
fmt.Println("") | ||
fmt.Println("\tsudo apt update") | ||
fmt.Println("\tsudo apt install snapd") | ||
fmt.Println("\tsudo snap install helm --classic") | ||
fmt.Println("") | ||
fmt.Println("\thelm plugin install https://github.com/airdb/helm-kube") | ||
fmt.Println("") | ||
fmt.Println("\thelm repo add airdb https://www.airdb.com/helm/") | ||
fmt.Println("\thelm repo update") | ||
fmt.Println("\thelm search repo helm/mychart") | ||
fmt.Println("") | ||
fmt.Println("\thelm show readme airdb/mychat") | ||
fmt.Println("") | ||
fmt.Println("\thelm install chart airdb/mychat") | ||
fmt.Println("\thelm install chart airdb/mychat --dry-run --debug") | ||
fmt.Println("") | ||
fmt.Println("\thelm get notes mychat") | ||
fmt.Println("") | ||
fmt.Println(adblib.HelmDoc) | ||
}, | ||
} | ||
|
||
|
@@ -158,17 +106,7 @@ var terraformCommand = &cobra.Command{ | |
Short: "terraform command", | ||
Long: "terraform command", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("terraform commands") | ||
fmt.Println("") | ||
fmt.Println("\tterraform -install-autocomplete") | ||
fmt.Println("\tterraform init -upgrade") | ||
fmt.Println("") | ||
fmt.Println("\tterraform validate") | ||
fmt.Println("\tterraform plan") | ||
fmt.Println("\tterraform apply") | ||
fmt.Println("\t#terraform destroy") | ||
fmt.Println("") | ||
fmt.Println("\tRefer: https://github.com/airdb/init/tree/master/terraform") | ||
fmt.Println(adblib.TerraformDoc) | ||
}, | ||
} | ||
|
||
|
@@ -177,15 +115,7 @@ var opensslCommand = &cobra.Command{ | |
Short: "openssl command", | ||
Long: "openssl command", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("openssl commands") | ||
fmt.Println("") | ||
fmt.Println("\topenssl x509 -text -in ssl.chain.crt") | ||
fmt.Println("\topenssl req -noout -text -in ssl.csr") | ||
fmt.Println("") | ||
fmt.Println("\topenssl s_client -servername www.airdb.com -connect www.airdb.com:443 </dev/null 2>/dev/null") | ||
fmt.Println("\tcert -f md www.airdb.com") | ||
fmt.Println("") | ||
fmt.Println("\tRefer: https://github.com/genkiroid/cert") | ||
fmt.Println(adblib.OpenSSLDoc) | ||
}, | ||
} | ||
|
||
|
@@ -194,12 +124,7 @@ var toolsCommand = &cobra.Command{ | |
Short: "tools command", | ||
Long: "tools command", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("tools") | ||
fmt.Println("") | ||
fmt.Println("\tasciinema play https://asciinema.org/a/349488") | ||
fmt.Println("\tdocker run --rm -v $PWD:/data asciinema/asciicast2gif -s 2 -t solarized-dark demo.json demo.gif") | ||
fmt.Println("") | ||
fmt.Println("wget https://github.com/airdb/init/releases/latest/download/tools-linux-amd64.zip") | ||
fmt.Println(adblib.ToolsDoc) | ||
}, | ||
} | ||
|
||
|
@@ -210,7 +135,6 @@ func initManCommand() { | |
manCommand.AddCommand(dockerInitCommand) | ||
manCommand.AddCommand(cloudInitCommand) | ||
manCommand.AddCommand(brewInitCommand) | ||
manCommand.AddCommand(githubInitCommand) | ||
manCommand.AddCommand(vimInitCommand) | ||
manCommand.AddCommand(osinitCommand) | ||
manCommand.AddCommand(kubeCommand) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
package adblib | ||
|
||
import ( | ||
"github.com/MakeNowJust/heredoc" | ||
) | ||
|
||
var ( | ||
MysqlDoc = heredoc.Doc(` | ||
$ mysql | ||
> ALTER TABLE xx_tab change status process int(10) | ||
> ALTER TABLE xx_tab modify status int(10) after id | ||
> ALTER TABLE xx_tab modify status varchar(600) NOT NULL | ||
SELECT DISTINCT column1, column2 FROM table_name; | ||
`) | ||
|
||
ToolsDoc = heredoc.Doc(` | ||
$ tools | ||
asciinema play https://asciinema.org/a/349488 | ||
docker run --rm -v $PWD:/data asciinema/asciicast2gif -s 2 -t solarized-dark demo.json demo.gif | ||
docker run --rm -v $PWD:/data asciinema/asciicast2gif -s 2 -t solarized-dark demo.json demo.gif | ||
`) | ||
|
||
HelmDoc = heredoc.Doc(` | ||
$ helm commands | ||
sudo apt update | ||
sudo apt install snapd | ||
sudo snap install helm --classic | ||
helm plugin install https://github.com/airdb/helm-kube | ||
helm repo add airdb https://www.airdb.com/helm/" | ||
helm repo update | ||
helm search repo helm/mychart | ||
helm show readme airdb/mychat | ||
helm install chart airdb/mychat | ||
helm install chart airdb/mychat --dry-run --debug | ||
helm get notes mychat | ||
`) | ||
|
||
TerraformDoc = heredoc.Doc(` | ||
$ terraform commands | ||
terraform -install-autocomplete | ||
terraform init -upgrade | ||
terraform validate | ||
terraform plan | ||
terraform apply | ||
#terraform destroy | ||
Refer: https://github.com/airdb/init/tree/master/terraform | ||
`) | ||
|
||
BrewDoc = heredoc.Docf(` | ||
$ Brew Common Command: | ||
brew outdated | ||
brew cask outdated | ||
brew outdated adb --verbose --debug | ||
brew install github/gh/gh | ||
brew install aliyun-cli | ||
brew tap aidb/taps | ||
brew install airdb/taps/adb | ||
brew install adb | ||
`) | ||
|
||
GithubDoc = heredoc.Docf(` | ||
$ Github or Git Command: | ||
1. Maintain a repo without permission | ||
git remote add upstream https://github.com/bfenetworks/bfe.git | ||
git fetch upstream | ||
git checkout develop | ||
git merge upstream/develop | ||
git rebase upstream/develop | ||
Refer: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork | ||
2. git config setting | ||
git config --global core.hooksPath .github/hooks | ||
git config --global core.excludefile .gitignore_global | ||
git config --global url.'ssh://[email protected]'.insteadOf https://github.com | ||
3. Github Commit. For Close Github Issue, commit message should as follow: | ||
close #x | ||
closes #x | ||
closed #x | ||
fix #x | ||
fixes #x | ||
fixed #x | ||
resolve #x | ||
resolves #x | ||
resolved #x | ||
add new quick sort algorithm, fixes #4, resolve #6, closed #12 | ||
4. Github Command Line | ||
brew install github/gh/gh | ||
gh --repo bbhj/lbs issue status | ||
gh --repo bbhj/lbs issue view 1 | ||
`) | ||
|
||
OpenSSLDoc = heredoc.Doc(` | ||
$ openssl commands | ||
openssl x509 -text -in ssl.chain.crt | ||
openssl req -noout -text -in ssl.csr | ||
openssl s_client -servername www.airdb.com -connect www.airdb.com:443 </dev/null 2>/dev/null | ||
cert -f md www.airdb.com | ||
Refer: https://github.com/genkiroid/cert | ||
`) | ||
) |
Oops, something went wrong.