Last active
June 27, 2021 22:43
-
-
Save ImanCol/2928cc0870efcca8cd0041cd1fa4975f to your computer and use it in GitHub Desktop.
Cloud-Game-Retro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "Cloud-Game-Retro", | |
"provenance": [], | |
"collapsed_sections": [], | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"display_name": "Python 3", | |
"name": "python3" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/ImanCol/2928cc0870efcca8cd0041cd1fa4975f/cloud-game-retro.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "hzKxQ2znMVCb" | |
}, | |
"source": [ | |
"This is a project to run giongto35's Cloud Game (Retro) on Google Colab." | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "YxAY7I-hKFzL" | |
}, | |
"source": [ | |
"Here you install Golang" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "wh8nHzpZnwc1", | |
"outputId": "48d3d62f-c5cb-4c42-b9d4-5280a30cecf1", | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
} | |
}, | |
"source": [ | |
"#Install Golang\n", | |
"!add-apt-repository ppa:longsleep/golang-backports -y\n", | |
"!apt update\n", | |
"!apt install golang-go\n", | |
"%env GOPATH=/root/go\n", | |
"\n", | |
"#clean outpud\n", | |
"from IPython.display import clear_output\n", | |
"clear_output()\n", | |
"print(\"Succeful install Golang\")" | |
], | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": [ | |
"Succeful install Golang\n" | |
], | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "2TxAkHQGKRfT" | |
}, | |
"source": [ | |
"Here you install Ngrok and redirect port 8000 from localhost to a public Ngrok link" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "V8D_SS2Nn5Kr", | |
"outputId": "d7563d02-2ca9-4461-ac0e-78b51c1afd02", | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
} | |
}, | |
"source": [ | |
"#Install ngrok\n", | |
"!pip install pyngrok --quiet\n", | |
"from pyngrok import ngrok\n", | |
"\n", | |
"# Terminate open tunnels if exist\n", | |
"ngrok.kill()\n", | |
"\n", | |
"# Setting the authtoken (optional)\n", | |
"# Get your authtoken from https://dashboard.ngrok.com/auth\n", | |
"NGROK_AUTH_TOKEN = \"1u6V6O8iox33Jr6LcpKKkNwe0Y9_6ttrFZGfxt54wFFdUyZBB\"\n", | |
"ngrok.set_auth_token(NGROK_AUTH_TOKEN)\n", | |
"http_tunnel = ngrok.connect(8000, \"http\")\n", | |
"\n", | |
"print(\"Tracking URL:\", http_tunnel,)\n", | |
"\n" | |
], | |
"execution_count": 4, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": [ | |
"Tracking URL: NgrokTunnel: \"http://d44ef062a543.ngrok.io\" -> \"http://localhost:8000\"\n" | |
], | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "4L0PS8PMLIMz" | |
}, | |
"source": [ | |
"Here you install Cloud-Game and its dependencies. It compiles and runs through localhost: 8080, from which it is redirected by Ngrok to a public link." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "gJr_9dXGpJ05", | |
"outputId": "e38306f1-b2a7-4818-db56-50ab1b0cad95", | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
} | |
}, | |
"source": [ | |
"#Install Dependencias\n", | |
"!apt-get install -y make gcc pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev\n", | |
"\n", | |
"#Download Cloud Game\n", | |
"!git clone https://github.com/giongto35/cloud-game.git\n", | |
"\n", | |
"#Build & Run Cloud Game\n", | |
"!cd cloud-game && make dev.run\n" | |
], | |
"execution_count": 5, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": [ | |
"I0627 22:43:24.771696 8663 main.go:46] [coordinator] Shutting down [os:interrupt]\n", | |
"I0627 22:43:24.771742 8664 monitoring.go:82] [worker] Shutting down monitoring server\n", | |
"I0627 22:43:24.772028 8664 monitoring.go:69] [worker] The main HTTP server has been closed\n", | |
"I0627 22:43:24.775063 8664 cws.go:183] [!] read: websocket: close 1006 (abnormal closure): unexpected EOF\n", | |
"I0627 22:43:24.775106 8664 handlers.go:112] Worker connecting to coordinator: ws://localhost:8000/wso?zone=\n", | |
"I0627 22:43:24.775418 8664 cws.go:170] Close heartbeat\n", | |
"I0627 22:43:24.776824 8664 handlers.go:62] Cannot connect to coordinator. dial tcp 127.0.0.1:8000: connect: connection refused Retrying...\n", | |
"^C\n" | |
], | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"id": "_rciBWyDiGsz" | |
}, | |
"source": [ | |
"!bash" | |
], | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "Aj3ylBPQMJF4" | |
}, | |
"source": [ | |
"Lack:\n", | |
"Make the link display the LOL emulator" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "sIHK6RDTLf-Y" | |
}, | |
"source": [ | |
"Thanks to giongto35 for this great project and to all its collaborators. All rights of use are subject to the license of de [Cloud-Game](https://github.com/giongto35/cloud-game)" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment