Serverless Slackbots Powered by AWS

Today Localytics is open sourcing two tools that help you quickly scaffold custom Slack commands using AWS Lambda, AWS API Gateway, and the Serverless framework. These tools grew out of our continued investment in making ChatOps the primary way Localytics engineers manage our infrastructure. With Serverless and a small bit of scaffolding, we’re now able to create custom Lambda functions that handle slash commands from Slack in about 10 minutes.

ChatOps and AWS Lambda

ChatOps helps break down silos by making infrastructure management a collaborative process. Our engineering team is able to quickly see activity from our systems and tools within the same stream of information as the general discussion amongst the team about their daily work. Our chat service of choice – Slack – provides convenient integration points with their slash commands utility.

AWS Lambda is a natural fit for implementing slash commands because of its event-based architecture. Since we are deployed on AWS we also get to leverage the integrations that Lambdas have with other pieces of the AWS puzzle, like S3 event notifications and DynamoDB streams. The Serverless framework helps fill in some of the gaps that Lambda has with its development and deployment workflow. Serverless lets you set up lifecycle stages that bind together your Lambda functions along with their dependent AWS resources, so you can easily promote code from dev to test to prod. Serverless also has an active and responsive community that is great to work with.

serverless-slackbot-scaffold and lambda-slack-router

For scaffolding we’ve built our serverless-slackbot-scaffold. This is a khaos template, which is a handy utility package that uses handlebar templates to scaffold projects. The README of the repository describes the process for installing and running the templating engine. Once the new directory has been created, you’ll see a sparse serverless app, featuring a nodejs component (a Serverless structure with a specified runtime) that contains a slackbot function (representing a lambda function).

Over the course of developing our own projects, we realized common patterns were emerging around routing subcommands to the correct functions. As a result, you’ll notice that the package.json file in the nodejs directory requests an additional package besides the default Serverless dependencies, which is the lambda-slack-router package. This package’s easy DSL allows us to quickly manipulate the JSON payload coming from Slack, verify the integrity against a predefined token, and call the correct subcommand. This means we’re not restricted to commands like “/bot” but have easy access to “/bot ping”, “/bot echo”, and so on. With this package in place, the only part of this bot that needs editing is the actual business logic of the Lambda. Example routers are provided in the scaffold repository to get you started.

Once the business logic is written, we’re free to deploy to AWS. Following the deployment steps from the templated project’s README we can deploy the function to a specific stage (our template contains the test, dev, and prod stages pre-configured), acquire the postback URL, and put that into the Slack configuration. Once everything has resolved, you can use the “/bot help” prebuilt command to see how to use your new bot.

Lessons learned

The Serverless framework has aided us immeasurably in handling development and deployment of our functions, as well as brought a sense of pre-defined structure to our projects. Over the course of using Serverless, we’ve explored (and contributed to) a number of the available plugins which can be quickly implemented to augment Serverless’ abilities. As Serverless and its ecosystem continues to grow, developing Lambda functions is going to become even easier than it is now.

Feel free to use our scaffold and router for yourself to develop your own Slack integrations, and when you do please share your experience, approach, and any feedback in a gist, on a blog, or in the comments.

Photo credit: “Robots” by sneakerzoom is licensed under CC BY 2.0

Original URL:  

Original article

Google Docs now exports to ePub format


Google Docs has a new option allowing your documents to be saved directly to the ePub format.

All you have to do is click File > Download as > EPUB Publication. EPUB documents are widely supported across most ebook readers, so this could be a good choice for sharing your work with others.

The format isn’t as well supported on Windows, but Cool Reader is an open-source cross-platform viewer which handles ePubs and many other formats: FB2, MOBI, PDF, more.

Google’s official announcement of the update is here.

Original URL:  

Original article

Google Docs: A quick way to get ePub from a Docs or Word file or other common formats


If you want a quick-and-dirty way to turn a Google Docs file into ePub, then Google has a solution—a new feature that lets you export into that format.

Using Word instead? No problem. You could import Word into Google Docs, then export from there (the format must be newer than the one for the Microsoft 95 version of Word).

Among other major importable formats for Google Docs are HTML, .txt and .odt.

No, Random House isn’t likely to rely soon on Google Docs’s ePub export. But if you’ve just finished your novel or Ph.D. dissertation and want to beta-test it on friend, then Google Docs’ ePub capability could be handy.

Same if you’ve written a corporate training manual that you want employees to be able to read on their iPads or iPhones.

I tested this with a copy of The Adventures of Huckberry Finn in the text format from Project Gutenberg, and sure enough the results were readable in Calibre and Marvin on my iPad. Line breaks went astray. But I could have cleaned that up before the conversion (I’m in a hurry).

Here’s the command to reach the ePub export feature of Google Docs: File menu > Download as > EPUB Publication (.epub).

OK, good job, Google. Now when are you going to give us not just an ePub exporter but also stellar ePub editor?

Reminder: For more polished ePub for free, you could try Sigil.

The post Google Docs: A quick way to get ePub from a Docs or Word file or other common formats appeared first on TeleRead News: E-books, publishing, tech and beyond.

Original URL:  

Original article

Project issues 1 million free digital certificates in three months

Let’s Encrypt, an organization set up to encourage broader use of encryption on the Web, has distributed 1 million free digital certificates in just three months.

The digital certificates cover 2.5 million domains, most of which had never implemented SSL/TLS (Secure Sockets Layer/Transport Layer Security), which encrypts content exchanged between a system and a user. An encrypted connection is signified in most browsers by “https” and a padlock appearing in the URL bar.

“Much more work remains to be done before the Internet is free from insecure protocols, but this is substantial and rapid progress,” according to a blog post by the Electronic Frontier Foundation, one of Let’s Encrypt’s supporters.

To read this article in full or to leave a comment, please click here

Original URL:  

Original article

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: