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
wowza_stream_name = "wowza-stream-name" | |
youtube_host = "x.rtmp.youtube.com" | |
youtube_application = "livex" | |
youtube_stream_name = "xxxxx.xxxx-xxxx-xxxx-xxxx" | |
stream_target = "curl --digest -u \"wowza:#{stream_server.instance_id}\" -X POST --header \"Accept:application/json; charset=utf-8\" --header \"Content-type:application/json; charset=utf-8\" \"#{wowza_host}/pushpublish/mapentries/youtube\" -d '{ | |
\"restURI\": \"#{wowza_host}/pushpublish/mapentries/youtube\", | |
\"serverName\":\"_defaultServer_\", | |
\"sourceStreamName\": \"#{wowza_stream_name}\", | |
\"entryName\": \"youtube\", |
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
# Get Access Token | |
refresh_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
access_token = JSON.parse( | |
RestClient.post("https://accounts.google.com/o/oauth2/token", { | |
client_id: Rails.application.secrets.google_client_id, | |
client_secret: Rails.application.secrets.google_client_secret, | |
refresh_token: refresh_token, grant_type: "refresh_token" | |
}) |
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
robot.respond /accumulate this request to my account/i, (msg) -> | |
user_id = msg.message.user.id; user_name = msg.message.user.name | |
requests = robot.brain.get(user_id) | |
if requests == null | |
robot.brain.set(user_id, 1) | |
else | |
robot.brain.set(user_id, requests+1) | |
requests = robot.brain.get(user_id) | |
content = if requests > 5 | |
# User exceed limit |
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
1. Create a file called .bash_aliases using your favorite text editor. | |
gedit .bash_aliases | |
2. Write the alias you want to create, e.g: | |
alias update='sudo apt-get update' | |
3. Save the file and reconfigure your bashrc. | |
. ~/.bashrc | |
4. Check if your alias is added correctly. |
NewerOlder