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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Resource": "arn:aws:logs:*:*:log-group:/aws/lambda/*:*:*", |
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
#!/bin/bash | |
$ git clone https://github.com/PortaText/nasanews-shortcode-serverless | |
$ cd nasanews-shortcode-serverless/ | |
$ npm install | |
$ bin/package.sh |
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
#!/bin/bash | |
./configure --with-ld-opt="-L/my/ssl/location" |
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
{"level":"INFO","message":"some message"} | |
{"level":"DEBUG","message":"some message"} | |
{"level":"ERROR","message":"some message"} | |
{"level":"WARN","message":"some message"} |
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
[DEBUG] - some message | |
[INFO] - some message | |
[WARN] - some message | |
[ERROR] - some message |
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
'use strict'; | |
var url = require('url'); | |
var target = 'http://www.yourwebsite.com'; // Change this one | |
exports.handler = function(event, context, callback) { | |
var urlObject = url.parse(target); | |
var mod = require( | |
urlObject.protocol.substring(0, urlObject.protocol.length - 1) | |
); |
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
SET GLOBAL event_scheduler = ON; # In the MySQL CLI | |
event_scheduler=DISABLED # or OFF, or 0, or ON, or 1 in the [mysqld] section of your my.cnf file | |
--event-scheduler=DISABLED # or OFF, or 0, or ON, or 1 when starting your mysql daemon |
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
CREATE TABLE `session` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`last_activity` int(11) NOT NULL, | |
`token` varchar(64) NOT NULL, | |
`user_id` int(11) NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `session_client_token` (`token`), | |
KEY `session_per_client_id` (`user_id`), | |
CONSTRAINT `session_per_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
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
CREATE EVENT `remove_sessions_production` | |
ON SCHEDULE EVERY 1 MINUTE | |
DO DELETE FROM `production_db`.`session` WHERE UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - `last_activity` > 1800; |
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
#!/bin/bash | |
npm install | |
zip -r transcoder.zip * |