Giter VIP home page Giter VIP logo

shawon100 / online-compiler Goto Github PK

View Code? Open in Web Editor NEW
96.0 7.0 70.0 914 KB

This is an online compiler that can compile and run C\C++ And Java Program. This online compiler is a part of my 5th semester project "RUET Online Judge" . Developed By Ashadullah Shawon

Home Page: https://oj.redlimesolutions.ml/

JavaScript 3.07% PHP 74.99% CSS 18.07% Dockerfile 3.87%
online-compiler php web-compiler compiler linux

online-compiler's Introduction

Demo

https://oj.redlimesolutions.ml/

Online-Compiler

This is an online compiler that can compile and run C\C++ And Java Program. This online compiler is a part of my 5th semester project "RUET Online Judge" . This Online Compiler is Developed By Ashadullah Shawon

Languages

C , C++ And Java

Requirements

Linux, gcc, g++ , Java Compilers And Lampp

Install Projects And Compilers

git clone https://github.com/shawon100/Online-Compiler.git

C/C++

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8


sudo ln -f -s /usr/bin/g++-4.8 /usr/bin/g++

Java

sudo add-apt-repository ppa:openjdk-r/ppa  
sudo apt-get update   
sudo apt install openjdk-8-jre

Move Online-Compiler Folder to Server Folder

If you are using Xampp then you have to move Online-Compiler folder to htdocs of Xampp. If you are using only Apache Server then move to www folder.

Change Permission

chmod -R 777 Online-Compiler

Run

Type http://localhost/Online-Compiler/ from your Browser. Done!

Windows Version

https://github.com/shawon100/Online-Compiler-Windows-Server

DevOps Features

Install Docker at first. So, you can run this project in Windows/Linux/Mac
using Docker without doing anything mentioned before.

Direct One Command Install

docker pull shawon10/online-compiler

Docker Run Pulled Image

docker run -p 80:80 online-compiler

Check IP

docker-machine ip

Run Browser

Type your ip in browser adress bar and Enter

Docker Build Image

Copy Dockerfile to Outside of Online-Compiler Folder. Then Run docker build command.

docker build -t online-compiler .

Docker Run Container

docker run -p 80:80 online-compiler

Video Tutorial

https://www.youtube.com/watch?v=bf-inYN2V-k

Kubernetes

Create deployment.yaml file

apiVersion: v1
kind: Service
metadata:
  name: onlinecompiler-service
spec:
  selector:
    app: onlinecompiler
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: 80
  type: NodePort

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: onlinecompiler
spec:
  selector:
    matchLabels:
      app: onlinecompiler
  replicas: 1
  template:
    metadata:
      labels:
        app: onlinecompiler
    spec:
      containers:
      - name: onlinecompiler
        image: shawon10/online-compiler
        imagePullPolicy: Always
        ports:
        - containerPort: 80

Run

kubectl apply -f deployment.yaml

Check IP and Ports

 kubectl get svc

Openshift Deploy (Online)

Check this video: https://www.youtube.com/watch?v=QnA0QidkWSM

online-compiler's People

Contributors

shawon100 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

online-compiler's Issues

python input problem

i am using python2.7 whenever i take an custom input it throws EOFError: EOF when reading a line
This happens when throughout the input stream input is not recieved

Java

I can't make this work for java code. i get (main.java:1: error: class Factorial is public, should be declared in a file named Factorial.java
public class Factorial
^)
Any idea on what to do ?

How does this work asynchronously online?

I have played around with your implementation for quite some time now. Running it on the localhost does not let me parallelly process two different codes in say two separate browsers. The second request waits for the first one to complete.

Can you suggest why this does not happen online on the link provided by you and will it be the same if I deploy it online?

some php files missing, please share Source code complete

Hi @shawon100, great work. I have seen the demo. but while I am trying to install the same in the local server, it is showing the compiler alone. Login screens, compile.php, archive.php etc are not found. Please share the source code of the demo website. I am trying to build a free website for my college for the benefit of the next batches. Thank in advance.

Not working on localhost server

On running the online compiler on localhost, it is getting compiled properly but it is not showing any output, only verdict is shown. There might be some problem in c.php and c++11.php files in compiler folder.

Ans:How to upload the docker file

Use google cloud run API its free for testing .You can get the documentation .I am posting my dockerfile which shawon had given i changed accordingly

#Use the Ubuntu base image
FROM ubuntu

#Update all packages
RUN apt-get update

#Install tzdata and set timezone.
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get -y install tzdata

#Install Software Properties
RUN apt-get update &&
apt-get install -y software-properties-common &&
rm -rf /var/lib/apt/lists/*

#Install C/C++ Compiler
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update &&
apt-get -y install gcc mono-mcs &&
rm -rf /var/lib/apt/lists/*

#Install Java Compiler
RUN apt-get update &&
DEBIAN_FRONTEND=noninteractive
apt-get -y install default-jre-headless &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

#Install applications
FROM php:7.3-apache

Copy local code to the container image.

COPY Online /var/www/html/

Use the PORT environment variable in Apache configuration files.

RUN sed -i 's/80/${PORT}/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf

Configure PHP for development.

Switch to the production php.ini for production operations.

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

https://hub.docker.com/_/php#configuration

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

this will help you

Java not working

Hello
Thanks for your great works

First javac was not detected
after installing

gcj-6-jdk

i tried


public class HelloWorld {

public static void main(String[] args) {
    // Prints "Hello, World" to the terminal window.
    System.out.println("Hello, World");
}

}


and i got :
Main.java:1: error: The public type HelloWorld must be defined in its own file
public class HelloWorld {
^^^^^^^^^^
1 problem (1 error)

Compiled And Executed In: 0.00 s

Verdict : AC


Thanks for your help

Best Regards

Java causing problem in input using scanner

When ever i run the code with below command having scanner in code.
java Hello < input.txt
My input file have all the inputs specify for each scanner it giving me the following error.
Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1651) at Example.main(Example.java:7)

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.