Skip to content

Instantly share code, notes, and snippets.

View raghuchinnannan's full-sized avatar
👋
Hello World!

Raghu Chinnannan raghuchinnannan

👋
Hello World!
View GitHub Profile
@raghuchinnannan
raghuchinnannan / letsencrypt_2019.md
Created March 10, 2020 02:48 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@raghuchinnannan
raghuchinnannan / discordwebhook.html
Created August 30, 2019 18:05
Sends messages using Discord webhooks.
<!DOCTYPE html>
<html>
<head>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel=
"stylesheet">
<link href=
"https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css"
rel="stylesheet">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Discord Webhook Sender</title>
@raghuchinnannan
raghuchinnannan / gist:3d00b836fbba102752e53d55047ce8a9
Created October 24, 2018 08:28 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@raghuchinnannan
raghuchinnannan / postman_install.sh
Created July 31, 2018 04:50 — forked from oleg-sh-test/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
@raghuchinnannan
raghuchinnannan / backup-mongodb-to-s3.sh
Created July 30, 2018 11:24 — forked from caraboides/backup-mongodb-to-s3.sh
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
#!/bin/sh
set -e
HOST=localhost
DB=test-entd-products
COL=asimproducts
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/"
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
S3LATEST=$S3PATH"latest".dump.gz
/usr/bin/aws s3 mb $S3PATH
@raghuchinnannan
raghuchinnannan / mongodb-s3-backup.sh
Created July 30, 2018 11:24 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh