Skip to content

Instantly share code, notes, and snippets.

View BTabaku's full-sized avatar
Focusing

Baft Tabaku BTabaku

Focusing
  • Lufthansa Industry Solutions
  • Albania
  • 08:00 (UTC -12:00)
View GitHub Profile
@BTabaku
BTabaku / setup_docker_centos.sh
Last active November 21, 2023 13:41
Setup docker on Cent-OS Script Removal/Reinstall
#!/bin/bash
# Stop Docker if exist
sudo systemctl stop docker
# Remove Docker Packages
sudo yum remove docker-ce docker-ce-cli containerd.io
# Remove Docker Data (Optional)
sudo rm -rf /var/lib/docker
@BTabaku
BTabaku / setup_docker_ubuntu.sh
Created October 1, 2023 19:41
Setup docker on ubuntu
#!/bin/bash
# Remove the previous Docker installation (for Ubuntu)
sudo apt-get remove docker docker-engine docker.io containerd runc -y
# Set up the repository
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
#!/bin/bash
# Script to install Python 3.9 on CentOS 7
# Please run it as a root
# Install development tools and libraries
yum groupinstall -y "Development Tools"
yum install -y openssl-devel bzip2-devel libffi-devel
# Download Python 3.9 source code
# remove previous version if there is anything installed
which terraform
sudo rm /usr/local/bin/terraform
terraform --version
wget https://releases.hashicorp.com/terraform/0.13.0/terraform_0.13.0_linux_amd64.zip
unzip terraform_0.13.0_linux_amd64.zip
sudo mv terraform /usr/local/bin/
terraform --version # Verify the installation
@BTabaku
BTabaku / docker_initialiser.sh
Created November 8, 2023 17:27
Docker initializer script to auto-deploy
#!/bin/bash
# Get the current working directory
current_dir=$(pwd)
echo "Starting deployment..."
echo $current_dir
# Define the Docker image and container details
image_name="op-mediadl-os"
@BTabaku
BTabaku / python_upgrade_suse15.sh
Last active March 20, 2024 13:09
Install/ upgrade python to python3.9 on SUSE 15 linux
#!/bin/bash
sudo zypper refresh
# setup developer tools first if you dont have them already
sudo zypper install gcc zlib-devel bzip2 libbz2-devel libffi-devel libopenssl-devel readline-devel sqlite3 sqlite3-devel xz xz-devel
# Download and install OpenSSL
wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz
tar xvf openssl-1.1.1l.tar.gz
@BTabaku
BTabaku / git_upgrade_centos7.sh
Last active November 10, 2023 09:12
Installing / upgrading git manually on CentOS 7
#!/bin/bash
# Install the required Perl module
sudo cpan ExtUtils::MakeMaker
# Remove the old Git
sudo yum remove git
# Download the latest Git sources
wget https://github.com/git/git/archive/refs/tags/v2.35.1.tar.gz
@BTabaku
BTabaku / docker_api_exopose.sh
Last active November 13, 2023 20:50
Expose Docker API but only for specific service
# this file might behave differently on different OS
# it is tested on centos 8
# edit the following file /lib/systemd/system/docker.service
sudo vi /lib/systemd/system/docker.service
# add the following line to the file -H tcp://0.0.0.0:2375
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 --containerd=/run/containerd/containerd.sock
# reload the daemon
@BTabaku
BTabaku / file_content_collector.sh
Created March 15, 2025 14:39
This script collects the contents of all files with a specified extension from a given directory and writes them into a single output file. It can be used to aggregate code files, configuration files, or any other text files for review or processing. The script is compatible with ChatGPT and other AI tools for further analysis or summarization.
#!/bin/bash
# Default values
# default_directory="environments/"
default_directory="." # Use current directory as default
# default_directory="infrastructure/cert-manager/"
default_extension="*" # Supports all file types
default_output_file="content_code_files.txt"
# Function to list files with the given extension