Skip to content

Instantly share code, notes, and snippets.

View Dzhan85's full-sized avatar

Atadzhan Dzhan85

View GitHub Profile
@ammarshah
ammarshah / install_postgresql_on_ubuntu.md
Last active March 25, 2025 11:47
Install PostgreSQL 17 on Ubuntu 24.04

Install PostgreSQL 17 on Ubuntu 24.04

1. Import the repository signing key:

$ sudo apt install curl ca-certificates
$ sudo install -d /usr/share/postgresql-common/pgdg
$ sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc

2. Create the repository configuration file:

@SergiuSavva
SergiuSavva / 1. aws-mfa.sh
Last active February 29, 2024 11:13
This Bash script helps in generating and configuring temporary AWS credentials using Multi-Factor Authentication (MFA) for added security. It reads the MFA device ARN from the specified AWS profile in the credentials file, prompts the user for the MFA token code, and then obtains the temporary credentials from AWS Security Token Service (STS). F…
#!/bin/bash
# Set the profile you want to use for MFA
SOURCE_PROFILE="default"
MFA_PROFILE="mfa"
# Read the MFA device ARN from the credentials file
MFA_DEVICE_ARN=$(aws configure get mfa_device_arn --profile $SOURCE_PROFILE)
if [ -z "$MFA_DEVICE_ARN" ]; then
echo "Error: MFA device ARN not found in the ~/.aws/credentials file for profile $SOURCE_PROFILE"
@Dzhan85
Dzhan85 / ELK with Nginx.md
Created September 13, 2022 09:24 — forked from Dev-Dipesh/ELK with Nginx.md
Setting up Elasticsearch, Logstash and Kibana with Nginx.

ELK (Elasticsearch Logstash Kibana)

Though we're focused more on server setup procedure in this document, I will still give a very brief explanation in laymen terms for ELK. To those who are starting new in this stack, must have already heard of MVC (Model View Controller), so take it like this:

  • Model => Elasticsearch (for Storage, Indexing & Search)
  • View => Kibana (for DataViz & G-Man, yeah the one in half life 😏)
  • Controller => Logstash (For Logs & Filtering)

@a-patel
a-patel / Terraform-Project-Directory-Structure.tf
Last active October 27, 2023 15:49
Terraform Project Directory Structure
-- PROJECT-DIRECTORY/
-- modules/
-- <service1-name>/
-- main.tf
-- variables.tf
-- outputs.tf
-- provider.tf
-- README
-- <service2-name>/
-- main.tf
########################################################################################
# #
# Create a new subnet in az-1a and associate it with the az-1a route table #
# #
########################################################################################
resource "aws_subnet" "extra_az_1a" {
vpc_id = var.eks_vpc_id
cidr_block = "100.64.0.0/19"
availability_zone = "eu-west-1a"
apiVersion: v1
kind: Service
metadata:
name: nodejs-service
spec:
selector:
app: nodejsapp
type: LoadBalancer
ports:
- protocol: TCP
@keithrbennett
keithrbennett / install-docker-on-ubuntu-20.04-and-linux-mint-20
Last active August 24, 2022 04:28
Installs Docker on Ubuntu 20.04 and Linux Mint 20
#!/bin/bash
# Installs Docker on Ubuntu 20.04 and Linux Mint 20
# based on script and correction at https://forums.linuxmint.com/viewtopic.php?t=325502
# This script is stored at https://gist.github.com/keithrbennett/d96a0409da3f07a5595d4f03d0d18b35.
# Check there for updates.
set -x
sudo apt-get update
@benoitpetit
benoitpetit / docker-compose.yml
Last active April 12, 2025 07:07
complete Gitlab installation and a runner with docker
version: '4.5'
services:
# GITLAB
gitlab-web:
image: 'gitlab/gitlab-ce:latest'
restart: always
container_name: gitlab-web
hostname: '192.168.0.14'
environment:
@wyyder
wyyder / Create new user in Linux
Created January 25, 2020 07:19
To create a new user with sudo permission in Kali Linux
# Add user.
useradd -m username
# -m creates a home directory for the user.
# Set Password.
passwd username
# Set user group to sudo.
usermod -a -G sudo username
# -a option to add and ‘-G sudo’ means to add the user to the sudo group.