Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
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 fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
IVI, VISA, SCPI
SCPI stands for Standard Commands for Programmable Instruments (SCPI), the commands is pure ASCII String, no physical communications link is not defined, it can be used in USB, GPIB, RS-232, Ethernet, VXI, etc.
Here is an example to make an Agilent U3606A (multimeter and DC power supply, usb interface) to work on Ubuntu 14.04.
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
''' | |
This module is used to convert diction to xml and convert xml to diction | |
usage: | |
import simplexml | |
simplexml.dumps(dict) # output xml string | |
simplexml.loads(xml) # output python dict | |
changelist: | |
0.2: add unicode support. |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import os | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import mpl_toolkits.mplot3d | |
from matplotlib import cm | |
import time |
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
"""tasks.py | |
""" | |
from __future__ import absolute_import | |
from celery import Celery | |
from celery import exceptions | |
app = Celery('tasks', broker='sqla+sqlite:///msg.db', backend='db+sqlite:///result.db') | |
app.conf.update(CELERY_TASK_SERIALIZER='json', CELERY_ACCEPT_CONTENT=['json'], CELERY_RESULT_SERIALIZER='json') | |
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
""" | |
test bom structure, use sqlalchemy | |
""" | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask import Flask | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db' | |
db = SQLAlchemy(app) |
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
""" | |
test bom structure, use sqlalchemy | |
""" | |
from flask.ext.sqlalchemy import SQLAlchemy | |
from flask import Flask | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db' | |
db = SQLAlchemy(app) |
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
console-log-level=info | |
#开启RPC 远程访问 | |
enable-rpc=true | |
#rpc-listen-port=16800 | |
rpc-listen-all=true | |
rpc-allow-origin-all=true | |
rpc-passwd=i-am-http-auth-password | |
rpc-user=i-am-http-auth-user | |
event-poll=epoll |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
from functools import wraps | |
import logging | |
import signal | |
"""test retry and timeout decorator | |
""" |
NewerOlder