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
from flask import Flask, request | |
from flask_restful import Resource, Api | |
app = Flask(__name__) | |
api = Api(app) | |
class HelloWorld(Resource): | |
def get(self): | |
return {'hello': 'world'} |
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
{ | |
"new_bandwidths": [ | |
{ | |
"circuit_id": "12345", | |
"new_bandwidith": 10 | |
}, | |
{ | |
"circuit_id": "67890", | |
"new_bandwidth": 12 | |
} |
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
// Write a program that finds all prime numbers up to n for input n | |
import java.util.Scanner; | |
class Untitled { | |
public static void main(String[] args) { | |
// FizzBuzz | |
boolean tree = false; | |
boolean five = false; | |
for (int i = 1; i <= 100; i++) { |
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
6 apt-get install php5-cli | |
7 php -v | |
8 add-apt-repository ppa:ondrej/php5 | |
9 apt-get update && sudo apt-get dist-upgrade | |
10 php -v | |
11 ls -al | |
12 php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php | |
13 php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '41e71d86b40f28e771d4bb662b997f79625196afcca95a5abf44391188c695c6c1456e16154c75a211d238cc3bc5cb47') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
14 php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
15 php -r "unlink('composer-setup.php');" |
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
tcp 0 0 *:ssh *:* LISTEN | |
tcp 0 0 43.249.56.14:39155 43.249.56.14:ssh TIME_WAIT | |
tcp 0 0 192.168.1.13:ssh 110.77.221.154:50447 ESTABLISHED | |
tcp 0 40 192.168.1.13:ssh 110.77.221.154:50216 ESTABLISHED | |
tcp6 0 0 [::]:ssh [::]:* LISTEN |
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
Active Internet connections (servers and established) | |
Proto Recv-Q Send-Q Local Address Foreign Address State | |
tcp 0 0 *:http *:* LISTEN | |
tcp 0 0 *:ssh *:* LISTEN | |
tcp 0 0 *:telnet *:* LISTEN | |
tcp 0 0 43.249.56.14:3737 *:* LISTEN | |
tcp 0 0 *:https *:* LISTEN | |
tcp 0 0 *:6379 *:* LISTEN | |
tcp 0 0 43.249.56.14:41699 43.249.56.14:6379 ESTABLISHED | |
tcp 0 0 43.249.56.14:6379 43.249.56.14:41699 ESTABLISHED |
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
https://gist.github.com/ec8ae8b9a5d2efc3b745 |
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
Netstat -a l grep ssh |
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
// This works | |
$http.jsonp('https://10.1.10.161/customer/mns/ajax.php?cuscode=bigc&type=circuit&callback=JSON_CALLBACK').then(function(json) { | |
console.log("Yay! we can now connect!"); | |
resolve(json.data); | |
}, function(err) { | |
reject(err); | |
console.log('Error get user', err); | |
}); |
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
app.use(function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
next(); | |
}); | |
app.get('/', function(req, res, next) { | |
// Handle the get for this route | |
}); |