Install Redis On Amazon Linux 2
- Update the system packages:
sudo yum update -y
- Install the Redis package using the Amazon Linux Extra Packages for Enterprise Linux (EPEL) repository
Install Redis On Amazon Linux 2
sudo yum update -y
const getAll = async () => { | |
let result, accumulated, ExclusiveStartKey; | |
do { | |
result = await DynamoDB.query({ | |
TableName: argv.table, | |
ExclusiveStartKey, | |
Limit: 100, | |
KeyConditionExpression: 'id = :hashKey and date > :rangeKey' | |
ExpressionAttributeValues: { |
### Setup | |
const AWS = require("aws-sdk") // Or use `import` syntax for Typescript and newer ES versions | |
const dynamoDB = new AWS.DynamoDB({ | |
region: "us-east-1" | |
}) | |
// Or |
Suppose you have two heroku remote apps | |
myapp-dev & myapp-prod | |
and two git branches | |
master(for dev) & production | |
Now lets setup heroku on the existing git repo in your local machine | |
Assuming the branches and the apps exist already | |
git remote add heroku-myapp-dev https://git.heroku.com/myapp-dev.git | |
git remote add heroku-myapp-prod https://git.heroku.com/myapp-prod.git | |
1. SSH to EC2 server and open/edit below file | |
vi /etc/environment | |
2. Add these lines | |
LANG=en_US.utf-8 | |
LC_ALL=en_US.utf-8 | |
3. Exit terminal and connect again, Done |
{ | |
"Version": "2012-10-17", | |
"Statement": [{ | |
"Effect": "Deny", | |
"Action": "*", | |
"Resource": "*", | |
"Condition": { | |
"StringNotEquals": { | |
"aws:RequestedRegion": [ | |
"eu-central-1", |
200 OK: Success | |
201 Created: Created one or more resource(s). | |
204 No Content: The server has successfully fulfilled the request. | |
400 Bad Request: The web-service request was invalid. | |
401 Unauthorized: Authentication failed! Invalid credentials. | |
403 Forbidden: Requested a resource to which the server does not allow access. | |
404 Not Found: Requested resource not found. | |
415 Unsupported Media Type: The requested payload format is in an unsupported format. | |
429 Too Many Request: User has sent too many requests in a given amount of time. | |
500 Internal Server Error: An internal server error occurred while processing the request. |
# Replace local branch with remote branch entirely | |
git reset --hard origin/master | |
# Remove ignored files - select option as requied | |
git rm -r -f --cache node_modules | |
# Rever last commit | |
git reeset head~1 |
/// <binding AfterBuild='default' /> | |
var gulp = require('gulp'); | |
var htmlmin = require('gulp-htmlmin'); | |
var useref = require('gulp-useref'); | |
var gulpRename = require('gulp-rename'); | |
var cacheBuster = require('gulp-cache-bust'); | |
var uglify = require('gulp-uglify'); | |
var cssnano = require('gulp-cssnano'); | |
var lazypipe = require('lazypipe'); | |
var sourcemaps = require('gulp-sourcemaps'); |
For AWS EC2 | |
create Role : aws-ec2-jenkins-role | |
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add - | |
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list | |
sudo apt-get update | |
sudo apt-get install jenkins | |
sudo systemctl start jenkins | |
sudo systemctl status jenkins |