This file contains hidden or 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
| # x86 | |
| wget http://dl.socketubs.net/nagios/oracle/instantclient-basic-linux-11.2.0.3.0.zip | |
| wget http://dl.socketubs.net/nagios/oracle/instantclient-sdk-linux-11.2.0.3.0.zip | |
| # X86_64 | |
| wget http://dl.socketubs.net/nagios/oracle/instantclient-basic-linux.x64-11.2.0.3.0.zip | |
| wget http://dl.socketubs.net/nagios/oracle/instantclient-sdk-linux.x64-11.2.0.3.0.zip | |
| unzip instantclient-basiclite-linux*.zip | |
| unzip instantclient-sdk-linux*.zip | |
| mv instantclient_11_2 /opt |
This file contains hidden or 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
| set prefix=(hd0,2)/boot/grub | |
| set root=(hd0,2) | |
| insmod (hd0,2)/boot/grub/linux.mod | |
| linux /vmlinuz root=/dev/sda2 ro | |
| initrd /initrd.img | |
| boot |
This file contains hidden or 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
| grub-install /dev/sda | |
| update-grub | |
| reboot |
This file contains hidden or 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
| apt-get update | |
| aptitude full-upgrade | |
| apt-get install update-manager-core | |
| grub-install /dev/sda | |
| update-grub | |
| reboot |
This file contains hidden or 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
| pip install Flask | |
| cd /var/www | |
| git clone https://github.com/Socketubs/TheMall.git TheMall | |
| cd TheMall | |
| python main.py |
This file contains hidden or 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
| #!/bin/bash | |
| ############################################################# | |
| # Variables | |
| heroku_repo="_site" | |
| heroku_url="[email protected]:socketubs.git" | |
| heroku_commit="New release" | |
| github_commit="New release" | |
| ############################################################# |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| </head> | |
| <p>Websocket with Flask, Gevent and Gevent-websocket</p> | |
| <p id="log"></p> | |
| <button id="send" type="button">Send!</button> | |
| <body> | |
| <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| from gevent.pywsgi import WSGIServer | |
| from geventwebsocket.handler import WebSocketHandler | |
| from app import my_app | |
| if __name__ == '__main__': | |
| http_server = WSGIServer(('',5000), my_app, handler_class=WebSocketHandler) | |
| http_server.serve_forever() |
This file contains hidden or 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
| # coding: utf-8 | |
| from flask import render_template | |
| from app import app | |
| @app.route('/') | |
| def index(): | |
| return render_template('index.html') |
This file contains hidden or 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
| # coding: utf-8 | |
| import json | |
| def handle_websocket(ws): | |
| while True: | |
| message = ws.receive() | |
| if message is None: | |
| break | |
| else: | |
| message = json.loads(message) |