Direct copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Resources: | |
MyFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
InlineCode: | | |
exports.handler = async () => { |
AWSTemplateFormatVersion: 2010-09-09 | |
Description: 'authentication: Resources for hosting authentication using AWS Cognito, a @wolfeidau template' | |
Parameters: | |
AppName: | |
Description: Name of application, used in signup emails and naming of aws resources. | |
Type: String | |
AllowedPattern: '^[a-zA-Z0-9]*$' |
//updated for 2.0.0-preview-11 | |
import java.io.ByteArrayInputStream; | |
import java.net.URI; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.util.Optional; | |
import software.amazon.awssdk.auth.signer.AwsS3V4Signer; | |
import software.amazon.awssdk.auth.signer.internal.AwsSignerExecutionAttribute; |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Cognito Stack | |
Parameters: | |
AuthName: | |
Type: String | |
Description: Unique Auth Name for Cognito Resources | |
Resources: | |
# Creates a role that allows Cognito to send SNS messages | |
SNSRole: |
Direct copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4 |
/// Generate thumbnail with AVAssetImageGenerator | |
func generateThumbnailFromAsset(asset: AVAsset, forTime time: CMTime) -> UIImage { | |
let imageGenerator = AVAssetImageGenerator(asset: asset) | |
imageGenerator.appliesPreferredTrackTransform = true | |
var actualTime: CMTime = kCMTimeZero | |
do { | |
let imageRef = try imageGenerator.copyCGImageAtTime(time, actualTime: &actualTime) | |
let image = UIImage(CGImage: imageRef) | |
return image | |
} catch let error as NSError { |
#!/bin/bash | |
# This script will find all AWS CloudFormation stacks matching the supplied filter | |
# and export the outputs into environment variables. | |
# | |
# This script is assumed to be run on a host with an IAM profile matching the following: | |
# | |
# { | |
# "Version": "2012-10-17", | |
# "Statement": [ |
1 - Download the RDS certificates (root plus region-specific intermediate ones) bundle:
wget -O config/rds-combined-ca-bundle.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
2 - Add config/rds-combined-ca-bundle.pem
to the repository and redeploy to Heroku.
3 - Update the DATABASE_URL
env var:
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML. | |
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/ | |
export DOCKER_USER=Type your dockerhub username, same as when you `docker login` | |
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login` | |
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login` | |
kubectl create secret docker-registry myregistrykey \ | |
--docker-server=$DOCKER_REGISTRY_SERVER \ | |
--docker-username=$DOCKER_USER \ |