Skip to content

Instantly share code, notes, and snippets.

View 0x3bfc's full-sized avatar
🌍
Focusing

Ahmed 0x3bfc

🌍
Focusing
View GitHub Profile
@0x3bfc
0x3bfc / Djapi.py
Created September 28, 2017 18:52
Sample Django API
from rest_framework.generics import (ListAPIView,
RetrieveAPIView,
DestroyAPIView,
RetrieveUpdateAPIView,
CreateAPIView,
GenericAPIView,
)
from rest_framework.mixins import UpdateModelMixin, DestroyModelMixin
from rest_framework.parsers import MultiPartParser, FormParser
from rest_framework.serializers import ValidationError
@0x3bfc
0x3bfc / mqconsumer.py
Created September 28, 2017 18:00
Message Queue Consumer
#!/usr/bin/python
import os, sys, random, string
import pika , rmq, requests, time
from manage import settings
from manage import mclient
from manage import azure
from manage import db
from manage import mesos
from manage import mongo as mongod
@0x3bfc
0x3bfc / manservice.py
Created September 28, 2017 17:57
Tornado Web Service
#!/usr/bin/python
import pwd
import grp
import json, os, datetime
import sys,ast, json
import tracker
import mongo as mongod
import tornado.httpserver
import tornado.escape
import tornado.ioloop
@0x3bfc
0x3bfc / flowGen.py
Created September 28, 2017 17:50
Workflow LUIGI Template Generator
import os
import sys
import random
import string
import json
import subprocess
PWD = os.path.dirname(os.path.abspath(__file__))
{
"configuration": {
"host" : "0.0.0.0",
"port" : 9000,
"endpoint": "paraview",
"content": "/opt/ParaView/install/share/visualizer/dist",
"proxy_file" : "/opt/ParaView/pythonLauncher/mapping/proxy.txt",
"sessionURL" : "wss://${host}:443/proxy?sessionId=${id}",
"timeout" : 5,
<VirtualHost *:443>
ServerName MYDOMAIN
ServerAdmin admin@MYDOMAIN
DocumentRoot "/opt/ParaView/install/share/visualizer/dist"
ErrorLog "/opt/ParaView/logs/pv-error_log"
CustomLog "/opt/ParaView/logs/pv-access_log" common
### The following commented lines could be useful when running
### over https and wss:
SSLEngine On
SSLCertificateFile /opt/ParaView/keys/cert.pem
# This is the CMakeCache file.
# For build in directory: /home/azureuser/paraviewweb/ParaView/build
# It was generated by CMake: /usr/local/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
## Run a multi-container app with Docker Compose
By [Mano Marks](https://github.com/ManoMarks)
This portion of the tutorial will guide you through the creation and customization of a voting app. It's important that you follow the steps in order, and make sure to customize the portions that are customizable.
**Important.**
To complete this section, you will need to have Docker and Docker Compose installed on your machine as mentioned in the [Setup](./setup.md) section. You'll also need have git installed. There are many options for installing it. For instance, you can get it from [GitHub](https://help.github.com/articles/set-up-git/).
You'll also need to have a [Docker Id](https://hub.docker.com/register/). Once you do run login from the commandline:
{
"configuration": {
"host" : "0.0.0.0",
"port" : 9000,
"endpoint": "paraview",
"content": "C:/Program Files (x86)/ParaView 4.1.0/share/paraview-4.1/www",
"proxy_file" : "/../proxy.txt",
"sessionURL" : "wss://${host}:${port}/proxy?sessionId=${id}/",
"timeout" : 5,
"log_dir" : "C:/Program Files (x86)/pythonLauncher/viz-logs",
<VirtualHost _default_:443>
SSLEngine on
SSLCertificateFile "C:\Program Files\Apache Software Foundation\SSL\apache.crt"
SSLCertificateKeyFile "C:\Program Files\Apache Software Foundation\SSL\apache.key"
ServerName portal.tessra.com
ServerAdmin admin@tessra.com
DocumentRoot "C:\Program Files (x86)\ParaView 4.1.0\share\paraview-4.1\www"
ErrorLog "logs/pv-error_log"
CustomLog "logs/pv-access_log" common