Skip to content

Instantly share code, notes, and snippets.

View ismail0352's full-sized avatar

Ismail ismail0352

  • Velotio
View GitHub Profile

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@ismail0352
ismail0352 / master.tf
Created August 17, 2020 18:55
One file to rule them all
//AWS access credential validation
provider "aws" {
region = "us-west-2"
shared_credentials_file = "~/.aws/credentials"
profile = "default"
}
//Creates Prod VPC
module "prod_vpc" {
source = "./prod_vpc"
@ismail0352
ismail0352 / openvpn.tf
Last active April 8, 2021 05:16
Example of how a vpn server can be created
module "prod-openvpn-sg" {
# source = "../modules/security-group"
source = "github.com/terraform-aws-modules/terraform-aws-security-group"
name = "${var.vpn_name}-sg"
description = "Security Group for openvpn server Prod"
vpc_id = var.vpc_id
ingress_cidr_blocks = ["0.0.0.0/0"] # Actual IP range to support
ingress_ipv6_cidr_blocks = ["::/0"]
ingress_rules = ["openvpn-udp", "openvpn-tcp", "openvpn-https-tcp", "ssh-tcp"]
egress_rules = ["all-all"]
@ismail0352
ismail0352 / aws_vpc.tf
Created August 17, 2020 17:33
Sample VPC file with use of already existing EIP
# have this created before hand on AWS
data "aws_eip" "Production-VPC-EIP" {
tags = {
Name = "Production-VPC-EIP"
}
}
module "vpc" {
# source = "../modules/vpc"
source = "github.com/terraform-aws-modules/terraform-aws-vpc"
@ismail0352
ismail0352 / terraform_s3_backend
Created August 17, 2020 17:28
Sample for Terraform backend
provider "aws" {
region = "us-west-2"
shared_credentials_file = "~/.aws/credentials"
profile = "default"
}
resource "aws_s3_bucket" "terraform_state" {
bucket = "terraform-backend-state"
versioning {
enabled = true
@ismail0352
ismail0352 / underlying_distro.sh
Last active October 16, 2019 09:40
Shell script for determining undelying distribution using ID
#!/bin/bash
DISTRO_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release | sed -e 's/^"//' -e 's/"$//')
# Install Salt Minion
if [ $DISTRO_ID == centos ]; then
echo "Do CENTOS stuff here"
elif [ $DISTRO_ID == ubuntu ]; then
echo "Do UBUNTU stuff here"
@ismail0352
ismail0352 / Dockerfile.deb_rpm_nginx
Last active August 2, 2023 06:54
Creating your own .deb file repo and host it using Nginx container with "autoindex on;"
FROM ubuntu as ubuntu
RUN apt-get update
RUN apt-get install -y dpkg-dev wget gnupg2 curl
ARG ubuntu_packages="wget htop default-jre-headless apt-transport-https nvidia-container-toolkit cuda-drivers libopengl0 linux-image-extra-virtual omnisci"
WORKDIR /opt/packages/deb
# Nvidia-Docker
@ismail0352
ismail0352 / test_server_windows.ps1
Created August 27, 2019 12:09
powershell script to configure IIS on "Fresh Server"
# To list all Windows Features: dism /online /Get-Features
# Get-WindowsOptionalFeature -Online
# LIST All IIS FEATURES:
# Get-WindowsOptionalFeature -Online | where FeatureName -like 'IIS-*'
# NetFx dependencies
dism /online /Enable-Feature /FeatureName:NetFx4 /All
# ASP dependencies
dism /online /enable-feature /all /featurename:IIS-ASPNET45
@ismail0352
ismail0352 / Jenkinsfile
Last active February 14, 2023 17:28
Jenkinsfile for Dotnet application
pipeline {
agent { label "build && windows" }
stages {
stage('Clean Workspace'){
steps {
cleanWs()
}
}
stage('Checkout'){
@ismail0352
ismail0352 / Jenkinsfile
Last active August 26, 2019 11:36
Jenkinsfile for Angular building and testing Angular application in a docker container
node (label: 'build && linux') {
stage('Clean Workspace'){
cleanWs()
}
stage("Main build") {
docker.image('node:10').pull()
docker.image('ismail0352/chrome-node').pull()
stage('Checkout SCM') {