Skip to content

Instantly share code, notes, and snippets.

View BTabaku's full-sized avatar
Focusing

Baft Tabaku BTabaku

Focusing
  • Lufthansa Industry Solutions
  • Albania
  • 16:11 (UTC -12:00)
View GitHub Profile
@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 / 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 / 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 / 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"
# 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
#!/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
@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 \
@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