Skip to content

Instantly share code, notes, and snippets.

View dinushchathurya's full-sized avatar
:octocat:
Coding

Dinush Chathurya dinushchathurya

:octocat:
Coding
View GitHub Profile
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
@dinushchathurya
dinushchathurya / Docker Commands
Last active January 18, 2021 11:48
Some Essential Docker Commands
/* Create Docker Image */
docker build -t <Folder-name>/<Image-name> .
/* Get All Docker Images */
docker images
/* Run Docker Container */
docker run -d -p <localhost-port>:<port-in-code> --name="<container-name>" <Folder-name><Image-Name>
/* Get All Running Containers */
@dinushchathurya
dinushchathurya / laravel
Last active April 19, 2021 04:05
Laravel
// Clear cache
php artisan config:cache
// Re-add class
composer dump-autoload
// Create seeder
php artisan make:seeder UserSeeder
// Migrating and inserting fake data from seeder to database
@dinushchathurya
dinushchathurya / Laravel AWS Deploy Commands
Last active June 3, 2021 19:06
This files includes all the command that you required to deploy Laravel on AWS
## Update server environment
`sudo apt-get update`
## Install PHP PPA on your server
`sudo add-apt-repository ppa:ondrej/php`
## Install required PHP packages
sudo apt update
sudo apt install apache2
sudo ufw app list
sudo ufw allow 'Apache Full'
sudo systemctl status apache2
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource": "arn:aws:ec2:*:*:instance/*"
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection and set the region
ec2 = boto3.resource('ec2', region_name='ap-southeast-1')
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2', region_name='ap-south-1')