Skip to content

Instantly share code, notes, and snippets.

@ogre-yoga
ogre-yoga / aws-linux_ec2_docker_container.md
Last active November 11, 2024 11:47
Pull and run Docker image on Amazon Linux EC2 instance

Pull and run docker image on Amazon Linux EC2 instance

Install and run Docker service

  1. SSH in $ ssh -i [PRIVATE_KEY.PEM] ec2-user@[EC2_DNS_HOSTNAME]
  2. Update OS and packages $ sudo yum update
  3. Install Docker $ sudo yum install -y docker
  4. Start Docker
@djm
djm / AuthorizerConfigurationException-problem.txt
Last active July 1, 2024 15:27
Fix for AWS API Gateway Custom Authorizer Error => AuthorizerConfigurationException (message: null)
Problem: you've created a Custom Authorizer Lambda and have hooked it up with Amazon AWS's API Gateway.
But now all of your responses return the following HTTP response with the "AuthorizerConfigurationException"
and your Cloudwatch logs for your Authorizer function are next to useless..
-----
HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Content-Length: 16
Content-Type: application/json
@Arunmainthan
Arunmainthan / downloadFile.js
Created December 20, 2019 14:26
Nodejs Express Download file from s3
const express = require('express');
const app = express();
const request = require('request');
app.get('/download-file', function (req, res) {
// sdk way
var s3 = new AWS.S3({});
var options = {
Bucket: 'my-bucket-name',
Key: file,
@angristan
angristan / single-node-es.md
Last active March 16, 2026 15:21
Elasticsearch settings for single-node cluster (1 shard, 0 replica)

Elasticsearch settings for single-node cluster

1 shard, 0 replica.

For future indices

Update default template:

curl -X PUT http://localhost:9200/_template/default -H 'Content-Type: application/json' -d '{"index_patterns": ["*"],"order": -1,"settings": {"number_of_shards": "1","number_of_replicas": "0"}}' 
@chrisidakwo
chrisidakwo / install-node.sh
Created August 31, 2018 11:24
Just another bash script to easily install node, npm and yarn on Ubuntu/Mac using nvm
#!/bin/sh
set -e
# Install node and npm via nvm - https://github.com/creationix/nvm
# Run this script like - bash script-name.sh
# Define versions
INSTALL_NODE_VER=10
INSTALL_NVM_VER=0.33.11
INSTALL_YARN_VER=1.7.0