1
0
Fork 0
mirror of https://github.com/HackHerz/pusher synced 2025-12-06 02:10:19 +00:00

Examples section added

This commit is contained in:
Daniel Stein 2015-01-27 15:56:24 +01:00
parent 1b7439f60e
commit 9ca0833a48
3 changed files with 26 additions and 0 deletions

View file

@ -27,6 +27,8 @@ $ make install
## Usage ## Usage
If you want some real life use cases make sure to check out our [example section](https://github.com/hackherz/pusher/examples/).
### Basic usage ### Basic usage
```bash ```bash
$ pusher -i 1 "Hello World" # Send Hello World to device-id 1 $ pusher -i 1 "Hello World" # Send Hello World to device-id 1

8
examples/README.md Normal file
View file

@ -0,0 +1,8 @@
# Examples
This is a collection of examples how you can user pusher. Feel free to contact me or add it yourself if you have a snippet to share.
## Server
- [Notification on SSH login](https://github.com/hackherz/pusher/examples/ssh-notification.md)

View file

@ -0,0 +1,16 @@
# Notification on SSH login
Maybe you want to receive a notification every time someone logs into your server. Just post this snippet at the end of your **/etc/profile**.
```bash
# SSH-login notification
if [ -n "${SSH_CLIENT}" ]
then
TEXT="$(date "+%Y-%m-%d %H:%M:%S") ssh login to ${USER}@$(hostname -f)"
TEXT+=" from $(echo "${SSH_CLIENT}" | awk '{print $1}')"
pusher -i 297 "${TEXT}"
fi
```
Do not forget to change the id (297 in this example) to the one of your own device.