Code Monkey home page Code Monkey logo

oci-occ-fix's Introduction

Oracle Cloud Infrastructure Out of Capacity Error

Fix for Oracle Cloud Infrastructure Out of Capacity error. Oracle Cloud Infrastructure Currently GitHub release dependency - Python

Made by Moses

If you appreciate what I do please ko-fi

Skip to Section

Installation Configuration How to use In Use Show your support❤️ Contributors

Installation

One Command Install

git clone https://github.com/mosesman831/OCI-OcC-Fix.git && cd OCI-OcC-Fix && pip install -r requirements.txt

Pro Tip Use the One Command Install to setup quickly

Using Git

Step 1

Run Git Clone.

git clone https://github.com/mosesman831/OCI-OcC-Fix.git

Step 2

Enter the folder.

cd OCI-OcC-Fix

Step 3

Install requirements and dependencies

pip install -r requirements.txt

Using Releases

Open Releases and download latest

Install required dependencies

pip install -r requirements.txt

wget

Install unzip if not already installed.

sudo apt-get install unzip

wget

wget https://github.com/mosesman831/OCI-OcC-Fix/archive/refs/heads/main.zip && unzip main.zip && mv OCI-OcC-Fix-main OCI-OcC-Fix && rm main.zip

Install required dependencies

pip install -r requirements.txt

Docker

Step 1

Build the Docker Container

sudo docker compose build

Step 2

Start Docker Containers

sudo docker compose up -d

Step 3

View Container Logs

sudo docker logs -f <cotainer>

Run on 3rd Party containers

Not yet added.

Configuration

Getting Oracle Cloud API

Step 1

Open Oracle Cloud and log in.

Step 2

Click profile icon and then "My Profile / User Settings"

Step 3

Find API keys, click "Add API Key" button

Step 4

Click "Download Private Key" and then "Add". Save the file as oci_private_key.pem

Step 5

Copy the contents from the Text Box and save it to file config.

Pro Tip You could use nano to edit the files easier.

Getting Telegram Bot ID

Step 1

Open Telegram and message @BotFather

Step 2

Send /newbot

Step 3

Enter name and username

Step 4

Message @Rose-Bot to get User ID ("uid")

Step 5

Send /id

Step 6

Get userid

Getting Oracle Cloud cURL

Step 1

Create an instance from the OCI Console in the browser (Menu -> Compute -> Instances -> Create Instance)

Step 2

Change image and shape.

Step 3

Adjust the Networking section, and set the "Do not assign a public IPv4 address" checkbox. If you don't have an existing VNIC/subnet, please create a VM.Standard.E2.1.Micro instance before doing everything.

Step 4

Download and save the public and private SSH keys.

Step 5

Click Ctrl + Shift + I or F12 to open browser's dev tools -> network tab

Step 6

Click Create and see if you get the Out of capacity error. Now find /instances API call (red).

Step 7

Right-click on it -> copy as curl (bash/cmd). Paste the clipboard contents in any text editor.

Step 8

Open bot.py in a text editor.

Step 9

Find the variables and replace the xxxx fields respectively.

availabilityDomains = ["xxxx"]
#e.g. availabilityDomains = ["KHsT:UK-MANCHESTER-1-AD-1","KHsT:UK-MANCHESTER-1-AD-2"]
displayName = 'xxxx'
#e.g. displayName = 'VPS1'
compartmentId = 'xxxx'
#e.g. compartmentId = 'ocid1.tenancy.oc1..aaaaaaaa...'
subnetId = 'xxxx'
#e.g. subnetId = 'ocid1.subnet.oc1.uk-manchester-1.aaaaaaa...'
ssh_authorized_keys = "xxxx"
#e.g. ssh_authorized_keys = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABKDNBgQDf... ssh-key-2024-03-15"
boot_volume_size_in_gbs="xxxx"
#Leave blank for default
#e.g. boot_volume_size_in_gbs="47"
boot_volume_id="xxxx"
#e.g. boot_volume_id="ocid1.bootvolume.oc1.uk-manchester-1.aaaaaaa..."

How to use?

Run bot.py by double-clicking or running

python bot.py
python3 bot.py

Run on SSH

One Command SSH

tmux new && python3 bot.py

Tmux

Use tmux to keep window running even after logout.

tmux new

In Use

Success

Success Picture in Console

Prerelease Prototype Success Picture

Show your support ❤️

If you appreciate what I do, please

Star this project

or

Support me on Ko-fi!

ko-fi

Thanks for supporting!

Contributors

Peter Eisenschmidt
Peter Eisenschmidt

💻
aldacco
aldacco

💻 📖
Joery Zegers
Joery Zegers

💻

oci-occ-fix's People

Contributors

aldacco avatar allcontributors[bot] avatar joery avatar mosesman831 avatar unlifate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

oci-occ-fix's Issues

error 404 - not authorized or not found

hi, i have error when i run script, all the necessary information i filled in bot.py and config file but this dont work me, also trying google but nothing useful dont found, maybe someone try to help me with this?
powershell_gI1ZZEf1hu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.