Skip to content

Instantly share code, notes, and snippets.

View tosin2013's full-sized avatar

Tosin Akinosho tosin2013

View GitHub Profile
@tosin2013
tosin2013 / git-merge-script.sh
Created March 30, 2024 13:31
Universal Git Repository Merger
#!/bin/bash
# Source repository configuration (HTTPS)
source_repo_url="https://github.com/SOURCE_REPO_OWNER/SOURCE_REPO_NAME.git"
source_branch="main"
# Target repository configuration (SSH)
target_repo_url="git@gitea.example.com:TARGET_REPO_OWNER/TARGET_REPO_NAME.git"
target_branch="main"
#!/bin/bash
# Check if a repository URL was provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <repository-url>"
exit 1
fi
REPO_URL=$1
@tosin2013
tosin2013 / gist:ae34f4871672217c2428feaef98d7d4f
Created March 7, 2024 20:51
Script to install Jekyll on Ubuntu 22.04 LTS
#!/bin/bash
# Script to install Jekyll on Ubuntu 22.04 LTS
# Update the system packages
echo "Updating system packages..."
sudo apt-get update -y
# Install Ruby and other dependencies
echo "Installing Ruby and dependencies..."
@tosin2013
tosin2013 / configure_gui.sh
Last active March 6, 2024 19:58
GNOME GUI and xrdp on RHEL
#!/bin/bash
# Install GNOME GUI
sudo yum groupinstall "Server with GUI"
# Enable EPEL repository
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
# Install xrdp and dependencies
sudo yum install tigervnc-server xrdp -y
@tosin2013
tosin2013 / openshift-ai-workload.sh
Last active February 13, 2024 20:49
openshift-ai-workload.sh
#!/bin/bash
if [ -z "$1" ]; then
echo "Instance size not provided. Please pass the instance size as an argument."
echo "Example: ./openshift-ai-workload.sh m6i.4xlarge"
echo "Example: ./openshift-ai-workload.sh g4dn.4xlarge"
echo "Example: ./openshift-ai-workload.sh g4ad.4xlarge"
exit 1
fi
@tosin2013
tosin2013 / h2ogpt_docker.sh
Last active January 6, 2024 16:43
h2ogpt_docker.sh
#!/bin/bash
set -x
# Function to check if Docker is installed and start Docker service if it's not running
check_and_start_docker() {
if ! command -v docker &> /dev/null; then
# Docker is not installed, install it
echo "Docker is not installed. Installing..."
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
#!/bin/bash
# privategpt documentation
# https://docs.privategpt.dev/installation/getting-started/installation
set -e
# PostgreSQL settings
PG_DB_NAME="ollama_db"
PG_USER="ollama_user"
PG_PASSWORD="pAsSw0Rd" # Change this to a secure password
#!/bin/bash
set -xe
if [[ $# -ne 3 ]]; then
echo "Usage: $0 <AWS_ACCESS_KEY> <AWS_SECRET_ACCESS_KEY> <CONTAINER_RUN_TIME>"
exit 1
fi
# Check if logged on to OpenShift and if not exit
if ! oc whoami &> /dev/null; then
openapi: 3.0.0
info:
title: My Python API
version: 1.0.0
servers:
- url: http://localhost:8000
paths:
/users:
get:
summary: Get all users
@tosin2013
tosin2013 / copy-keys.sh
Created June 16, 2023 13:55
copy-keys.sh -> to be used for github actions
#!/bin/bash
# Check if all required arguments are provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <username@host.com> <your_email@example.com>"
exit 1
fi
# Step 1: Generate an SSH Key
ssh_key_file="github-actions"