What I want to do is write an Application in Python and deploy it in django(I want to implement it on Linux platform), and that Application could manage DNS remotely in Active Directory(Windows environment).
It's preferred that all the scripts written in Cpython.
I tryed several ways below but failed:
Use a module called dnspython, but it seem only work with BIND DNS, that still doesn't support Window DNS.
Use pywin32 module to invoke WMI, but pywin32 is a module only for Windows platform and failed to work in Linux.
Use Ironpython, it is the only workaround I get, but not so good because all other applications will be in Cpython.
Can somebody provide a resolution? Or a workaround.
In my understand, I need a cpython scripts run in Linux that could remotely manage DNS in Active Directory on Windows platform.
If there is any problem about it, please let me know.
Any suggestions are appreciated.
Set up the windows machine as a chaching nameserver, with the linux box as its authoritative nameserver. That way you can just change the settings of BIND on the linux box, and the windows box should follow along.
This question probably belongs on server fault, though.
Related
I am trying to finish a personal project, which I describe its operation below.
My project consists of running a script (like a service) in the cloud.
I have on the one hand, a python script (created by me) which I want to host, and on the other hand a c++ script (not created by me), which I need to use from my python script, using boost-python.
My first way was to host my python script in pythonanywhere, but it doesn't work for me because the c++ script was designed for windows (it uses libraries only for the windows platform such as windows.h) and when compiling it ends in an error (pythonanywhere uses linux as base system).
So I would like someone to help me and tell me what is the correct way to do what I describe. I understand that it can be one of the following variants, but in some cases I am not entirely convinced that it can, or I do not know how to proceed.
Pay for a Virtual Desktop, and schedule the execution of my python script.
Use what is explained here.
Use a docket image with windows and host it somewhere.
Use Heroku
Note. My project needs/use a database.
Linux also supports C compilation. It's kernel is coded in C. Try compiling your code on linux with a tool like gcc, available on it.
I'm investigating ways to add vagrant to my development environment. I do most of my web development in python, and I'm interested in python-related specifics, however the question is more general.
I like the idea of having all development-related stuff isolated in virtual machine, but I haven't yet discovered an effective way to work with it. Basically, I see 3 ways to set it up:
Have all services (such as database server, MQ, etc) as well as an application under development to run in VM. Developer would ssh to VM and edit sources there, run app, tests, etc, all in an ssh terminal.
Same as 1), but edit sources on host machine in mapped directory with normal GUI editor. Run application and tests on vagrant via ssh. This seems to be most popular way to use vagrant.
Host only external services in VM. Install app dependencies into virtualenv on host machine and run app and tests from there.
All of these approaches have their own flaws:
Developing in text console is just too inconvenient, and this is the show-stopper for me. While I'm experienced ViM user and could live with it, I can't recommend this approach to anyone used to work in any graphical IDE.
You can develop with your familiar tools, but you cannot use autocompletion, since all python libs are installed in VM. Your tracebacks will point to non-local files. You will not be able to open library sources in your editor, ctags will not work.
Losing most of "isolation" feature: you have to install all compilers, *-dev libraries yourself to install python dependencies and run an app. It is pretty easy on linux, but it might be much harder to set them all up on OSX and on Windows it is next to impossible I guess.
So, the question is: is there any remedy for problems of 2nd and 3rd approaches? More specifically, how is it possible to create an isolated and easily replicatable environment, and yet enjoy all the comfort of development on host machine?
In most IDE you can add "library" path which are outside the project so that your code completion etc works. About the traceback, I'm unfamiliar with python but this sounds like issue that are resolved by "mapping" paths between servers and dev machine. This is generally the reason why #2 is often the way to go (Except when you have a team willing to do #1).
I need to develop a daemon service which also has presence in System Tray. The system tray icon allows users to customize/access some options through right click menu. It might open a window as well manage those options in a better way.
The app would mostly be communicating with a RESTful service, posting and downloading files.
Now I know that for any daemon service, it needs to be native. However we don't have the luxury to maintain 3 different dev pipelines, specially since the app is experimental(but might land up in hands of users)
I have experience in Java/Scala, followed by C++/Python/JS. I would prefer java/Scala (existing codebase) but open to frameworks in other languages.
I was thinking of doing a scala based app with swing for windowing, but it is not pretty.
Any ideas?
We have an App, same base code, running on Windows, OSX and Linux (with system tray) using these two set of components:
The Tanuki Java Service Wrapper to handle the lifecycle of the app. It also allows installing the component as a "native" windows service. Version 3.2.3 is under LGPL if that helps.
The Java 6 java.awt.SystemTray which is supported on most platforms. On OSX, we use a modified version of macify to implement OSX specific gimmicks like doc icons
You could go with JavaFX and the ScalaFX bindings. They look to be very actively maintained, and the syntax seems pretty clean. Only trouble is that it seems to have poor support for using the system tray - see this discussion for details and some workarounds.
You can use Real Studio to create a Windows Service and OS X/Linux daemons. Real Studio creates native apps for Windows, OS X and Linux.
I have written multiple python windows services, and now I need to port them to Linux.
These services are constantly repeating until an endflag is raised signalling the stoppage of work. This is just like any service in windows, it implements the start/stop/restart methods using the pywin32 libraries to hook into the windows' framework. Is there a framework for these command in Linux? I cannot find any documentation on this.
is there a pattern to follow when developing Linux services (daemons)? If so, where can I find these resources?
I know there are many 3rd party packages for Linux Daemon on pypi, does anyone have preferences?
Is there a way to see if a service is running on a different Linux box? Can you start and stop a service on a linux box remotely?
If you cannot check if a service is running in linux, what I was thinking of doing was creating a server that accepts a variety of commands like:
STATUS - informs if a job is running on machine X
TURNOFF - ends the service (if it can be done)
TURNON - turns the service on a machine (if it can be done)
Sorry for the broad range of questions, but I'm a Linux noob.
Thanks
You have a number of different options, but in general you're going to need to look into the Linux side of things, outside of Python, to decide what makes sense. What Linux distribution you choose also makes a difference as some of them use different service management frameworks by default. I personally tend to like upstart, it has simple straight forward config files, and is also there by default in Ubuntu. Take a look at this blog(not mine) it gives a great overview of some of the different options.
Welcome to wild world of Linux, it may seem weird at first, but it's really fun!
I'm building some simple editors with Backbone.js, and I'm hoping to be able to distribute them as apps for users to edit content in a mostly client-side way (i.e., I don't want users to have to futz with setting up stuff like MySQL or Apache).
So I was imagining a scenario like:
User downloads a .zip file
In the resulting opened folder, the user clicks index.html
That opens in a browser
Backbone app starts, stores data in localStorage
The user can then export to CSV.
Believe it or not, that would solve my problem: I want to help users edit data in a browser and then get it back out in a familiar format (CSV can be loaded into Excel, for instance).
And I’d like to do this without forcing them to configure a server. It seems like this is almost possible in the HTML5 stack. However, in at least one browser (Chrome), this doesn't work, because I get errors like this one:
XMLHttpRequest cannot load file:///users/me/project/data/Appdata.json. Origin null is not allowed by Access-Control-Allow-Origin.
(Oddly enough, I don't get that error in Firefox, and the .js or .json files load fine.)
So at this point it seems to me that there's no way around having these users use something kind of local server to serve up the Backbone interface.
So, I'm trying to figure out how to build a distributable, cross-platform executable that will allow my users to start a Flask server. (I hope to build a REST backend to a Backbone.js app.)
Is this wishful thinking? I'm assuming I can get the people in question to install Python.
Is this doable? There seem to be many ways to package up Python programs, (pyinstaller? py2exe? ...) So I thought I would ask here in case someone might know of a solution for the stack I have in mind.
TIA!
You can use Anthony Gordon McMillan’s Pyinstaller or Tuininga’s cx_Freeze
Quoting the PyInstaller website:
Features
Packaging of Python programs into standard executables, that work on
computers without Python installed.
Multiplatform: works under
Windows (32-bit and 64-bit),
Linux (32-bit and 64-bit),
Mac OS X (32-bit only, 64-bit in git, see Features/MacOsCompatibility) and
experimentally Solaris and AIX (in git).
Multiversion: works under any version of Python from 2.2 up to 2.7.
My suggestion would be to create a thin service wrapper around your code. This will allow the server to run independently of your main codebase - also allowing the user to shut down the server directly (simply right clicking the service icon and selecting "Exit").
This SO answer should help you get started.
After reading your updated question, I think something like mongoose might be more suited to your task. It is an embeddable web server that is FLOSS and has python bindings. Flask might be overkill.
Not easily. On Windows, you'd have to include Python itself. Mac and Linux usually have Python installed, but you can't be sure of what version so it's often easier to bundle your specific Python for them as well. Then you'd have to include all the dependencies that you want to run with in your package or be able to install them with pip, easy_install, etc.
You can use py2app and py2exe. This won't be cross-platform as you'll still need to make a different version for each target OS. The only way to make it cross-platform is to bundle all versions and have some cross-platform code execute the appropriate version for that platform.
If you need databases like MySQL or even SQLite things get more complicated as you'll have to include those too.