Skip to content
View gist:d9aeb2f72e3fae45a21f4ca1584077a0
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def post(self):
json = request.json
View gist:024808949b496f63d6d9306e840b71ca
from datetime import datetime, timedelta
import sys
import os
from flask import Flask
from apscheduler.schedulers.background import BackgroundScheduler
app = Flask(__name__)
View fileupload.py
def upload_file(request):
if request.method == 'POST':
form = NetworkScriptForm(request.POST, request.FILES)
if form.is_valid():
content = request.FILES['file'].read()
networkscript = NetworkScript.objects.create(
title=request.POST['title'],
script=content,
)
return render(request, 'bod_detail.html', {'networkscript': networkscript})
View gist:ee6bd24ec66dcd88181606f230f98d94
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'}
View gist:b9c82e181aba9cca51a7fe56868d4c3b
{
"new_bandwidths": [
{
"circuit_id": "12345",
"new_bandwidith": 10
},
{
"circuit_id": "67890",
"new_bandwidth": 12
}
View gist:1c9ce578022ef6a87f1c
// 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++) {
View gist:a6dc6f278d0dd2e13653
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');"
View gist:4f8ad676e4fbb2e6f1e9
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
View gist:bd0c1dbdca39b6c932b6
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
Something went wrong with that request. Please try again.