Skip to content

Instantly share code, notes, and snippets.

View ismail0352's full-sized avatar

Ismail ismail0352

  • Velotio
View GitHub Profile
@ismail0352
ismail0352 / Dockerfile.deb_rpm_nginx
Last active May 26, 2024 10:49
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 / 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 / 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 / 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 / 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 / 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"

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