Skip to content

Commit dcac982

Browse files
committed
Add 'Run ST2 actions, aliases, etc. via API in shell with auto-generated authentication token' section to README.md.
1 parent 222990d commit dcac982

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,16 @@ git checkout main # Ensure that you are on main br
4747
git tag -a vX.Y.Z -m "Annotation for this tag." # Semantic verison tag for version X.Y.Z to local (on current branch).
4848
git push --tags # Apply tag to remote.
4949
git ls-remote --tags # Display tags on remote.
50+
```
51+
52+
## Stackstorm
53+
54+
### Run ST2 actions, aliases, etc. via API in shell with auto-generated authentication token
55+
The ST2 [API](https://api.stackstorm.com/) is useful for prototyping and getting more detailed output than is possible when using the standard ST2 command-line tools. However, using the API requires an authentication token (or API key). You can create a simple shell script to auto-generate the token using your logged in ST2 account and set it to the `ST2_AUTH_TOKEN` environment variable.
56+
```bash
57+
ST2_AUTH_TOKEN=$(curl -X POST -k -u yourusername:'yourpassword' https://myhost.example.com/auth/v1/tokens | jq -r '."token"')
58+
```
59+
Now, to run an API command at the command line using this API token, just include the `ST2_AUTH_TOKEN` environment variable in the headers.
60+
```bash
61+
curl -H "X-Auth-Token: $ST2_AUTH_TOKEN" -k https://myhost.example.com/api/v1/actions
5062
```

Tmux_Tips.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ Frequently, you'll need to copy and paste text between windows or panes in Tmux.
105105

106106
This workflow works fine for copying and pasting from/to Vim editor instances running inside Tmux windows/panes.
107107

108+
## "Advanced" Copy/Paste in Tmux with `vi` mode
109+
Many Tmux users (myself included) prefer to use the so-called `vi` (or `vim`) mode in Tmux. (You can learn more about it [here](https://dev.to/iggredible/the-easy-way-to-copy-text-in-tmux-319g).) It allows you to use Vi/Vim style screen-based editing, especially for cut, copy, and paste operations. And it works (reasonably) well with mouse scrolling! To enable it, add the following lines to your `.tmux.conf` file:
110+
```
111+
set-option -g mouse on # Globally enable mouse support
112+
setw -g mode-keys vi # Globally enable vi mode
113+
set-option -s set-clipboard off # Disable
114+
```
115+
108116
## Install Tmux on Git for Windows
109117
[Git for Windows](https://gitforwindows.org/) is a special version of the [MSYS2](https://www.msys2.org/) with some customizations for better integration with Windows. In particular, in my experience, MSYS2 with Git does not work properly with [Visual Studio Code](https://code.visualstudio.com/), while Git for Windows works perfectly without any tweaking. However, Git for Windows version of MSYS2 does not include many of the other tools that are available in the standard MSYS2 installation, including Tmux. Nevertheless, we can install Tmux from the MSYS2 repositories with a little bit of effort.
110118

0 commit comments

Comments
 (0)