Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nficano/slackcat
Concatenate files(s), or stdin, directly to Slack. 🐈
https://github.com/nficano/slackcat
python shell slack slackbot sysadmin utilities
Last synced: 4 days ago
JSON representation
Concatenate files(s), or stdin, directly to Slack. 🐈
- Host: GitHub
- URL: https://github.com/nficano/slackcat
- Owner: nficano
- License: other
- Created: 2017-08-23T15:34:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-24T10:17:56.000Z (over 3 years ago)
- Last Synced: 2024-10-08T13:52:14.184Z (about 1 month ago)
- Topics: python, shell, slack, slackbot, sysadmin, utilities
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SlackCat
Concatenate files(s), or
stdin
, directly to Slack.
3-minute setup & no third-party integration required.
### Get SlackCat
Download using pip via pypi.
```bash
pip install slackcat
```Next, head to the [Slack Incoming WebHooks Configuration](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks), click
the ``Add Configuration`` button and set the default configuration values to your
liking. Once complete, copy the Webhook URL which we'll need in the next step.Open your ``~/.bash_profile`` file add following:
```bash
export SLACKCAT_WEBHOOK_URL="https://hooks.slack.com/services/TXXX/BXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"
```_Make sure to replace the "https://hooks.slack.com/services/..." with the one provided above._
### Usage
```bash
# - "Hey what's your public key dog?"
slackcat @doug ~/.ssh/id_rsa.pub# - "Do we still use that crypto library written by the Cheese Cake Factory?"
grep -r 'from cheesecake.factory import x509' ./ | slackcat @paul# - "Are you sure it's on your path?"
echo $PATH | slackcat "#general"# - "These queries filling up in syslog look suspicious"
tail -f /var/log/syslog | slackcat "#general" -f
```### Customization
If you would like to override the bot's username, add the following line to your ``~/.bash_profile`` file:
```bash
export SLACKCAT_USERNAME="abraham-linksys"
```If you would like to override the bot's icon image, add the following line to your ``~/.bash_profile`` file:
```bash
export SLACKCAT_ICON_URL="http://via.placeholder.com/500x500.png"
```### Development
Development of "SlackCat" is facilitated exclusively on GitHub. Contributions in the form of patches, tests and feature creation and/or requests are very welcome and highly encouraged. Please open an issue if this tool does not function as you'd expect.**How to release updates**
If this is the first time you're releasing to pypi, you'll need to run: ``pip install -r tests/dev_requirements.txt``.
Once complete, execute the following commands:
```bash
git checkout master
# Increment the version number and tag the release.
bumpversion [major|minor|patch]# Upload the distribution to PyPi
python setup.py sdist bdist_wheel upload# Since master often contains work-in-progress changes, increment the version
# to a patch release to prevent inaccurate attribution.
bumpversion --no-tag patchgit push origin master --tags
```