Skip to content

Instantly share code, notes, and snippets.

View urwithajit9's full-sized avatar
🎯
Focusing on Blending AI & ML for Cyber Security and Malware Research

Ajit Kumar urwithajit9

🎯
Focusing on Blending AI & ML for Cyber Security and Malware Research
View GitHub Profile
@urwithajit9
urwithajit9 / deploy-django.md
Created September 30, 2024 02:17 — forked from rmiyazaki6499/deploy-django.md
Deploying a Production ready Django app on AWS

Deploying a Production ready Django app on AWS

In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
  • Continuous deployment with Github Actions/SSM Agent
#include <stdio.h>
#include <stdlib.h>
#define SIZE 1000
char* base64Encoder(char input_str[], int len_str)
{
char char_set[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
char *res_str = (char *) malloc(SIZE * sizeof(char));
int index, no_of_bits = 0, padding = 0, val = 0, count = 0, temp;
int i, j, k = 0;
/*Program to demostrate Chaining in
1. Storing Students' infroamtion
2. Printing all the stored records
Note: roll is a 6 digits nubmer ex. 136001
Created by: Dr. Ajit Kumar
Email: ajitkumar.pu@gmail.com
Date: 14-04-2019
*/
#include<stdio.h>
#include<string.h>
/*Program to demostrate Chaining in
1. Storing Students' infroamtion
2. Searching based on roll number.
Note: roll is a 6 digits nubmer ex. 136001
Created by: Dr. Ajit Kumar
Email: ajitkumar.pu@gmail.com
Date: 14-04-2019
*/
#include<stdio.h>
#include<string.h>
// Division hashing
int division_method(int x, int m)
{
return x % m;
}
// Multiplication hashing
int h(int k, int m)
{
return floor(m * (k*A - floor(k*A)));
}
/* Demo for quadratic-probing*/
#include<stdio.h>
#include<string.h>
#include<math.h>
#define A 0.6180339887
int h(int k, int m)
{
return floor(m * (k*A - floor(k*A)));
int quadratic_probing(struct student hashtable[], int loc, int m)
{
int i=1;
while(i <= m -1 && loc < m-1)
{
if(hashtable[loc].roll_no == 0)
{
return loc;
}
/*Program to demostrate Linear probing in
1. Storing Students' infroamtion
2. Searching based on roll number.
Note: roll is a 6 digits nubmer ex. 136001
Created by: Dr. Ajit Kumar
Email: ajitkumar.pu@gmail.com
Date: 11-04-2019
*/
#include<stdio.h>
#include<string.h>
/*Program to use Hash function
1. to store Students' infroamtion
2. and search based on roll number.
Note: roll is a 6 digits nubmer ex. 136001
Created by: Dr. Ajit Kumar
Email: ajitkumar.pu@gmail.com
Date: 9-04-2019
*/
#include<stdio.h>
/*Program to store Students' infroamtion
and search based on roll number.
Note: roll is a 6 digits nubmer ex. 136001
Created by: Dr. Ajit Kumar
Email: ajitkumar.pu@gmail.com
Date: 9-04-2019
*/
#include<stdio.h>