Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

48 Commits

Folders and files

Repository files navigation

๐Ÿš€ OCI Discord Bot

Fully Automated Always Free Instance Creator

OCI Always Free Discord Bot Bash Automation MIT License

Easily create Oracle Cloud Infrastructure Always Free instances from Discord!

๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Usage โ€ข ๐Ÿ”ง Advanced Setup โ€ข ๐Ÿค Contributing

English | ํ•œ๊ตญ์–ด


๐ŸŽฌ Demo

๐Ÿ“ฑ Discord Bot Commands Demo

# Example usage in Discord channel
/status                    # Check bot status and instance overview
/launch                    # Instantly create Always Free instance
/log count:5               # View last 5 execution logs
/config                    # Check current configuration

๐Ÿง™โ€โ™‚๏ธ Setup Wizard Execution Screen

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                    ๐Ÿง™โ€โ™‚๏ธ OCI Always Free Discord Bot                          โ•‘
โ•‘                             Setup Wizard                                    โ•‘
โ•‘         Oracle Cloud Infrastructure Always Free Instance Auto Creator      โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โ„น๏ธ [12:34:56] ๐ŸŽฏ Always Free Optimized: E2.1.Micro (2x), A1.Flex (4 OCPU, 24GB)
โ„น๏ธ [12:34:56] ๐Ÿค– Discord Integration: Slash commands, Real-time monitoring
โ„น๏ธ [12:34:56] ๐Ÿ”ง Full Automation: Auto-detect config, Real-time validation

๐Ÿ“Š Always Free Usage Monitoring

๐Ÿ“Š Always Free Usage:
  โ€ข Shape: VM.Standard.A1.Flex
  โ€ข Specs: 2 OCPU, 12GB RAM
  โ€ข A1 Total Limit: 2/4 OCPU, 12/24GB RAM
  โ€ข Remaining Resources: 2 OCPU, 12GB RAM
  โ€ข Boot Volume: 100/200GB (Free)

๐Ÿ’Ž Oracle Cloud Always Free - What Is It?

Oracle Cloud Always Free provides powerful cloud infrastructure at no cost forever - perfect for developers, students, and small projects!

๐ŸŽ What Oracle Always Free Provides

๐Ÿ–ฅ๏ธ Compute Instances

  • 2x E2.1.Micro (AMD EPYC)
    • 1 OCPU, 1GB RAM each
    • Perfect for: Web servers, APIs, bots
  • 4 OCPU A1.Flex (ARM Ampere)
    • 4 OCPU, 24GB RAM total
    • Configurable: 1-4 instances

๐Ÿ’พ Storage & Network

  • 200GB Block Storage
  • 10GB Object Storage
  • Load Balancer (10 Mbps)
  • VCN & Security Lists
  • Autonomous Database (20GB)

๐ŸŽฎ Popular Use Cases & Examples

๐ŸŽฏ A1.Flex (ARM) - High Performance Applications

๐ŸŽฎ Gaming Servers

# Minecraft Server (Recommended: 2 OCPU, 8GB)
Shape: VM.Standard.A1.Flex
Config: 2 OCPU, 8GB RAM
Players: ~10-20 concurrent
Performance: Excellent for modded servers

๐ŸŒ Development Environment

# Full Development Stack
Shape: VM.Standard.A1.Flex  
Config: 4 OCPU, 24GB RAM
Stack: Docker, Kubernetes, CI/CD
Perfect for: Team development, microservices

๐Ÿค– AI/ML Workloads

# Machine Learning Training
Config: 4 OCPU, 24GB RAM
Frameworks: TensorFlow, PyTorch
Use: Model training, data processing
โšก E2.1.Micro (AMD) - Lightweight Services

๐ŸŒ Web Applications

  • Personal websites & blogs
  • REST APIs & microservices
  • Discord/Telegram bots
  • Monitoring services

๐Ÿ“Š Database & Caching

  • Small databases (PostgreSQL, MySQL)
  • Redis cache servers
  • Message queues
  • Log aggregators

๐Ÿ’ฐ Always Free vs Paid Comparison

Feature Always Free Paid Plans
Cost $0/month forever Pay-as-you-use
Performance Production-ready Scalable
Duration No time limit Flexible
Support Community Professional

๐Ÿ’ก Pro Tip: Always Free is perfect for learning, development, and small production workloads. Scale to paid plans when you need more resources!


โœจ Features

๐ŸŽฏ Always Free Optimized

  • โœ… E2.1.Micro (up to 2 instances)
  • โœ… A1.Flex (4 OCPU, 24GB RAM)
  • โœ… 200GB Boot Volume Free
  • โœ… Real-time limit checking

๐Ÿค– Discord Integration

  • โœ… Slash command support
  • โœ… Real-time status monitoring
  • โœ… Log and error notifications
  • โœ… PM2 service management

๐Ÿ”ง Full Automation

  • โœ… Auto OCI CLI installation
  • โœ… Auto-detect existing config
  • โœ… Real-time API validation
  • โœ… One-click setup

๐ŸŽจ User-Friendly

  • โœ… Colorful log output
  • โœ… Emoji-based UI
  • โœ… Step-by-step guidance
  • โœ… Auto error diagnosis

๐Ÿš€ Core Features

๐ŸŽฏ Always Free Optimization
  • Shape Auto-filtering: Shows only E2.1.Micro, A1.Flex
  • Real-time limit check: Auto-calculate OCPU/RAM usage
  • Billing protection: Warns when exceeding Always Free limits
  • Usage dashboard: Real-time display of remaining resources
๐Ÿค– Discord Bot Commands
Command Function Example
/status Bot status and instance overview Uptime, success rate, recent activity
/launch Instant instance creation Auto-select Always Free Shape
/log View recent execution logs Success/failure history, error diagnosis
/config Check configuration info Current Shape, region, specs
/help All commands guide Usage and tips
๐Ÿ”ง Smart Setup Wizard
  • Auto environment detection: Auto-load existing OCI config files
  • Real-time API validation: Real-time query of available Shape/Image
  • Custom spec configuration: Auto-validate OCPU/RAM combinations
  • Intuitive UI: User-friendly interface

๐Ÿ› ๏ธ Quick Start

1๏ธโƒฃ Prerequisites

๐Ÿ”‘ OCI Account

  • Oracle Cloud free account
  • Always Free eligibility confirmed
  • Credit card registration (free)

๐Ÿค– Discord Bot

๐Ÿ–ฅ๏ธ Server Environment

  • Linux (Ubuntu/CentOS)
  • Bash 4.0+
  • curl, jq installed

2๏ธโƒฃ OCI API Key Setup

# ๐Ÿ” Generate API key pair
mkdir -p ~/.oci
openssl genrsa -out ~/.oci/oci_api_key.pem 2048
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
chmod 600 ~/.oci/oci_api_key.pem

# ๐Ÿ“‹ Copy public key content (for OCI Console registration)
cat ~/.oci/oci_api_key_public.pem

๐Ÿ”— OCI Console Registration Path
Identity & Security โ†’ Users โ†’ Your Account โ†’ API Keys โ†’ Add API Key

3๏ธโƒฃ OCI CLI Setup

# ๐Ÿš€ Install OCI CLI (automatic)
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

# ๐Ÿ“ Interactive setup (recommended)
oci setup config

# ๐Ÿ” Verify configuration
oci iam region list --output table

4๏ธโƒฃ Run Setup Wizard

# ๐Ÿ“ฅ Download scripts
git clone https://github.com/CorelLinux/oci-simple-script.git
cd oci-simple-script

# ๐Ÿง™โ€โ™‚๏ธ Run setup wizard
bash oci-config-wizard.sh

๐ŸŽ‰ Once all setup is complete, config.json will be auto-generated!

5๏ธโƒฃ Run Discord Bot

# ๐Ÿค– Start bot
bash oci-script-and-bot.sh

# ๐Ÿ“Š Check status
pm2 status
pm2 logs oci-discord-bot

๐ŸŽฎ Usage

Discord Commands

Command Icon Description Result
/status ๐Ÿ“Š Check bot status Uptime, success rate, recent activity
/launch ๐Ÿš€ Create instance Auto-select Always Free Shape
/log ๐Ÿ“‹ View logs Recent N execution history
/config โš™๏ธ Check configuration Current Shape, region, specs
/stop โน๏ธ Stop auto creation Pause bot
/start โ–ถ๏ธ Restart auto creation Resume bot
/schedule โฐ Set creation interval 3-60 minutes (default: 5 min)
/stats ๐Ÿ“Š Detailed statistics Success rate, period analysis
/instances ๐Ÿ–ฅ๏ธ List instances Running/stopped instance overview
/resources ๐Ÿ’ฐ Resource usage Always Free limits and usage
/alert ๐Ÿ”” Notification settings Configure alerts
/help โ“ Help All commands guide

Always Free Usage Monitoring

# ๐Ÿ” Check current instances
oci compute instance list --compartment-id $COMPARTMENT_ID --output table

# ๐Ÿ“Š Check A1.Flex usage
oci limits resource-availability get --compartment-id $COMPARTMENT_ID \
    --service-name compute --limit-name vm-standard-a1-core-count

โšก New Features in v2.0

Feature Description Benefit
๐ŸŽฏ Smart Interval Default 5-minute attempts Faster instance acquisition
โš™๏ธ Flexible Timing 3-60 minute range via /schedule Customizable based on demand
๐ŸŒ Multi-language English/Korean support Better accessibility
๐Ÿ”ง Error Recovery Improved command error handling More stable operation
๐Ÿ“Š Enhanced Stats Detailed success rate analysis Better monitoring

๐Ÿ’ก Pro Tip: Use /schedule 3 during high-demand periods and /schedule 30 during low-demand periods to optimize success rates.


๐ŸŽจ Advanced Setup

๐ŸŽฏ Always Free Optimization

๐Ÿ’ก Shape Selection Guide
Shape OCPU RAM Instances Use Case Notes
E2.1.Micro 1 1GB 2 Lightweight web servers, bots AMD-based
A1.Flex 1-4 6-24GB 1-4 Development servers, learning ARM-based

๐Ÿ’ฐ Cost Calculator:

  • E2.1.Micro: Free (up to 2)
  • A1.Flex: Total 4 OCPU, 24GB RAM free
  • Boot Volume: 200GB free
๐Ÿ”ง Custom SSH Keys
# ๐Ÿ”‘ Use existing SSH keys
export CUSTOM_PRIVATE_KEY_PATH="/path/to/your/private_key"
export CUSTOM_PUBLIC_KEY_PATH="/path/to/your/public_key.pub"

# ๐Ÿ” Generate new SSH keys
ssh-keygen -t rsa -b 2048 -f ~/.ssh/oci_key -N ""
export CUSTOM_PRIVATE_KEY_PATH="$HOME/.ssh/oci_key"
export CUSTOM_PUBLIC_KEY_PATH="$HOME/.ssh/oci_key.pub"
๐ŸŒ Language Configuration

The bot supports both English and Korean interfaces. Configure in config.json:

{
  "LANGUAGE": "en",  // "en" for English, "ko" for Korean
  // ... other config options
}

Language Features:

  • ๐ŸŽฏ Discord command descriptions in chosen language
  • ๐Ÿ“ Bot response messages in chosen language
  • ๐Ÿ”ง Error messages and help text localized
  • ๐Ÿš€ Seamless switching - just edit config and restart

Change Language:

# Edit config.json
nano config.json
# Change "LANGUAGE": "ko" to "LANGUAGE": "en"

# Restart bot
pm2 restart oci-discord-bot

๐Ÿ”ง Troubleshooting

๐Ÿšจ Common Issues

โŒ OCI CLI Installation Error

# ๐Ÿ” Check installation
oci --version

# ๐Ÿ”ง Check PATH configuration
echo $PATH | grep -o "$HOME/bin"

# ๐Ÿ”„ Reinstall
curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh | bash

โŒ OCI CLI Not Accessible with sudo

When OCI CLI is installed via symlink in user path, it may not be accessible with sudo.

# ๐Ÿ” Check OCI CLI installation location
which oci
# Result: /home/user/bin/oci

# ๐Ÿ”ง Create symlink in system path
sudo ln -s $(which oci) /usr/local/bin/oci

# โœ… Verify sudo access
sudo oci --version

Automatic Solution:

# Script handles this automatically, but manual setup is also possible
sudo ln -s $HOME/bin/oci /usr/local/bin/oci
sudo ln -s $HOME/.local/bin/oci /usr/local/bin/oci
sudo ln -s $HOME/lib/oracle-cli/bin/oci /usr/local/bin/oci

โŒ API Key Permission Error

# ๐Ÿ” Check and fix permissions
ls -la ~/.oci/
chmod 600 ~/.oci/oci_api_key.pem
chmod 644 ~/.oci/oci_api_key_public.pem

# ๐Ÿ” Validate key
oci iam region list --auth api_key

โŒ Discord Bot Token Error

# ๐Ÿ” Check token
grep -o "discord_token" config.json

# ๐Ÿ”ง Reset token
bash oci-config-wizard.sh
# Re-run Discord configuration section only

โŒ "Out of Capacity" Error

  • ๐Ÿ”„ Try different regions: ap-tokyo-1, ap-mumbai-1
  • โฐ Change time zone: Recommended during early morning hours
  • ๐ŸŽฏ Change Shape: E2.1.Micro โ†’ A1.Flex
๐Ÿ“Š Status Check Commands
# ๐Ÿค– Bot status
pm2 status
pm2 logs oci-discord-bot --lines 50

# ๐Ÿ“Š Instance list
oci compute instance list --compartment-id $COMPARTMENT_ID --output table

# ๐Ÿ’ฐ Always Free usage
oci limits resource-availability get \
    --compartment-id $COMPARTMENT_ID \
    --service-name compute \
    --limit-name vm-standard-a1-core-count
๐Ÿ”ง Configuration File Check
# ๐Ÿ“„ OCI configuration
cat ~/.oci/config

# ๐Ÿ“‹ Bot configuration
cat config.json | jq .

# ๐Ÿ“ Log file
tail -f oci_bot.log

๐Ÿ“š References

๐Ÿ”— Useful Links

Category Link Description
๐Ÿ›๏ธ Official Oracle Cloud Console OCI Management Console
๐Ÿ“– Documentation OCI CLI Guide Official Installation Guide
๐Ÿค– Bot Discord Developer Bot Creation and Management
๐Ÿ’ก Tips Out of Capacity Solution Capacity shortage solution

๐ŸŽ“ Recommended Learning Resources


๐Ÿค Contributing

๐Ÿ™‹โ€โ™‚๏ธ How to Participate

๐Ÿ› Bug Reports
Let us know about issues you find

Create Issue

๐Ÿ’ก Feature Requests
Share your new ideas

Feature Request

๐Ÿ”ง Code Contributions
Write improvements yourself

Pull Request

๐Ÿ“‹ Contribution Guidelines

  1. ๐Ÿด Fork this repository to your account
  2. ๐ŸŒฟ Branch Create a new feature branch
  3. ๐Ÿ’ป Code Write improvements and test
  4. ๐Ÿ“ Commit Write clear commit messages
  5. ๐Ÿš€ PR Create Pull Request

๐Ÿ“„ License

MIT License - Feel free to use, modify, and distribute!

License: MIT


๐ŸŒŸ If this project helped you, please give it a Star!

Made with โค๏ธ for the Oracle Cloud Always Free Community

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages