Skip to content

Instantly share code, notes, and snippets.

View rbalman's full-sized avatar

Balman Rawat rbalman

View GitHub Profile
FROM ubuntu
RUN apt-get update
RUN apt-get install nginx -y
COPY index.html /var/www/html/
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
@nirdosh17
nirdosh17 / delete_cloudformation_stacks.sh
Last active December 13, 2019 04:14
Delete matching Cloudformation stacks in descending order of created time (latest first)
#!/bin/bash
# Prerequisites:
# 1. Install jq: `brew install jq` for mac
# 2. Make sure env vars AWS_PROFILE and AWS_REGION are exported correctly
# ------------ USAGE -----------------
# ❯❯❯ bash <(curl -s https://gist.githubusercontent.com/nirdosh17/2a2680417dd06050cd584a0df7b59b5c/raw)
function del_stack() {
@tfentonz
tfentonz / describe-rules.md
Last active June 13, 2023 10:44
AWS CLI command to list ELB listener rule priorities

Get load balancer ARN

arn=$(aws elbv2 describe-load-balancers --names <value> --query 'LoadBalancers[].[LoadBalancerArn]' --output text)

Get listeners

aws elbv2 describe-listeners --load-balancer-arn "$arn" --query 'Listeners[].{ListenerArn:ListenerArn,Protocol:Protocol,Port:Port}'

[
@windsting
windsting / nginx-stat-failed-13-permission-denied.md
Last active May 6, 2024 06:43
fix: Nginx: stat() failed (13: permission denied)

Nginx: stat() failed (13: permission denied)

from https://stackoverflow.com/questions/25774999/nginx-stat-failed-13-permission-denied

Nginx operates within the directory, so if you can't cd to that directory from the nginx user then it will fail (as does the stat command in your log). Make sure the www-user can cd all the way to the /username/test/static. You can confirm that the stat will fail or succeed by running

sudo -u www-data stat /username/test/static
@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
Create a Cognito Authentication Backend via CloudFormation
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:
@belminf
belminf / cloudfront_distro.yaml
Created April 26, 2017 23:20
Example of an empty S3OriginConfig
AWSTemplateFormatVersion: 2010-09-09
Resources:
Bucket:
Type: 'AWS::S3::Bucket'
Properties:
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: error.html
Distro:
@craigvantonder
craigvantonder / flush-dns.sh
Last active February 3, 2021 04:42
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# NB: First install nscd with sudo apt-get install nscd
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
@ajaxray
ajaxray / firebase-online-user-count-example.md
Last active July 18, 2022 09:57
Keep list (and count) of online users in a Firebase web app - by isolated rooms or globally

Gathering.js - How to use

Keep list (and count) of online users in a Firebase web app - by isolated rooms or globally.

Live Demo

Firebase Shared Checklist is a demo application that shows the number of users joined a checklist using gathering.js. Here is a 1 minute screencast of using this application.

@md5
md5 / 00_README.md
Last active May 18, 2024 22:27
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: