Skip to content

Instantly share code, notes, and snippets.

View onkar-indellient's full-sized avatar
🏠
Working from home

Onkar Singh onkar-indellient

🏠
Working from home
View GitHub Profile
# Install Flask
pip install flask
# Run the python Flask Application locally
python ./application.py
@onkar-indellient
onkar-indellient / requirements.txt
Created August 4, 2022 15:02
requirements.txt
Flask==2.0.1
from flask import Flask
application = Flask(__name__)
@application.route("/")
def hello():
return "Welcome to Onkar's Sample Python Flask App"
if __name__ == "__main__":
application.run(host='127.0.0.1', port=5000, debug=True)
@onkar-indellient
onkar-indellient / 4_renew_certificate_cron_job.config
Created August 4, 2022 15:01
4_renew_certificate_cron_job.config
files:
/tmp/renew_ssl_cron:
mode: "000777"
owner: root
group: root
content: |
0 3,15 * * * certbot renew --no-self-upgrade
container_commands:
1_create_cert_crontab:
@onkar-indellient
onkar-indellient / 3_grant_exec_permission.config Final
Created August 4, 2022 15:01
3_grant_exec_permission.config Final
container_commands:
00_permission_hook:
command: "chmod +x .platform/hooks/postdeploy/1_generate_certificate.sh"
01_permission_hook2:
command: "chmod +x .platform/hooks/postdeploy/01_update_filesize_nginx.sh"
@onkar-indellient
onkar-indellient / 3_grant_exec_permission.config Initial
Created August 4, 2022 15:01
3_grant_exec_permission.config Initial
container_commands:
00_permission_hook:
command: "chmod +x .platform/hooks/postdeploy/1_generate_certificate.sh"
@onkar-indellient
onkar-indellient / 2_update_filesize_nginx.sh
Created August 4, 2022 15:00
2_update_filesize_nginx.sh
#!/usr/bin/env bash
sudo sed -i 's/client_header_timeout/client_max_body_size 20M;\n client_header_timeout/g' /etc/nginx/nginx.conf
sudo nginx -s reload
echo nginx config update complete
@onkar-indellient
onkar-indellient / 2_open_port_443.config
Created August 4, 2022 15:00
2_open_port_443.config
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
FromPort: 443
CidrIp: 0.0.0.0/0
@onkar-indellient
onkar-indellient / 1_install_dependencies.config
Created August 4, 2022 14:59
1_install_dependencies.config
container_commands:
00_download_epel:
command: "sudo wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/"
ignoreErrors: true
10_install_epel_release:
command: "sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm"
ignoreErrors: true
20_enable_epel:
command: "sudo yum-config-manager --enable epel*"
ignoreErrors: true
#!/usr/bin/env bash
sudo certbot -n -d YOUR_DOMAIN_NAME --nginx --agree-tos --email YOUR_EMAIL