-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
761 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6a48a5a31a32d549b221242fe25ad58d8413c400 | ||
b8eb880db6835040a6c10edfc78c711a53067b33 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
2021-12-07 | ||
2022-01-04 |
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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# [ | ||
> Check file types and compare values. | ||
> Returns 0 if the condition evaluates to true, 1 if it evaluates to false. | ||
> More information: <https://www.gnu.org/software/coreutils/test>. | ||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-test>. | ||
- Test if a given variable is equal to a given string | ||
`[ "{{$VARIABLE}}" == "{{/bin/zsh}}" ]` | ||
- Test if a given variable is equal/not equal to the specified string | ||
`[ "${{variable}}" {{==|!=}} "{{string}}" ]` | ||
|
||
- Test if a given variable is empty | ||
`[ -z "{{$GIT_BRANCH}}" ]` | ||
- Test if a given variable is [eq]ual/[n]ot [e]qual/[g]reater [t]han/[l]ess [t]han/[g]reater than or [e]qual/[l]ess than or [e]qual to the specified number | ||
`[ "${{variable}}" -{{eq|ne|gt|lt|ge|le}} {{integer}} ]` | ||
|
||
- Test if a file exists | ||
`[ -f "{{path/to/file}}" ]` | ||
- Test if the specified variable has a non-empty value | ||
`[ -n "${{variable}}" ]` | ||
|
||
- Test if a directory does not exist | ||
`[ ! -d "{{path/to/directory}}" ]` | ||
- Test if the specified variable has an empty value | ||
`[ -z "${{variable}}" ]` | ||
|
||
- If-else statement | ||
`[ {{condition}} ] && {{echo "true"}} || {{echo "false"}}` | ||
- Test if the specified file exists | ||
`[ -f {{path/to/file}} ]` | ||
|
||
- Test if the specified directory exists | ||
`[ -d {{path/to/directory}} ]` | ||
|
||
- Test if the specified file or directory exists | ||
`[ -e {{path/to/file_or_directory}} ]` |
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,28 @@ | ||
# [[ | ||
> Check file types and compare values. | ||
> Returns 0 if the condition evaluates to true, 1 if it evaluates to false. | ||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-_005b_005b>. | ||
- Test if a given variable is equal/not equal to the specified string | ||
`[[ ${{variable}} {{==|!=}} "{{string}}" ]]` | ||
|
||
- Test if a given string conforms the specified glob/regex | ||
`[[ ${{variable}} {{==|=~}} {{pattern}} ]]` | ||
|
||
- Test if a given variable is [eq]ual/[n]ot [e]qual/[g]reater [t]han/[l]ess [t]han/[g]reater than or [e]qual/[l]ess than or [e]qual to the specified number | ||
`[[ ${{variable}} -{{eq|ne|gt|lt|ge|le}} {{integer}} ]]` | ||
|
||
- Test if the specified variable has a non-empty value | ||
`[[ -n ${{variable}} ]]` | ||
|
||
- Test if the specified variable has an empty value | ||
`[[ -z ${{variable}} ]]` | ||
|
||
- Test if the specified file exists | ||
`[[ -f {{path/to/file}} ]]` | ||
|
||
- Test if the specified directory exists | ||
`[[ -d {{path/to/directory}} ]]` | ||
|
||
- Test if the specified file or directory exists | ||
`[[ -e {{path/to/file_or_directory}} ]]` |
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,15 @@ | ||
# colorls | ||
> A Ruby gem that beautifies the terminal's ls command, with color and font-awesome icons. | ||
> More information: <https://github.com/athityakumar/colorls>. | ||
- List files one per line | ||
`colorls -1` | ||
|
||
- List all files, including hidden files | ||
`colorls --all` | ||
|
||
- Long format list (permissions, ownership, size, and modification date) of all files | ||
`colorls --long --all` | ||
|
||
- Only list directories | ||
`colorls --dirs` |
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,18 @@ | ||
# daps | ||
> DAPS is an open source program for transforming DocBook XML into output formats such as HTML or PDF. | ||
> More information: <https://opensuse.github.io/daps/doc/index.html>. | ||
- Check if a DocBook XML file is valid | ||
`daps -d {{path/to/file.xml}} validate` | ||
|
||
- Convert a DocBook XML file into PDF | ||
`daps -d {{path/to/file.xml}} pdf` | ||
|
||
- Convert a DocBook XML file into a single HTML file | ||
`daps -d {{path/to/file.xml}} html --single` | ||
|
||
- Display help | ||
`daps --help` | ||
|
||
- Display version | ||
`daps --version` |
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,21 @@ | ||
# declare | ||
> Declare variables and give them attributes. | ||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins>. | ||
- Declare a string variable with the specified value | ||
`declare {{variable}}="{{value}}"` | ||
|
||
- Declare an integer variable with the specified value | ||
`declare -i {{variable}}="{{value}}"` | ||
|
||
- Declare an array variable with the specified value | ||
`declare {{variable}}=({{item_a item_b item_c}})` | ||
|
||
- Declare an associative array variable with the specified value | ||
`declare -A {{variable}}=({{[key_a]=item_a [key_b]=item_b [key_c]=item_c}})` | ||
|
||
- Declare a readonly string variable with the specified value | ||
`declare -r {{variable}}="{{value}}"` | ||
|
||
- Declare a global variable within a function with the specified value | ||
`declare -g {{variable}}="{{value}}"` |
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,27 @@ | ||
# doctl apps | ||
> Used to manage digitalocean apps. | ||
> More information: <https://docs.digitalocean.com/reference/doctl/reference/apps>. | ||
- Create an app | ||
`doctl apps create` | ||
|
||
- Create a deployment for a specific app | ||
`doctl apps create-deployment {{app_id}}` | ||
|
||
- Delete an app interactively | ||
`doctl apps delete {{app_id}}` | ||
|
||
- Get an app | ||
`doctl apps get` | ||
|
||
- List all apps | ||
`doctl apps list` | ||
|
||
- List all deployments from a specific app | ||
`doctl apps list-deployments {{app_id}}` | ||
|
||
- Get logs from a specific app | ||
`doctl apps logs {{app_id}}` | ||
|
||
- Update a specific app with a given app spec | ||
`doctl apps update {{app_id}} --spec {{path/to/spec.yml}}` |
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,12 @@ | ||
# doctl balance | ||
> Show the balance of a Digital Ocean account. | ||
> More information: <https://docs.digitalocean.com/reference/doctl/reference/balance/>. | ||
- Get balance of the account associated with the current context | ||
`doctl balance get` | ||
|
||
- Get the balance of an account associated with an access token | ||
`doctl balance get --access-token {{access_token}}` | ||
|
||
- Get the balance of an account associated with a specified context | ||
`doctl balance get --context` |
12 changes: 12 additions & 0 deletions
12
fastHistory/tldr/tldr/pages/common/doctl-compute-droplet.md
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,12 @@ | ||
# doctl compute droplet | ||
> List, create, and delete virtual machines which are called droplets. | ||
> More information: <https://docs.digitalocean.com/reference/doctl/reference/compute/droplet/>. | ||
- Create a droplet | ||
`doctl compute droplet create --region {{region}} --image {{os_image}} --size {{vps_type}} {{droplet_name}}` | ||
|
||
- Delete a droplet | ||
`doctl compute droplet delete {{droplet_id|droplet_name}}` | ||
|
||
- List droplets | ||
`doctl compute droplet list` |
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,15 @@ | ||
# exercism | ||
> Download and solve problems from the command-line. | ||
> More information: <https://exercism.org/docs/using/solving-exercises/working-locally>. | ||
- Configure the application token and the preferred workspace for Exercism | ||
`exercism configure --token={{your-application-token}} --workspace={{/path/to/preferred/workspace}}` | ||
|
||
- Download a specific exercise | ||
`exercism download --exercise={{exercise_slug}} --track={{track_slug}}` | ||
|
||
- Submit an exercise | ||
`exercism submit {{path/to/file}}` | ||
|
||
- Print the path to the solution workspace | ||
`exercism workspace` |
7 changes: 7 additions & 0 deletions
7
fastHistory/tldr/tldr/pages/common/git-delete-merged-branches.md
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,7 @@ | ||
# git delete-merged-branches | ||
> Delete branches that are listed in `git branch --merged` excluding master. | ||
> Part of `git-extras`. | ||
> More information: <https://github.com/tj/git-extras/blob/master/Commands.md#git-delete-merged-branches>. | ||
- Delete merged branches | ||
`git delete-merged-branches` |
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,16 @@ | ||
# git filter-repo | ||
> A versatile tool for rewriting Git history. | ||
> See also: `bfg`. | ||
> More information: <https://github.com/newren/git-filter-repo>. | ||
- Replace a sensitive string in all files | ||
`git filter-repo --replace-text <(echo '{{find}}==>{{replacement}}')` | ||
|
||
- Extract a single folder, keeping history | ||
`git-filter-repo --path {{path/to/folder}}` | ||
|
||
- Remove a single folder, keeping history | ||
`git-filter-repo --path {{path/to/folder}} --invert-paths` | ||
|
||
- Move everything from sub-folder one level up | ||
`git-filter-repo --path-rename {{path/to/folder/:}}` |
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,16 @@ | ||
# git mr | ||
> Check out GitLab merge requests locally. | ||
> Part of `git-extras`. | ||
> More information: <https://github.com/tj/git-extras/blob/master/Commands.md#git-mr>. | ||
- Check out a specific merge request | ||
`git mr {{mr_number}}` | ||
|
||
- Check out a merge request from a specific remote | ||
`git mr {{mr_number}} {{remote}}` | ||
|
||
- Checkout a merge request from its URL | ||
`git mr {{url}}` | ||
|
||
- Clean up old merge request branches | ||
`git mr clean` |
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,18 @@ | ||
# glab repo | ||
> Work with GitLab repositories on the command-line. | ||
> More information: <https://glab.readthedocs.io/en/latest/repo/index.html#synopsis>. | ||
- Create a new repository (if the repository name is not set, the default name will be the name of the current directory) | ||
`glab repo create {{name}}` | ||
|
||
- Clone a repository | ||
`glab repo clone {{owner}}/{{repository}}` | ||
|
||
- Fork and clone a repository | ||
`glab repo fork {{owner}}/{{repository}} --clone` | ||
|
||
- View a repository in the web browser | ||
`glab repo view {{owner}}/{{repository}} --web` | ||
|
||
- Search some repositories in the GitLab instance | ||
`glab repo search -s {{search_string}}` |
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 |
---|---|---|
@@ -1,22 +1,28 @@ | ||
# if | ||
> Simple shell conditional. | ||
> Performs conditional processing in shell scripts. | ||
> See also: `test`, `[`. | ||
> More information: <https://www.tcl.tk/man/tcl8.6.11/TclCmd/if.html>. | ||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Conditional-Constructs>. | ||
- Execute two different commands based on a condition | ||
`if {{command}}; then {{echo "true"}}; else {{echo "false"}}; fi` | ||
- Execute the specified commands if the condition command's exit status is zero | ||
`if {{condition_command}}; then {{echo "Condition is true"}}; fi` | ||
|
||
- Check if a variable is defined | ||
`if [[ -n "{{$VARIABLE}}" ]]; then {{echo "defined"}}; else {{echo "not defined"}}; fi` | ||
- Execute the specified commands if the condition command's exit status is not zero | ||
`if ! {{condition_command}}; then {{echo "Condition is true"}}; fi` | ||
|
||
- Check if a file exists | ||
`if [[ -f "{{path/to/file}}" ]]; then {{echo "true"}}; else {{echo "false"}}; fi` | ||
- Execute the first specified commands if the condition command's exit status is zero otherwise execute the second specified commands | ||
`if {{condition_command}}; then {{echo "Condition is true"}}; else {{echo "Condition is false"}}; fi` | ||
|
||
- Check if a directory exists | ||
`if [[ -d "{{path/to/directory}}" ]]; then {{echo "true"}}; else {{echo "false"}}; fi` | ||
- Check whether a file exists | ||
`if [[ -f {{path/to/file}} ]]; then {{echo "Condition is true"}}; fi` | ||
|
||
- Check if a file or directory exists | ||
`if [[ -e "{{path/to/file_or_directory}}" ]]; then {{echo "true"}}; else {{echo "false"}}; fi` | ||
- Check whether a directory exists | ||
`if [[ -d {{path/to/directory}} ]]; then {{echo "Condition is true"}}; fi` | ||
|
||
- Check whether a file or directory exists | ||
`if [[ -e {{path/to/file_or_directory}} ]]; then {{echo "Condition is true"}}; fi` | ||
|
||
- Check whether a variable is defined | ||
`if [[ -n "${{variable}}" ]]; then {{echo "Condition is true"}}; fi` | ||
|
||
- List all possible conditions (`test` is an alias to `[`; both are commonly used with `if`) | ||
`man [` |
Oops, something went wrong.