Python with Org-Babel
What is this about?
This is an initial look at how to use org-babel to create a literate-programming document. In the past I have used jupyter notebooks and pweave to do similar things, with each having a separate role - jupyter notebooks are good for interactive exploration but somewhat less amenable to working with sphinx (which I did with pweave). The hope here is that the org-babel system will provide something more amenable to both. Since you still have to convert the org-files to restructured text files (with pandoc or ox-nikola) it's still not everything I wanted, but hopefully this will make things a little easier
Most of this is stolen from this page - I'm fairly new to org-babel in general so I'm just walking in other people's footsteps for now.
Also, the inclusion of the org-babel code turned out to be both tedious and aesthetically unsatisfying so I didn't do it as much as I thought I would. The original org-file is here.
High-Level Module Structure
One nice thing about the org-babel/noweb system is that it has a system that makes it easy to create a template (in this case based on the the module structure from Code Like A Pythonista) with parts that we're updating inserted using the noweb syntax. To actually see this I had to include the python code as an org-mode snippet so the syntax highlighting isn't there.
#+begin_src python :noweb yes :tangle literate_python/literate.py
"""A docstring for the literate.py module"""
# imports
import sys
<<literate-main-imports>>
# constants
# exception classes
# interface funchtions
# classes
<<LiterateClass-definition>>
# internal functions & classes
<<literate-main>>
if __name__ == "__main__":
status = main()
sys.exit(status)
#+end_src
This is what the final file looks like once the no-web substitutions happen.
"""A docstring for the literate.py module"""
# imports
import sys
from argparse import ArgumentParser
# constants
# exception classes
# interface funchtions
# classes
class LiterateClass(object):
"""A class to be substituted above
Parameters
----------
String who: name of user
"""
def __init__(self, who):
self.who = who
return
def __call__(self):
print("Who: {0}".format(self.who))
# internal functions & classes
def main():
parser = ArgumentParser(description="literate caller")
parser.add_argument("-w", "--who", type=str,
default="me", help="who are you?")
args = parser.parse_args()
who = args.who
thing = LiterateClass(who)
thing()
return 0
if __name__ == "__main__":
status = main()
sys.exit(status)
To create the `literate.py` file (and all the other code-files) you see above execute M-x org-babel-tangle
.
LiterateClass
This is the class definition that get substituted above. The code block for the definition is named LiterateClass-definition
so the main template will substitute its contents for <<LiterateClass-definition>>
when it gets tangled.
class LiterateClass(object):
"""A class to be substituted above
Parameters
----------
String who: name of user
"""
def __init__(self, who):
self.who = who
return
def __call__(self):
print("Who: {0}".format(self.who))
Main functions
The Code Like a Pythonista template expects that you are creating a command-line executable with a main entry-point. This section implements that case as an example.
First the <<literate-main-imports>>
.
from argparse import ArgumentParser
Now the <<literate-main>>
.
def main():
parser = ArgumentParser(description="literate caller")
parser.add_argument("-w", "--who", type=str,
default="me", help="who are you?")
args = parser.parse_args()
who = args.who
thing = LiterateClass(who)
thing()
return 0
As a quick check we can run the code at the command line to see that it's working (the main block has to be tangled for this to work).
python literate_python/literate.py --who "Not Me"
Who: Not Me
Testing
One nice thing about the org-babel infrastructure is that the tests and source can be put in the same org-file, then exported to separate files to be run.
Doctest
For the stdout output, doctesting can be a convenient way to check that things are behaving as expected while also providing an explicit example of how to run the command-line interface.
Setting up the cases
The output of a successful doctest is nothing, which is good for automated tests but less interesting here so I'll make a doctest that passes and one that should fail.
This next section (named literate-doctest
) creates a code snippet that will pass.
example::
>>> from literate_python.literate import LiterateClass
>>> thing = LiterateClass("Gorgeous George")
>>> thing()
Who: Gorgeous George
And now here's a test (named literate-bad-doctest
) that will fail.
bad::
>>> bad_thing = LiterateClass("Gorilla Glue")
>>> bad_thing()
Who: Magilla Gorilla
This next section will include the two doctests and export them to a file so they can be tested. Note that you need an empty line between the tests for both of them to run. Warning - since this file is going to be exported, if you are using nikola
or some other system that assumes all files with a certain file-extension are blog-posts you have to use an extension that won't get picked up (in my case both rst
and txt
were interpreted as blog-posts).
#+begin_src text :noweb yes :tangle literate_python/test_literate_output.doctest :exports none
<<literate-doctest>>
<<literate-bad-doctest>>
#+end_src
Which gets tangled into this. Note that the doctests aren't valid python so you can tangle this but not execute it.
example::
>>> from literate_python.literate import LiterateClass
>>> thing = LiterateClass("Gorgeous George")
>>> thing()
Who: Gorgeous George
bad::
>>> bad_thing = LiterateClass("Gorilla Glue")
>>> bad_thing()
Who: Magilla Gorilla
Running the doctests
Now we can actually run them with python to see what happens.
python -m doctest literate_python/test_literate_output.doctest
true
********************************************************************** File "literate_python/test_literate_output.doctest", line 9, in test_literate_output.doctest Failed example: bad_thing() Expected: Who: Magilla Gorilla Got: Who: Gorilla Glue ********************************************************************** 1 items had failures: 1 of 5 in test_literate_output.doctest ***Test Failed*** 1 failures.
Note that since this returned a non-zero exit code (I think) you need to put true
in the code block or there would be no output.
PyTest BDD
While doctests are neat I prefer unit-testing, in particular using Behavior Driven Development (BDD) facilitated in this case by py.test
and pytest_bdd
.
The feature file
Identifying the code-block with #+begin_src feature
adds some syntax highlighting (if you have feature-mode installed and set-up). This works both when you are in the external editor and in the main org-babel document as well.
To make sure that org-babel recognizes feature mode add this to the init.el
file.
(add-to-list 'org-src-lang-modes '("feature" . "feature"))
This is what is going in the feature file.
Feature: Literate Class
Scenario: Creating a literate object
Given a name
When a Literate object is created with the name
Then the literate object has the name
The test file
This is another file that gets tangled out. In this case it is so that we can run py.test
on it.
from expects import expect
from expects import equal
from pytest import fixture
from pytest_bdd import given
from pytest_bdd import scenario
from pytest_bdd import then
from pytest_bdd import when
# this code
from literate import LiterateClass
FEATURE_FILE = "literate.feature"
class Context(object):
"""context object"""
@fixture
def context():
return Context()
@scenario(FEATURE_FILE, "Creating a literate object")
def test_constructor():
return
@given("a name")
def add_name(context, faker):
context.name = faker.name()
@when('a Literate object is created with the name')
def create_object(context):
context.object = LiterateClass(context.name)
@then("the literate object has the name")
def check_object_name(context):
expect(context.name).to(equal(context.object.who))
return
Running the test
One important thing to note is that this will put an error message in a separate buffer if something goes wrong (like you don't have py.test installed), which in at least some cases makes it look like it failed silently. Unlike with the doctests, no output means something in the setup needs to be fixed, so you should tangle the file and then run it at the command-line to debug what happened.
py.test -v literate_python/testliterate.py
============================= test session starts ============================== platform linux -- Python 3.5.1+, pytest-3.0.5, py-1.4.32, pluggy-0.4.0 -- /home/cronos/.virtualenvs/nikola/bin/python3 cachedir: .cache rootdir: /home/cronos/projects/nikola/posts, iniimg-url: plugins: faker-2.0.0, bdd-2.18.1 collecting ... collected 1 items literate_python/testliterate.py::test_constructor PASSED =========================== 1 passed in 0.04 seconds ===========================
Getting This Into Nikola
I tried three ways to get this document into nikola:
ox-nikola worked (as did pandoc), but at the moment I'm trying to use the orgmode plugin so that I can keep editing this document without having to convert back and forth. This is turning out to be about the same amount of work as using jupyter (and with a steeper learning curve). But I like the folding and navigation that org-mode offers, so I'll stick with it for a bit. I'm just using the default set-up right now. It seems to work.
The main problem I had initially was the same one I had with jupyter - I'm starting with a file that wasn't generated by the nikola new_post
sub-command so it didn't have the header that nikola expected but the only error nikola build
reported was an invalid date format.
This is what needs to be at the top of the org-file for nikola to work with it (or something like it).
#+BEGIN_COMMENT
.. title: Python with Org-Babel
.. slug: python-with-org-babel
.. date: 2016-12-28 14:12:41 UTC-08:00
.. tags: howto python babel literateprogramming
.. category: how_to
.. link:
.. description:
.. type: text
#+END_COMMENT
The other thing is that the org-mode plugin doesn't seem to copy over the png-files correctly (or at all) so I had to create a files/posts/python-with-org-babel/literate_python
folder and move the UML diagram over there by hand. Lastly, it didn't color the feature file and since there's no intermediate rst-file I don't really know how to fix this. Either I'm going to have to learn a lot more about org-mode than I might want to, or for cases where I want more control over things I'll use ox-nikola to convert it to rst first and edit it. That kind of wrecks the one-document idea, but I guess it would also give me a reason to re-work and polish things instead of improvising everything.


Click here to get a random fact about me:
Hello, my name is Robert Wong, but I often go by Robbie, and I am currently pursuing a degree in computer engineering at California State University, Fresno. I have interests in software engineering, artificial intelligence, autonomous vehicles, and green energy and always strive to further my knowledge in related subjects.
Profiles
You can view my LinkedIn profile here.
You can view my GitHub profile here.
You can view my IEEE profile here.


DEVOPS FOR SCIENTISTS
---------------------
[Stef Countryman -- 2019/07/15] [home] [blogs]
Something that surprises me about physicists is that many of us don't appreciate that good DevOps can massively improve our scientific output with relatively little extra work. For anything other than throwaway scripts, proper DevOps lets you:
There is one superficially plausible (though invalid, as I'll argue) reason for not consciously choosing proper DevOps paradigms for scientific computing: it takes a lot of time to learn, and most physicists--through a failure of our education system--are starting from scratch when they begin their Ph.D.s. By "scratch", I don't just mean zero DevOps experience; I mean close-to-zero programming experience. Many people I've met say that a student has too much to learn straight away, and they consequently don't have time to learn some of the common tools that are used for both the development and operations aspects of good DevOps:
Of course, these naysayers are right that you cannot learn this stuff in-and-out in a week, or a year, or even in the time it takes to do your Ph.D.; your toolchain might also not be amenable to these or other DevOps tools, or you might never end up practically needing all of them. But the thing is, you could say the exact same thing about every other type of expertise demanded by physics research: you start from zero and need to start being productive while being hopelessly ignorant of the full context. Grad students have been handling this challenge for centuries; throwing some code in with the math and physics formulae and hardware engineering skills is no-less reasonable. On the contrary, good development and operations practices actually factor out problems nicely and make it easier to learn how to code! Especially when I was first starting, I learned far more from DevOps adepts' scientific source code repostitories than I did from the scattered, mangled, "simpler" code I found elsewhere. So why do so many physicists view DevOps as some sort of capitalist-tech-decadence that nobody outside of software engineering would care about or benefit from?
Because most of them, even the ones who rely heavily on computation, don't know what they're missing.
Paul Graham has a blog post from two decades ago where he talks about the advantage you can create for yourself by using a powerful programming language (his choice was LISP, but the point is a general one about tooling). In his essay, he presents a fictional language called Blub with a mediocre set of features. If you only know Blub, you don't understand the fancy features of other languages/tools, and they sound like beautiful but useless masturbation by people who don't care about getting work done.  It's Sapir-Whorf for code in the most rigorous sense: words and concepts with hyper-specific meanings cannot be used unless you understand them deeply, but if this condition is met, your understanding of the world deepens as well. If you know something better than Blub, you don't just use it's nice features: you think in terms of those features, and it makes your coding better across the board. Maybe you still use Blub 90% of the time, but you use it more adeptly, you understand its limitations, and you don't use it when you need something better. This is the same reason we learn powerful, advanced math to actually simplify our understanding of physical laws.
When applied to development practices, however, this seems like hogwash to physicists, who mostly speak Blub dialects. They might know their language of choice (frequently: MATLAB, python2.7, or C++) passably well, but they don't think of code as part of the same hollistic problem-solving ecosystem that hosts Mathematics and Physics. To many physicists, even basic DevOps tools like version control ("why can't we just email code to each other?") or cloud computing ("we should use our allocated time on the school's supercomputer!") often sound like useless tools for tool-fetishists.  (An immediate example: I chose hand-coded HTML/CSS for this simple website, but my analysis pipeline control systems use Flask for interactivity; in both cases, the solution is efficient given the goal.) If you don't know that things can be better, you're obviously not going to stress about this, but ignorance is only bliss until you're banging your head against the wall trying to run simulations at scale using software that only runs on your laptop.
What's funny to me about all of this, though, is that physicists of all people absolutely should not be fine with this. We were drawn to physics because it's pretty. Keats was wrong in the general case about beauty and truth being equivalent (as one of my favorite math professors, the late Patrick X. Gallagher, put it: Keats got lazy with this one). However, in physics, the truth is often at least describable by something beautiful, its beauty arising from simplicity and elegance of the language, as Dirac so eloquently mused. There is a tradeoff, in the sense that you need to organize and refactor your mathematical tools to see the simplicity of the physical forms you wish to describe, but we do it anyway, precisely because it gives us both the tools to do hard problems and the intuition to reason about things simply. Physicists know that abstractions are useful, but for some reason we draw a boundary when those abstractions are outside the ken of Mathematics and Physics departments. We limit ourselves to the software version of Newton's Second Law, F=ma, cutting ourself off from any hope of solving truly hard problems. And because we willfully remain ignorant, we undermine our chances at improving.
I don't think there's an obvious solution for this cultural rot, but individual reasearchers who rely on any non-trivial amount of code to do their work can at least help themselves and those they mentor by improving DevOps practices. It requires a Bulkington-esque reilience, though, to keep your research projects afloat (please forgive my meager and quotidian shoehorning of this sublime passage into a productivity metaphor):
With all her might she crowds all sail off shore; in so doing, fights 'gainst the very winds that fain would blow her homeward; seeks all the lashed sea's landlessness again; for refuge's sake forlornly rushing into peril; her only friend her bitterest foe!
Know ye now, Bulkington? Glimpses do ye seem to see of that mortally intolerable truth; that all deep, earnest thinking is but the intrepid effort of the soul to keep the open independence of her sea; while the wildest winds of heaven and earth conspire to cast her on the treacherous, slavish shore?
But as in landlessness alone resides highest truth, shoreless, indefinite as God- so better is it to perish in that howling infinite, than be ingloriously dashed upon the lee, even if that were safety! For worm-like, then, oh! who would craven crawl to land! Terrors of the terrible! is all this agony so vain? Take heart, take heart, O Bulkington! Bear thee grimly, demigod! Up from the spray of thy ocean-perishing- straight up, leaps thy apotheosis!
This is pretty much what it feels like to do software development in science (of course, one hopes for an apotheosis free from ocean-perishing). Our general ignorance and accompanying disdain for non-mathematical technologies (and, to be frank, our often hubristic approach to other disciplines) leads us to undervalue DevOps technologies as "engineering", a slur in the mouth of a physicist. This is in spite of the fact that our code and deployment infrastructure (or lack thereof) is what does the heavy-lifting in much of our research: all arguments of practicality aside, if we don't understand the mechanism that produces our results, then we are not doing our job as physicists. Nonetheless, you won't see people get academic credit for authoring open-source scientific libraries that do the work of 10 research groups; you'll only get credit for such an effort if you can get papers out of it, and nobody will understand your work anyway, so you won't get much credit for how elegant and wonderful it is.
We're also all overworked or overambitious (same thing but self-imposed), creating further pressure to cut all corners possible. In my experience, the benefits of good DevOps mentioned above actually reduce your workload while improving your output, but this is not a well-known fact, and in any case, knowing DevOps just makes you smarter about picking corners to cut. This means even the best physicists and scientific programmers working in physics can't always do everything the best way possible (a truism for any human endeavor, but especially harsh as applied in the sciences).
Furthermore, physics academia's fundamental mode of operation runs counter to good production development practices. Academia is like a large collection of startup incubators, trying new things and failing fast, but because of our grant-based funding model and hyper-specialization, we have a very hard time transitioning from minimum-viable-product (MVP) to production-grade code when one of our genuinely good ideas acheives traction. It's a bit terrifying to realize how much mission-critical scientific code is MVP abandonware written a decade ago by a 22-year old who learned python for the first time a year prior to writing it (and who has forgotten the entire architecture since getting her Ph.D. and going into industry).
In short, the winds are conspiring to blow us into the rocks (in the same non-intentional emergent way that the literal winds do, of course), dashing our scientific projects to pieces; you really do need to fight against everyone else to do what's best for the entire community, keeping your project away from infrastructural collapse, and you need to do it strategically enough to get credit for it and persist in the howling infinite of academia without perishing (what happens when you don't publish, as the old adage goes). And since we're all weathering this awful storm, cutting corners and fighting for the survival of our projects, we have to deal with all of the rough edges in each other's scientific coding projects. We're avoiding the rocks while trying not to crash into each other in the gale. It's a miracle that anything gets done at all.
I've dealt with this in my own project, LLAMA, by doing my best to incorporate good practices starting from the most general/fundamental and only learning/using new tools as needed. Of course, I look at other projects both inside and outside of science for inspiration, but I think hard about the simplest way to do things before I start throwing in new features (LLAMA's design requirements are already onerous enough). I can recommend this approach in good conscience to any other physicist (read: programming neophyte) because it's worked very well for me to cut corners deliberately and strategically while designing an overall strategy/architecture/feature list that allows me to stop cutting specific corners when the time comes.
One example of this approach is the computing model of LLAMA. It would be very useful to be able to do burst-computing analyses of new astrophysical multi-messenger sources as data comes in. This requires having a supercomputer reserved for your full-time use (not feasible if your budget isn't in the tens of millions) or, alternatively, using some kind of spot-instance allocation strategy to raise a mountain of computation (and let it die seconds later once the problem is solved).
This architecture has plenty of immediately obvious real-life uses for multi-messenger astrophysics (MMA). If you can run an analysis in low-latency and detect a joint gravitational wave/EM source, for example, you can quickly follow it up with other telescopes, like we did with the first direct kilonova observation. Though the gamma-ray detection localization wasn't good enough to really aid counterpart searches for that event (GW170817), there are other types of candidates (like GW+neutrinos, my current and past project) for which this rapid localization would be a huge improvement. And if you can do really hard things like estimate the GW source parameters before merger (e.g. whether you're looking at a binary neutron star merger, which is likely to emit detectable light if it's close enough), you can try to get fast-slewing telescopes pointing on source at merger time. Not to mention that burst processing would let you do more clever things with your statistics (getting better sensitivity) in low-latency as well. So stuff that makes this easier is really exciting from an experimental physics perspective.
This is, amazingly, a completely feasible architecture for a pipeline maintained by a small team (read: me) thanks to the continuum approximation that is the commercial Cloud, with extreme low-latencies possible through serverless architectures like Amazon's AWS Lambda system. I'm transitioning my pipeline to be able to use these sorts of serverless architectures, but the main reason I can't do this trivially (e.g. my laptop fires 10,000 Lambda requests when it needs to do some real thinking and then reduces the results) is another DevOps problem: I need to use a lot of monolithic, project-wide libraries (read: minimal python installs of many gigabytes), far beyond Lambda's layer-size limitations.
My solution is to split up my own monolithic architecture so that subcomponents can run in limited environments, allowing some steps in my pipeline DAG to be implemented on Lambda; this is the direction I'm moving in (it also has certain development advantages). That said, leaving my own monolith behind requires some careful planning. For one thing, reproducibility is easier if you only need to track a single code version; it's more work to have a fully-reproducible infrastructure (something I'm working on with versioned containers, detailed file-generation metadata, and automated build/test processes). It's also sometimes necessary to hot-fix things in production: this is science, so the APIs I pull data from are not versioned and are subject to breaking changes during production with nothing more than a short email thread to announce them (I get hundreds of emails a day from both major collaborations I'm in (LIGO and IceCube), so tracking these changes is its own hell). This means being able to develop and fix things extremely quickly is paramount, which is also easier on a properly-factored monolith unless you have a proper microservices architecture and deployment system. We also get crazy demands for new features during production from other collaborators and scientists that make my software development friends gasp. And nobody understands anything I do because documentation isn't prioritized, so I have to do all this in a way that's maintainable and extensible by one person. (Seriously, I need to fight to document and properly refactor/maintain my code sometimes because people don't understand these tasks and, therefore, obviously don't want to allocate time for them.)
This is all hard fundamentally because scientific software development is, like I said, a gale of overworked developers and misaligned incentives threatening to cast us on the treacherous, slavish shore. All of our code has 1/3 the manpower it should, so we're all prioritizing ruthlessly with varying degrees of success. Some people have done really amazing, inspiring work using best-practices devops and the rest, and it's slowly getting better in many spots, but the systemics of the dev environment means that unless you're a 10x person, your scientific code is going to be pretty rough around the edges. But even at the local level, DevOps can provide massive benefits and even competitive advantage against the gale. I'm cautiously optimistic that physics academia, which is eventually smart in the way a distributed database can be eventually consistent (albeit much more slowly), will improve.
In the meantime, if you're a physicist working with code, you can start reaping these benefits immediately. There's a lot to learn because the status quo is so terrible. If you want a prioritized checklist of topics/methods useful to the scientific developer, I recommend learning things in roughly the following order:
This is a rough sketch for how to start, but it's close to the approach I've successfully taken to solve hard technical problems. This is based on a lot of thinking and actual scientific development experience, but of ource you should take it with a grain of salt and read a bit about each of these technologies before implementing them. Some people disagree with me about some of these points, but in a scientific development context, I think these are all pretty frequently true.
Good luck staying afloat.


Dependency injection is a design pattern that frees your code from creational concerns, making your code cleaner and easier to test.
This tutorial illustrates how easy it is to use a dependency injection framework with Play. Guice is used here, however other dependency injection frameworks such as Spring can be supported in a similar manner.
Although Scala is used here, Play and Java can also easily use dependency injection frameworks. Check out the Play Spring Data example for a Java example of using Spring with Play after this tutorial.
This tutorial will take about 10 minutes to complete and assumes that you are already familiar with the basics of a Play application.
The mission is to use the familiar starting point of a Play application and enhance it with dependency injection. We will be taking the Application class and injecting a a TextGenerator instance into it. TextGenerator is an abstract class and we have a concrete implementation of it in the form of WelcomeTextGenerator.
TextGenerator is a rudimentary service that simply generates text. You'll have more useful services in your code e.g. a repository service that is backed by a concrete class to communicate with a database. By using dependency injection we can configure the type of service required outside of the class that needs to call on it.
@Inject is the JSR-330 standard for declaring that an object is required to be injected into another object. @Singleton is also part of JSR-330 and declares that a single instance is to be shared across multiple injections.
Our shared Application instance declares that it requires an instance of the TextGenerator type. We are using what is known as "constructor injection" here, the alternate being what is known as "setter injection". We prefer constructor injection as once that property is assigned it cannot be changed i.e. the value is immutable and inherently thread safe.
TextGenerator does not require anything special in order to be "injectable" i.e. something that can be injected into something else. We have declared TextGenerator as an abstract class here but it can be any type i.e. a concrete class or a trait (we have used an abstract class in recognition of the "is-a" relation between vs "has-a").
WelcomeTextGenerator is a concrete implementation of the TextGenerator. Having the implementation separated from the injectable type frees you to provide alternate implementations of it. For this project the application will share a single instance of WelcomeTextGenerator; hence the @Singleton annotation. Our tests will use a mocked version of WelcomeTextGenerator so that the classes that are injected with a TextGenerator can be easily tested.
Note that although we use @Singleton on the Application and WelcomeTextGenerator, these "scopes" can be overridden when it comes to binding. Binding is discussed next.
Global brings the dependency injection system to life by establishing a dependency graph and then providing Play a means of resolving object instances under its management.
First of all an
Injector
is created. An Injector is responsible building the dependency graph. Our injector
states that whenever a type of TextGenerator
is required then use an instance of
WelcomeTextGenerator
.
The next thing is that getControllerInstance
will return object instances from the dependency
injection system.
An interesting point to note is that the Global object is the only place in our application where there is Guice specific code. This is because JSR-330's @Inject and @Singleton annotations are being used. You should therefore be able to use this project's main files and other dependency injection frameworks with very little modification.
By convention Play looks for an object instance when resolving routes. However
routes can be configured so that
locating the route instance will call upon the Global
object's getControllerInstance
method. A simple "@" symbol in front of the controller method
path in the routes is all that is required
i.e. @controllers.Application.index
.
ApplicationTest illustrates a benefit of dependency injection where a mock of the TextGenerator is used for unit testing purposes. Using a mock makes testing easier as we are not interested in testing the actual type implemented by the mock - just the calls that we make upon it.
The ApplicationIT is an integration test that brings our dependency injection system into life and sets expectations on what should be seen upon invoking the controller.
ApplicationFT is a functional test. Note that the entire application is run and the test is around sending HTTP requests and verifying their responses. Just as with the integration test, the dependency injection system is tested thoroughly.
This tutorial has introduced how Google Guice can be used for developing Play applications. Other dependency injection systems such as Spring can be similarly incorporated. The Global object establishes the dependency injection system and the routes file requires classes to be referenced via the '@' symbol.
By separating the creational concerns from a class, classes can remain focused on the job they are intended to do and have their code remain clean and devoted to that purpose. In addition your classes will become more testable, particularly from a unit test perspective, given that injectable types can easily be mocked.


Highly-motivated Data Scientist with a background in Bioinformatics. Organized and active, I have three big passions: Artificial Intelligence, design and cars. I am a creative and ambitious person, always trying to deliver the best possible product within the deadline. In my free time I am always challenging myself with new topics to read, programming languages to learn or staying up to speed with the tech world. Whatever the product I am building is, I am always looking forward to deliver high-quality Machine Learning solutions packed in an effective, consistent and usable format.
Currently looking for an internship/thesis in the field of Deep Learning / Machine Learning / Data Science and Engineering.


In the MATLAB language, each value is assigned to a class. For example, creating a variable with an assignment statement (the operator =) constructs a variable of the appropriate class:
>> a = 7; >> b = 'some string'; >> whos Name Size Bytes Class
a 1x1 8 double b 1x11 22 char
Basic commands like whos display the class of each value in the workspace. This information helps MATLAB users to recognize that some values are characters and display as text while other values might be double, single, or other types of numbers. Some variables can contain different classes of values like cells.
You can view classes as new data types having specific behaviors defined for the class. For example, a polynomial class might redefine the addition operator (+) so that it correctly performs the operation of addition on polynomials. In our case the addition operator between two Transect objects could create a Database object. Operations defined to work with objects of a particular class are known as methods of that class. When you define a class, you can overload special MATLAB functions (plus.m for the addition operator) that are called by the MATLAB runtime when those operations are applied to an object of your class.
MATLAB classes use the following words to describe different parts of a class definition and related concepts.
Class definition — Description of what is common to every instance of a class.
Properties — Data storage for class instances
Methods — Special functions that implement operations that are usually performed only on instances of the class
Objects — Instances of classes, which contain actual data values stored in the objects' properties
Packages — Folders that define a scope for class and function naming
These are general descriptions of these components and concepts. The Matlab class documentation describes all of these components in detail.
A class instance is created by two different ways of calling the class constructor.
A call with no argument will create the object with default properties:
>> T = transect;
A call with pairs of properties/properties-values will fill specified fields:


Assembly
| Type | Summary |
|---|---|
| DataModelExtensions | Helper extensions for work with IDataModels. |
| DataPropertyDisplayMetadataProvider | Creates a display metadata bases in DataProperty attribute data. |
| Editor | Editor defines a generic model for a CRUD web editor including the data model and aditional properties. |
| HeaderAttribute | Sets a ViewData["Header"] value for an action or controller. |
| HttpExtensions | Extensions methods for Http related objects. |
| MainMenuActiveItemAttribute | Stores the Id of the active main menu item with in a ViewData key. |
| NoCacheAttribute | Disable caching for a controller or action. |
| PathAttribute | Sets a ViewData["Path"] value for an action or controller. |
| ViewResultExtensions | Helper extensions for view results. |
| Type | Summary |
|---|---|
| AuthApiAttribute | Configures the roles required to access an api controller or action. |
| AuthApiRoleRequirementFilter | An AuthorizationFilter that sets a StatusCodeResult when the user is not authorized. |
| AuthMvcAttribute | Configures the roles required to access a controller or action. |
| AuthMvcRoleRequirementFilter | An AuthorizationFilter that sets a ViewResult when the user is not authorized. |
| Type | Summary |
|---|---|
| DataModelModelBinder | Binds a complex model and initializes the properties configured within the application context. |
| DataModelModelBinderProvider | An IModelBinderProvider that provides a model binder for IDataModel objects. |
| DecimalModelBinder | An IModelBinder for Decimal and Nullable`1
where T is Decimal. |
| DecimalModelBinderProvider | An IModelBinderProvider for binding Decimal and it Nullable`1 wrappers. |
| Type | Summary |
|---|---|
| LabelForRequiredTagHelper | ITagHelper implementation targeting <label> elements with an asp-for-required attribute. |
| SpanHintTagHelper | ITagHelper implementation targeting <span> elements with an asp-hint-for attribute. |


BOUT is a game to bring all the fun of your regular Collectible Card Game to the casual player's table. There is no long preparation of unbeatable decks, no single rounds consuming an entire evening and not even any collecting involved.
Just put it to the table and start a bout with anyone!
2 players 30-90 minutes


You can use Java VisualVM to browse the contents of a heap dump file and quickly see the allocated objects in the heap. Heap dumps are displayed in the heap dump sub-tab in the main window. You can open binary format heap dump files (.hprof) saved on your local system or use Java VisualVM to take heap dumps of running applications.
A heap dump is a snapshot of all the objects in the Java Virtual Machine (JVM) heap at a certain point in time. The JVM software allocates memory for objects from the heap for all class instances and arrays. The garbage collector reclaims the heap memory when an object is no longer needed and there are no references to the object. By examining the heap you can locate where objects are created and find the references to those objects in the source. If the JVM software is failing to remove unneeded objects from the heap, Java VisualVM can help you locate the nearest garbage collecting root for the object.
If you have a heap dump file saved on your local system, you can open the file in Java VisualVM by choosing File > Load from the main menu. Java VisualVM can open heap dumps saved in the .hprof file format. When you open a saved heap dump, the heap dump opens as a tab in the main window.
You can use Java VisualVM to take a heap dump of a local running application. When you use Java VisualVM to take a heap dump, the file is only temporary until you explicitly save it. If you do not save the file, the file will be deleted when the application terminates.
You can take a heap dump by doing either of the following:
Heap dumps for a local application open as sub-tabs in the application's tab. The heap dump also appears as a time-stamped heap dump node under the application node in the Applications window. To save a heap dump to your local system, right-click the heap dump in the Applications window and choose Save As.
Java VisualVM enables you to visually browse heap dumps in the following views:
When you open a heap dump, Java VisualVM displays the Summary view by default. The Summary view displays the running environment where the heap dump was taken and other system properties.
The Classes view displays a list of classes and the number and percentage of instances referenced by that class. You can view a list of the instances of a specific class by right-clicking the name and choosing Show in Instances View.
You can sort how results are displayed by clicking a column heading. You can use the filter below the list to filter the classes by name or limit the displayed results to sub-classes of a class by right-clicking a class name and choosing Show Only Subclasses.
The Instance view displays object instances for a selected class. When you select an instance from the Instance pane, Java VisualVM displays the fields of that class and references to that class in the respective panes. In the References pane, you can right-click an item and choose Show Nearest GC Root to display the nearest garbage collection root object.


Register
Required field
First Name is too long
Last Name is too short
Invalid email
Passwords does not match


This page fetches your HabitRPG daily habit progress and displays your streaks of success (or shame). Find your ID and API key in the Account Settings of HabitRPG, or use demo/demo to see how terrible I am. The display updates as you select new "Earliest Date" values. Please report bugs in GitHub. I love feedback: get my contact info and reach out.


KubernetesClusterResolver
ClusterResolver for Kubernetes.
Inherits From: ClusterResolver
tf.compat.v1.distribute.cluster_resolver.KubernetesClusterResolver
tf.compat.v2.distribute.cluster_resolver.KubernetesClusterResolver
This is an implementation of cluster resolvers for Kubernetes. When given the the Kubernetes namespace and label selector for pods, we will retrieve the pod IP addresses of all running pods matching the selector, and return a ClusterSpec based on that information.
__init__
__init__( job_to_label_mapping=None, tf_server_port=8470, rpc_layer='grpc', override_client=None )
Initializes a new KubernetesClusterResolver.
This initializes a new Kubernetes ClusterResolver. The ClusterResolver will attempt to talk to the Kubernetes master to retrieve all the instances of pods matching a label selector.
job_to_label_mapping
: A mapping of TensorFlow jobs to label selectors.
This allows users to specify many TensorFlow jobs in one Cluster
Resolver, and each job can have pods belong with different label
selectors. For example, a sample mapping might be
{'worker': ['job-name=worker-cluster-a', 'job-name=worker-cluster-b'],
'ps': ['job-name=ps-1', 'job-name=ps-2']}
tf_server_port
: The port the TensorFlow server is listening on.rpc_layer
: (Optional) The RPC layer TensorFlow should use to communicate
between tasks in Kubernetes. Defaults to 'grpc'.override_client
: The Kubernetes client (usually automatically retrieved
using from kubernetes import client as k8sclient
). If you pass this
in, you are responsible for setting Kubernetes credentials manually.ImportError
: If the Kubernetes Python client is not installed and no
override_client
is passed in.RuntimeError
: If autoresolve_task is not a boolean or a callable.environment
Returns the current environment which TensorFlow is running in.
There are two possible return values, "google" (when TensorFlow is running in a Google-internal environment) or an empty string (when TensorFlow is running elsewhere).
If you are implementing a ClusterResolver that works in both the Google environment and the open-source world (for instance, a TPU ClusterResolver or similar), you will have to return the appropriate string depending on the environment, which you will have to detect.
Otherwise, if you are implementing a ClusterResolver that will only work in open-source TensorFlow, you do not need to implement this property.
cluster_spec
cluster_spec()
Returns a ClusterSpec object based on the latest info from Kubernetes.
We retrieve the information from the Kubernetes master every time this method is called.
A ClusterSpec containing host information returned from Kubernetes.
RuntimeError
: If any of the pods returned by the master is not in the
Running
phase.master
master( task_type=None, task_id=None, rpc_layer=None )
Returns the master address to use when creating a session.
You must have set the task_type and task_id object properties before
calling this function, or pass in the task_type
and task_id
parameters when using this function. If you do both, the function parameters
will override the object properties.
task_type
: (Optional) The type of the TensorFlow task of the master.task_id
: (Optional) The index of the TensorFlow task of the master.rpc_layer
: (Optional) The RPC protocol for the given cluster.The name or URL of the session master.
num_accelerators
num_accelerators( task_type=None, task_id=None, config_proto=None )
Returns the number of accelerator cores per worker.
This returns the number of accelerator cores (such as GPUs and TPUs) available per worker.
Optionally, we allow callers to specify the task_type, and task_id, for if they want to target a specific TensorFlow process to query the number of accelerators. This is to support heterogenous environments, where the number of accelerators cores per host is different.
task_type
: (Optional) The type of the TensorFlow task of the machine we
want to query.task_id
: (Optional) The index of the TensorFlow task of the machine we
want to query.config_proto
: (Optional) Configuration for starting a new session to
query how many accelerator cores it has.A map of accelerator types to number of cores.


Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
Note:
Example 1:
Input:
beginWord = "hit",
endWord = "cog",
wordList = ["hot","dot","dog","lot","log","cog"]
Output: 5
Explanation: As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog",
return its length 5.
Example 2:
Input:
beginWord = "hit"
endWord = "cog"
wordList = ["hot","dot","dog","lot","log"]
Output: 0
Explanation: The endWord "cog" is not in wordList, therefore no possible transformation.
Think of it as building a tree, with begineWord
as root and endWord
as leaves.
The best way control the depth (length of the shortest transformations) while building the tree is level-order traversal (BFS).
We do not actually build the tree because it is expensive (astronomical if the list is huge). In fact, we only need one shortest path. So just like Dijkstra’s algorithm, we say that the first time (level i
) we encounter a word that turns out to be in a shortest path, then level i
is the lowest level this word could ever get. We can safely remove it from the wordList
.
To find all the next words, instead of filtering the wordList
, enumerate all 25 possible words and check if in wordList
.
/**
* @param {string} beginWord
* @param {string} endWord
* @param {string[]} wordList
* @return {number}
*/
var ladderLength = function(beginWord, endWord, wordList) {
wordList = new Set(wordList)
if (!wordList.has(endWord)) { return 0 }
const ALPHABET = 'abcdefghijklmnopqrstuvwxyz'
let level = 1
const queue = [beginWord, null]
while (queue.length > 1) {
const word = queue.shift()
if (word === null) {
level++
queue.push(null)
continue
}
for (let i = word.length - 1; i >= 0; i--) {
const head = word.slice(0, i)
const tail = word.slice(i+1)
for (let c = 0; c < 26; c++) {
if (ALPHABET[c] !== word[i]) {
const word = head + ALPHABET[c] + tail
if (word === endWord) {
return level + 1
}
if (wordList.delete(word)) {
queue.push(word)
}
}
}
}
}
return 0
};
Template generated via Leetmark.


Search allows you to search content created by tools within a worksite or course. It achieves this by creating an index of all content that other tools make available to the search tool. This index is updated automatically, so as content is added to the worksite or course, it will be indexed.
For example, if the worksite or course has an email list, as emails are posted to the list, the content of those emails will be indexed and become searchable in the search tool.
Search indexes many different types of content, including messages, web pages in HTML format, documents in DOC, PDF, or RTF format, spreadsheets in XLS format, and Wiki pages.
On the Search
page, you will find an entry box.
To search, simply enter the words that you want to search for.
Once you have performed a search, you will notice that an RSS icon appears with the search results. This enables you to watch the search in your favourite RSS reader. If you take some time to look at the advanced search features, you will find that you can generate RSS feeds of all sorts of information in the index.


NOTE: This is built for use use in Firefox, Chrome, Opera & Safari.
Use your keyboard directional arrows to advance the slides.
There are no controls for iOS & IE doesn’t work at all.
About Me
Ink Pixels Paper is my tiny design shop, providing communication services for non-profit, small and corporate businesses – design & production for books, collateral, signage, tradeshow graphics; interface & experience design for applications; design & development for websites.
This is my first time presenting on a web topic. I’m a performing independent musician & exhibiting visual artist, but… frankly, I’m still nervous!
Q: What challenges do you face coding buttons?
- Creation & maintenance of images
- Internationalization & localization
- Enhancing “clickability” (interaction)
- Maintaining separation of content, style & behaviour in the code
- CSS3 offers you a solution!
Why style buttons?
- Make your call-to-action tantalizing. The more attention it gets, the clearer it is to the viewer what they should do.
- CSS states – active, focus, hover, visited – are useful & create CSS hooks + opportunity for interactivity.
- BUT, just because you can, doesn’t mean you should.
- Please, use good taste & judgement.
What is CSS?
- CSS is Cascading Style Sheets.
- CSS allows for separation of content & style, which creates information flexibility.
- Ideally, HTML is completely useful with no style or behavior (JavaScript or CSS).
CSS Structure
Basic Button Styling
Default styles
- HTML:
<form>

Link

<input type="submit" value="Submit"/>

<button type="submit">Button</button>

</form>
- CSS:
a.link { font-size:200%; }
a:hover.link, a:focus.link
{ color:#fff; text-decoration:underline; }
button, input
{ background:#fff; font-size:48px; padding:.1em .5em; }
button:hover, input:hover, button:focus, input:focus
{ background:#444; color:#ccc; }
button:active, input:active
{ background:#222; color:#000; }
Basic Button Styling
Image buttons
- Pros: visually interesting, consistent x-browser appearance
- Cons: inflexible to update, a lot of work to create/maintain, creating buttons for multiple languages is very resource-intensive, slower & more bandwidth-intensive, more http requests, complex CSS, & don’t scale with text
Note: these are intentionally ugly because I don’t think image buttons are a good way to go — my personal bias.
CSS 2.1
CSS allows for color, border, backgrounds, & text replacement.
Technically, even CSS2.1 isn’t an approved spec.
Browser Support for CSS3
What about using CSS3 today?
- Many CSS3 features are ready to use today in modern browsers.
- Others can be added to browsers that do not support the tech natively using polyfills (also called shims or shivs). A polyfill, or polyfiller, is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively — flattening the API landscape (some call it Regressive Enhancement).
Have you ever built rounded corner buttons without CSS3?
Stellar Creativity - Experimental
Thank you!
I hope you enjoyed the presentation, & thanks for your attention.
I prefer not to take onstage questions after my talks. Trust me, I do want to talk with you — but I believe onstage Q&A is a flawed format. It forces others to sit through questions that may not be relevant.  It encourages speakers to issue trite diagnosis, not truthful complexity.
Rather than perpetuate this tired ritual, find me afterwards.
Let’s talk in person — it’s far more fun.
Thanks,
<EMAIL_ADDRESS>| @inkpixelspaper
http://sorrynoquestions.com/


To send a market order, call the MarketOrder
, Buy
, or Order
method and provide a Symbol
and quantity. If you don't have sufficient capital for the order, it's rejected. By default, market orders are synchronous and fill immediately.
// Buy orders MarketOrder("IBM", 100); Buy("AAPL", 10); Order("SPY", 20); // Sell orders MarketOrder("AMZN", -15); Sell("TSLA", 25); Order("SPY", -20);
# Buy orders self.MarketOrder("IBM", 100) self.Buy("AAPL", 10) self.Order("SPY", 20) # Sell orders self.MarketOrder("AMZN", -15) self.Sell("TSLA", 25) self.Order("SPY", -20)
You can also provide a tag and order properties to the Order
and MarketOrder
methods.
MarketOrder(symbol, quantity, tag: tag, orderProperties: orderProperties);
self.MarketOrder(symbol, quantity, tag=tag, orderProperties=order_properties)
If you place a market order during pre-market or post-market hours, LEAN converts your order to market on open order. To override this behavior, create a custom fill model. To be notified when the default fill model allows you to submit market orders outside of regular trading hours, subscribe to GitHub Issue #3947.


{{ _("You can change the name and email address later in Settings.") }}
{{ _("When GC Notify sends your emails, the ‘From’ field shows the name followed by the email address.") }}
{{ _("Recipients can check the name and email address to confirm the message comes from your service.") }}
{{ _("In this example, a government service has chosen the name ‘Renew your license’ and the email address ’renew@notification.canada.ca’:") }}
{{ _("Service name: Renew your license | Renouveler votre permis") }}
{{ _("Email address<EMAIL_ADDRESS>}}
{{ _("GC Notify also shows the service name at the start of every text message.") }}
{{ _("The email address always ends with<EMAIL_ADDRESS>}} {% set hint_txt = _('Maximum 64 characters with no spaces. Characters can include letters, numbers, dots, dashes, and underscores.') %} {{ textbox(form.email_from, hint=hint_txt, suffix=suffix_txt, width='1-2', maxlength=64) }}
{{ _("This email address cannot receive replies. In Settings, you can enter a different email for replies. Currently your service is set to prevent replies.") }}
{% if config["FF_SALESFORCE_CONTACT"] %} {% set button_txt = _('Continue') %} {% else %} {% set button_txt = _('Create service') %} {% endif %} {{ page_footer(button_txt) }} {% endcall %}


Robotics engineer at NASA Ames. Born in London. Interested in machine learning and computer simulations. Occasional swimmer, biker, and baker. Check out my research, projects, and publications, or scroll down.
I graduated from the University of Jordan as a computer engineer; my Bachleor's thesis investigated the use of ensemble based machine learning algorithms on stock market prediction - the code and paper are both publicly available.
After graduation, I worked as a data scientist at ArabiaWeather, the Arab world's largest private weather forecasting company; I designed and built automatic weather prediction machine learning models, ran model verification tests, and enhanced existing simulation models to better suit the company's needs. I also worked on Jordan's first satellite: I was the lead engineer for the satellite's on board computer.
Now I'm a robotics engineer at NASA's Ames Research Center in California. As part of the Intelligent Robotics Group, we conduct applied research in computer vision, geospatial data systems, human-robot interaction, planetary mapping, and robot software.
Feel free to email me about job offers, project collaboration requests, questions about my projects, or just to say hello! You can also reach me on any of the social media platforms listed below. Be sure to check out my research and publications on their separate pages.


---
layout: default
permalink: /mvp-offer/
---
Get your Minimum Viable Product
MVP Offer
I give you a fixed price up front which means
no costly budget overruns and no risk for you.
I deliver quality software built to last for a long time.
If you are not happy with the result, I'll give your money back.
While I strive to write perfect code, the odd small bug is unavoidable
in complex systems like software. In this case I will fix it for
free as long as the software is in use, guaranteed.
Why take the uncertainty of an estimate when you can have a guaranteed fixed price upfront?
I have written about this a few times and feel quite strongly about it. Every consultant should give a fixed price upfront for every project. No guesswork, no overruns, just reliability and no risk.
The way it works is that we sit down and define what your software is going to do and what it is not going to do. I will then give you a fixed price which is exactly what the project will cost you no more no less.
I deliver quality software built to last for a long time. If you are not happy with the result, I'll give your money back.
I will involve you in the process as much or as little as you like. As soon as I have something to demo you I'll give you the opportunity to provide feedback. Once a final version has been agreed, I will hand everything over to you.
In the unlikely case that for whatever reason we cannot agree on a final version of the software, I will give your money back.
What if you find a bug after the software has gone live?
I build quality software. If you find any bug after the software has gone live, let me know and I will fix it for free forever. Not six months, not a year, forever.
So where's the catch? There really isn't one. The only thing I would say is that I offer this for my own code only. If someone else modifies the code, my warranty is void so to speak. Also a bug isn't the same as a new feature. If there is something you'd like the software to do, let me know and I'll offer you a price.


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Inherited @Documented public @interface Transactional
Describes transaction attributes on a method or class.
This annotation type is generally directly comparable to Spring's
RuleBasedTransactionAttribute
class, and in fact AnnotationTransactionAttributeSource
will directly
convert the data to the latter class, so that Spring's transaction support code
does not have to know about annotations. If no rules are relevant to the exception,
it will be treated like
DefaultTransactionAttribute
(rolling back on runtime exceptions).
For specific information about the semantics of this annotation's attributes,
consider the TransactionDefinition
and
TransactionAttribute
javadocs.
TransactionAttribute
,
DefaultTransactionAttribute
,
RuleBasedTransactionAttribute
| Optional Element Summary | |
|---|---|
Isolation |
isolation
The transaction isolation level. |
Class<? extends Throwable>[] |
noRollbackFor
Defines zero (0) or more exception Classes , which must be a
subclass of Throwable , indicating which exception types must not
cause a transaction rollback. |
String[] |
noRollbackForClassName
Defines zero (0) or more exception names (for exceptions which must be a subclass of Throwable ) indicating which exception types must not
cause a transaction rollback. |
Propagation |
propagation
The transaction propagation type. |
boolean |
readOnly
true if the transaction is read-only. |
Class<? extends Throwable>[] |
rollbackFor
Defines zero (0) or more exception classes , which must be a
subclass of Throwable , indicating which exception types must cause
a transaction rollback. |
String[] |
rollbackForClassName
Defines zero (0) or more exception names (for exceptions which must be a subclass of Throwable ), indicating which exception types must cause
a transaction rollback. |
int |
timeout
The timeout for this transaction. |
String |
value
A qualifier value for the specified transaction. |
public abstract String value
May be used to determine the target transaction manager,
matching the qualifier value (or the bean name) of a specific
PlatformTransactionManager
bean definition.
public abstract Propagation propagation
Propagation.REQUIRED
.
TransactionDefinition.getPropagationBehavior()
public abstract Isolation isolation
Isolation.DEFAULT
.
TransactionDefinition.getIsolationLevel()
public abstract int timeout
TransactionDefinition.getTimeout()
public abstract boolean readOnly
true
if the transaction is read-only.
Defaults to false
.
This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.
TransactionDefinition.isReadOnly()
public abstract Class<? extends Throwable>[] rollbackFor
classes
, which must be a
subclass of Throwable
, indicating which exception types must cause
a transaction rollback.
This is the preferred way to construct a rollback rule, matching the exception class and subclasses.
Similar to RollbackRuleAttribute.RollbackRuleAttribute(Class clazz)
public abstract String[] rollbackForClassName
Throwable
), indicating which exception types must cause
a transaction rollback.
This can be a substring, with no wildcard support at present.
A value of "ServletException" would match
ServletException
and subclasses, for example.
NB: Consider carefully how specific the pattern is, and whether
to include package information (which isn't mandatory). For example,
"Exception" will match nearly anything, and will probably hide other rules.
"java.lang.Exception" would be correct if "Exception" was meant to define
a rule for all checked exceptions. With more unusual Exception
names such as "BaseBusinessException" there is no need to use a FQN.
Similar to RollbackRuleAttribute.RollbackRuleAttribute(String exceptionName)
public abstract Class<? extends Throwable>[] noRollbackFor
Classes
, which must be a
subclass of Throwable
, indicating which exception types must not
cause a transaction rollback.
This is the preferred way to construct a rollback rule, matching the exception class and subclasses.
Similar to NoRollbackRuleAttribute.NoRollbackRuleAttribute(Class clazz)
public abstract String[] noRollbackForClassName
Throwable
) indicating which exception types must not
cause a transaction rollback.
See the description of rollbackForClassName()
for more info on how
the specified names are treated.
Similar to NoRollbackRuleAttribute.NoRollbackRuleAttribute(String exceptionName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |


vlmcsd - a fully Microsoft compatible KMS server
vlmcsd [ options ]
vlmcsd is a fully Microsoft compatible KMS server that provides product activation services to clients. It is meant as a drop-in replacement for a Microsoft KMS server (Windows computer with KMS key entered). It currently supports KMS protocol versions 4, 5 and 6.
vlmcsd is designed to run on POSIX compatible operating systens. It only requires a basic C library with a BSD-style sockets API and either fork(2) or pthreads(7). That allows it to run on most embedded systems like routers, NASes, mobile phones, tablets, TVs, settop boxes, etc. Some efforts have been made that it also runs on Windows.
Although vlmcsd does neither require an activation key nor a payment to anyone, it is not meant to run illegal copies of Windows. Its purpose is to ensure that owners of legal copies can use their software without restrictions, e.g. if you buy a new computer or motherboard and your key will be refused activation from Microsoft servers due to hardware changes.
vlmcsd may be started via an internet superserver like inetd(8) or xinetd(8) as well as an advanced init system like systemd(8) or launchd(8) using socket based activation. If vlmcsd detects that stdin(3) is a socket, it assumes that there is already a connected client on stdin that wants to be activated.
All options that control setting up listening sockets will be ignored when in inetd mode. The sockets will be set up by your internet superserver. You also cannot limit the number of simultanous clients (option -m). You need to configure the limit in your internet superserver.
The followong features that require that vlmcsd is permanently loaded will not work if started from an internet superserver:
You cannot maintain a client list (option -M1)
EPID Randomization Level 1 (option -r1) works like Level 2 (-r2). You may want to use Level 0 (-r0) or custom EPIDs (options -w, -G, -0, -3 and -6) instead.
Since vlmcsd can be configured at compile time, some options may not be available on your system.
All options
that do no require an argument may be combined with a single
dash, for instance "vlmcsd -D -e" is identical to
"vlmcsd -De". For all options that require an
argument a space between the option and the option argument
is optional. Thus "vlmcsd -r 2" and "vlmcsd
-r2" are identical too.
-h or -?
Displays help.
|
-V |
Displays extended version information. This includes the compiler used to build vlmcsd, the intended platform and flags (compile time options) to build vlmcsd. If you have the source code of vlmcsd, you can type make help (or gmake help on systems that do not use the GNU version of make(1) by default) to see the meaning of those flags. |
-L ipaddress[:port]
Instructs vlmcsd to listen on ipaddress with optional port (default 1688). You can use this option more than once. If you do not specify -L at least once, IP addresses <IP_ADDRESS> (IPv4) and :: (IPv6) are used. If the IP address contains colons (IPv6) you must enclose the IP address in brackets if you specify the optional port, e.g. [2001:db8::dead:beef]:1688.
If no port is specified, vlmcsd uses the default port according to a preceding -P option. If you specify a port, it can be a number (1-65535) or a name (usually found in /etc/services if not provided via LDAP, NIS+ or another name service).
If you specify a link local IPv6 address (fe80::/10, usually starting with fe80::), it must be followed by a percent sign (%) and a scope id (=network interface name or number) on most unixoid OSses including Linux, Android, MacOS X and iOS, e.g. fe80::1234:56ff:fe78:9abc%eth0 or [fe80::1234:56ff:fe78:9abc%2]:1688. Windows (including cygwin) does not require a scope id unless the same link local address is used on more than one network interface. Windows does not accept a name and the scope id must be a number.
-o level
Sets the level of protection against activations from public IP addresses. The default is -o0 for no protection.
-o1 causes vlmcsd not to listen on all IP addresses but on private IP addresses only. IPv4 addresses in the <IP_ADDRESS>/10 range (see RFC6598) are not treated as private since they can be reached from other users of your ISP. Private IPv4 addresses are <IP_ADDRESS>/8, <IP_ADDRESS>/12, <IP_ADDRESS>/16, <IP_ADDRESS>/16 and <IP_ADDRESS>/8. vlmcsd treats all IPv6 addresses not within 2000::/3 as private addresses.
If -o1 is combined with -L, it will listen on all private IP addresses plus the ones specified by one or more -L statements. If -o1 is combined with -P, only the last -P statement will be used.
Using -o1 does not protect you if you enable NAT port forwarding on your router to your vlmcsd machine. It is identical to using multiple -L statements with all of your private IP addresses. What -o1 does for you, is automatically enumerating your private IP addresses.
-o2 does not affect the interfaces, vlmcsd is listening on. When a clients connects, vlmcsd immediately drops the connection if the client has a public IP address. Unlike -o1 clients will be able to establish a TCP connection but it will be closed without a single byte sent over the connection. This protects against clients with public IP addresses even if NAT port forwarding is used. While -o2 offers a higher level of protection than -o1, the client sees that the KMS TCP port (1688 by default) is actually accepting connections.
If vlmcsd is compiled to use MS RPC, -o2 can only offer very poor protection. Control is passed from MS RPC to vlmcsd after the KMS protocol has already been negotiated. Thus a client can always verify that the KMS protocol is available even though it receives an RPC_S_ACCESS_DENIED error message. vlmcsd will issue a warning if -o2 is used with MS RPC. For adaequate protection do not use a MS RPC build of vlmcsd with -o2.
-o3 combines -o1 and -o2. vlmcsd listens on private interfaces only and if a public client manages to connect anyway due to NAT port forwarding, it will be immediately dropped.
If you use any form of TCP level port forwarding (e.g. nc(1), netcat(1), ssh(1) port forwarding or similar) to redirect KMS requests to vlmcsd, there will be no protection even if you use -o2 or -o3. This is due to the simple fact that vlmcsd sees the IP address of the redirector and not the IP address of the client.
-o1 (and thus -o3) is not (yet) available in some scenarios:
FreeBSD: There is a longtime unfixed bug in the 32-bit ABI of the 64-bit kernel. If you have a 64-bit FreeBSD kernel, you must run the 64-bit version of vlmcsd if you use -o1 or -o3. The 32-bit version causes undefined behavior up to crashing vlmcsd. Other BSDs (NetBSD, OpenBSD, Dragonfly and Mac OS X) work correctly.
If vlmcsd was started by an internet superserver or was compiled to use Microsoft RPC (Windows only) or simple sockets, -o1 and -o3 are not available by design.
-P port
Use TCP port for all subsequent -L statements that do not include an optional port. If you use -P and -L, -P must be specified before -L.
-O vpn-adapter-name[=ipv4-address][/cidr-mask][:dhcp-lease-duration]
Enables a compatible VPN adapter to create additional local IPv4 addresses (like <IP_ADDRESS>) that appear as remote IPv4 addresses to the system. This allows product activation using a local instance of vlmcsd. This feature is only available in Windows and Cygwin builds of vlmcsd since it is not of any use on other operating systems. Compatible VPN adapters are Tap-windows version 8.2 or higher (from OpenVPN) and the TeamViewer VPN adapter. There are two special vpn-adapter-names. A single period (.) instructs vlmcsd to use the first available compatible VPN adapter. A single dash (-) disables the use of a VPN adapter if one has been configured in vlmcsd.ini(5). The vpn-adapter-name is not case-sensitive. If the vpn-adapter-name contains spaces (e.g. Ethernet 3), you must enclose it in quotes.
The default ipv4-address is <IP_ADDRESS> and the default cidr-mask is 30. If you are using the default values, your VPN adapter uses an IPv4 address of <IP_ADDRESS> and you can set your activation client to use the easy to remember address <IP_ADDRESS> (e.g. slmgr /skms <IP_ADDRESS> or cscript ospp.vbs /sethst:<IP_ADDRESS>).
The dhcp-lease-duration is a number optionally followed by s, m, h, d or w to indicate seconds, minutes, hours, days or weeks. The default dhcp-lease-duration is 1d (one day). It is normally not required to change this value.
It is advised not to manually configure your OpenVPN TAP or TeamViewer VPN adapter in "Network Connections". If you set the IPv4 configuration manually anyway, the IPv4 address and the subnet mask must match the -O parameter. It is safe leave the IPv4 configuration to automatic (DHCP). vlmcsd will wait up to four seconds for the DHCP configuration to complete before binding to and listenin on any interfaces.
You should be aware that only one program can use a VPN adapter at a time. If you use the TeamViewer VPN adapter for example, you will not be able to use the VPN feature of TeamViewer as long as vlmcsd is running. The same applies to OpenVPN TAP adapters that are in use by other programs (for example OpenVPN, QEMU, Ratiborus VM, aiccu, etc.). The best way to avoid conflicts is to install Tap-Windows from OpenVPN, cd to C:\Program Files\TAP-Windows\bin and run addtap.bat to install an additional TAP adapter. Go to "Network Connections" and rename the new adapter to "vlmcsd" and specify -O vlmcsd to use it.
Example: -O "Ethernet 7"=<IP_ADDRESS>/24 (uses VPN adapter Ethernet 7 with IPv4 address <IP_ADDRESS> and have <IP_ADDRESS> to <IP_ADDRESS> as additional local (but apparently remote) IPv4 addresses.
-x0 and -x1
Controls under what circumstances vlmcsd will exit. Using the default of -x0 vlmcsd stays active as long as it can perform some useful operations. If vlmcsd is run by any form of a watchdog, e.g. NT service manager (Windows), systemd (Linux) or launchd (Mac OS / iOS), it may be desirable to end vlmcsd and let the watchdog restart it. This is especially true if some pre-requisites are not yet met but will be some time later, e.g. network is not yet fully setup.
By using -x0 vlmcsd will
exit if none of the listening sockets specified with -L can be used. It continues if at least one socket can be setup for listening.
exit any TAP mirror thread (Windows version only) if there is an error condition while reading or writing from or to the VPN adapter but continue to work without utilizing a VPN adapter.
By using -x1 vlmcsd will
exit if not all listening sockets specified with -L can be used.
exit completely if there is a problem with a VPN adapter it is using. This can happen for instance if the VPN adapter has been disabled using "Control Panel - Network - Adapter Settings" while vlmcsd is using it.
Please note that -x1 is kind of a workaround option. While it may help under some circumstances, it is better to solve the problem at its origin, e.g. properly implementing dependencies in your startup script to ensure all network interfaces and the VPN adapter you will use are completely setup before you start vlmcsd.
-F0 and -F1
Allow (-F1) or disallow (-F0) binding to IP addresses that are currently not configured on your system. The default is -F0. -F1 allows you to bind to an IP address that may be configured after you started vlmcsd. vlmcsd will listen on that address as soon as it becomes available. This feature is only available under Linux (IPv4 and IPv6) and FreeBSD (IPv4 only). FreeBSD allows this feature only for the root user (more correctly: processes that have the PRIV_NETINET_BINDANY privilege). Linux does not require a capability for this.
-t seconds
Timeout the TCP connection with the client after seconds seconds. After sending an activation request. RPC keeps the TCP connection for a while. The default is 30 seconds. You may specify a shorter period to free ressources on your device faster. This is useful for devices with limited main memory or if you used -m to limit the concurrent clients that may request activation. Microsoft RPC clients disconnect after 30 seconds by default. Setting seconds to a greater value does not make much sense.
-m concurrent-clients
Limit the number of clients that will be handled concurrently. This is useful for devices with limited ressources or if you are experiencing DoS attacks that spawn thousands of threads or forked processes. If additional clients connect to vlmcsd, they need to wait until another client disconnects. If you set concurrent-clients to a small value ( <10 ), you should also select a reasonable timeout of 2 or 3 seconds with -t. The default is no limit.
|
-d |
Disconnect each client after processing one activation request. This is a direct violation of DCE RPC but may help if you receive malicous fake RPC requests that block your threads or forked processes. Some other KMS emulators (e.g. py-kms) behave this way. | ||
|
-k |
Do not disconnect clients after processing an activation request. This selects the default behavior. -k is useful only if you used an ini file (see vlmcsd.ini(5) and -i). If the ini file contains the line "DisconnectClientsImmediately = true", you can use this switch to restore the default behavior. |
-N0 and -N1
Disables (-N0) or enables (-N1) the use of the NDR64 transfer syntax in the RPC protocol. Unlike Microsoft vlmcsd supports NDR64 on 32-bit operating systems. Microsoft introduced NDR64 in Windows Vista but their KMS servers started using it with Windows 8. Thus if you choose random ePIDs, vlmcsd will select ePIDs with build numbers 9200 and 9600 if you enable NDR64 and build numbers 6002 and 7601 if you disable NDR64. The default is to enable NDR64.
-B0 and -B1
Disables (-B0) or enables (-B1) bind time feature negotiation (BTFN) in the RPC protocol. All Windows operating systems starting with Vista support BTFN and try to negotiate it when initiating an RPC connection. Thus consider turning it off as a debug / troubleshooting feature only. Some older firewalls that selectively block or redirect RPC traffic may get confused when they detect NDR64 or BTFN.
-l filename
Use filename as a log file. The log file records all activations with IP address, Windows workstation name (no reverse DNS lookup), activated product, KMS protocol, time and date. If you do not specify a log file, no log is created. For a live view of the log file type tail -f file.
If you use the special filename "syslog", vlmcsd uses syslog(3) for logging. If your system has no syslog service (/dev/log) installed, logging output will go to /dev/console. Syslog logging is not available in the native Windows version. The Cygwin version does support syslog logging.
-T0 and -T1
Disable (-T0) or enable (-T1) the inclusion of date and time in each line of the log. The default is -T1. -T0 is useful if you log to stdout(3) which is redirected to another logging mechanism that already includes date and time in its output, for instance systemd-journald(8). If you log to syslog(3), -T1 is ignored and date and time will never be included in the output sent to syslog(3).
|
-D |
Normally vlmcsd daemonizes and runs in background (except the native Windows version). If -D is specified, vlmcsd does not daemonize and runs in foreground. This is useful for testing and allows you to simply press <Ctrl-C> to exit vlmcsd. |
The native Windows version never daemonizes and always behaves as if -D had been specified. You may want to install vlmcsd as a service instead. See -s.
|
-e |
If specified, vlmcsd ignores -l and writes all logging output to stdout(3). This is mainly useful for testing and debugging and often combined with -D. | ||
|
-v |
Use verbose logging. Logs every parameter of the base request and the base response. It also logs the HWID of the KMS server if KMS protocol version 6 is used. This option is mainly for debugging purposes. It only has an effect if some form of logging is used. Thus -v does not make sense if not used with -l, -e or -f. | ||
|
-q |
Do not use verbose logging. This is actually the default behavior. It only makes sense if you use vlmcsd with an ini file (see -i and vlmcsd.ini(5)). If the ini file contains the line "LogVerbose = true" you can use -q to restore the default behavior. |
-p filename
Create pid file filename. This has nothing to do with KMS ePIDs. A pid file is a file where vlmcsd writes its own process id. This is used by standard init scripts (typically found in /etc/init.d). The default is not to write a pid file.
-u user and -g group
Causes vlmcsd to run in the specified user and group security context. The main purpose for this is to drop root privileges after it has been started from the root account. To use this feature from cygwin you must run cyglsa-config and the account from which vlmcsd is started must have the rights "Act as part of the operating system" and "Replace a process level token". The native Windows version does not support these options.
The actual security context switch is performed after the TCP sockets have been created. This allows you to use privileged ports (< 1024) when you start vlmcsd from the root account.
However if you use an ini, pid or log file, you must ensure that the unprivileged user has access to these files. You can always log to syslog(3) from an unprivileged account on most platforms (see -l).
-a CSVLK = ePID [ / HwId ]
Use ePID and HwId for a specific CSVLK. When you use it, -r is disregarded for this CSVLK. If vlmcsd uses the default vlmcsd.kmd database, you can use the following CSVLKs: Windows, WinChinaGov, Office2010, Office2013, Office2016 and Office2019. The -a option requires that database version 1.6 or later is used.
HwId must be specified as 16 hex digits that are interpreted as a series of 8 bytes (big endian). Any character that is not a hex digit will be ignored. This is for better readability.
-i filename
Use configuration file (aka ini file) filename. Most configuration parameters can be set either via the command line or an ini file. The command line always has precedence over configuration items in the ini file. See vlmcsd.ini(5) for the format of the configuration file.
If vlmcsd has been compiled to use a default configuration file (often /etc/vlmcsd.ini), you may use -i- to ignore the default configuration file.
-j filename
Use KMS data file filename. By default vlmcsd only contains the minimum product data that is required to perform all operations correctly. You may use a more complete KMS data file that contains all detailed product names. This is especially useful if you are logging KMS requests. If you don’t log, there is no need to load an external KMS data file.
If vlmcsd has been compiled to use a default KMS data file, you may use -j- to ignore the default configuration file.
-r0, -r1 (default) and -r2
These options determine how ePIDs are generated if
- you did not
sprecify an ePID in the command line and
- you haven’t used -i or
- the file specified by -i cannot be opened or
- the file specified by -i does not contain an ePID
for the KMS request
-r0 means there are no random ePIDs. vlmcsd simply issues default ePIDs that are built into the binary at compile time. Pro: behaves like real KMS server that also always issues the same ePID. Con: Microsoft may start blacklisting again and the default ePID may not work any longer.
-r1 instructs vlmcsd to generate random ePIDs when the program starts or receives a SIGHUP signal and uses these ePIDs until it is stopped or receives another SIGHUP. Most other KMS emulators generate a new ePID on every KMS request. This is easily detectable. Microsoft could just modify sppsvc.exe in a way that it always sends two identical KMS requests in two RPC requests but over the same TCP connection. If both KMS responses contain the different ePIDs, the KMS server is not genuine. -r1 is the default mode. -r1 also ensures that all three ePIDs (Windows, Office 2010 and Office 2013) use the same OS build number and LCID (language id).
If vlmcsd has been started by an internet superserver, -r1 works almost identically to -r2. The only exception occurs if you send more than one activation request over the same TCP connection. This is simply due to the fact that vlmcsd is started upon a connection request and does not stay in memory after servicing a KMS request. Consider using -r0 or -w, -G, -0, -3 and -6 when starting vlmcsd by an internet superserver.
-r2 behaves like most other KMS server emulators with random support and generates a new random ePID on every request. -r2 should be treated as debugging option only because it allows very easy emulator detection.
-C LCID
Do not randomize the locale id part of the ePID and use LCID instead. The LCID must be specified as a decimal number, e.g. 1049 for "Russian - Russia". This option has no effect if the ePID is not randomized at all, e.g. if it is selected from the command line or an ini file.
By default vlmcsd generates a valid locale id that is recognized by .NET Framework 4.0. This may lead to a locale id which is unlikely to occur in your country, for instance 2155 for "Quecha - Ecuador". You may want to select the locale id of your country instead. See MSDN for a list of valid LCIDs. Please note that some of them are not recognized by .NET Framework 4.0.
Most other KMS emulators use a fixed LCID of 1033 (English - US). To achive the same behavior in vlmcsd use -C 1033.
-H HostBuild
Do not randomize the host build number in the ePID and use HostBuild instead, for instance 17763 for Windows Server 2019 / Windows 10 1809.
-K0, -K1, -K2 and -K3
Sets the whitelisting level to determine which products vlmcsd activates or refuses. The default is -K0.
-K0:
activate all products with an unknown, retail or
beta/preview KMS ID.
-K1: activate products with a retail or beta/preview KMS
ID but refuse to activate products with an unknown KMS ID.
-K2: activate products with an unknown KMS ID but refuse
products with a retail or beta/preview KMS ID.
-K3: activate only products with a known volume license
RTM KMS ID and refuse all others.
|
The SKU ID is not checked. Like a genuine KMS server vlmcsd activates a product that has a random or unknown SKU ID. If you select -K1 or -K3, vlmcsd also checks the Application ID for correctness. If Microsoft introduces a new KMS ID for a new product, you cannot activate it if you used -K1 or -K3 until a new version of vlmcsd is available. |
-c0 and -c1
-c1 causes vlmcsd to check if the client time differs no more than four hours from the system time. -c0 (the default) disables this check. -c1 is useful to prevent emulator detection. A client that tries to detect an emulator could simply send two subsequent request with two time stamps that differ more than four hours from each other. If both requests succeed, the server is an emulator. If you specify -c1 on a system with no reliable time source, activations will fail. It is ok to set the correct system time after you started vlmcsd.
-M0 and -M1
Disables (-M0) or enables (-M1) maintaining a list of client machine IDs (CMIDs). The default is -M0. -M1 is useful to prevent emulator detection. By maintaing a CMID list, vlmcsd reports current active clients exactly like a genuine KMS emulator. This includes bug compatibility to the extent that you can permanently kill a genuine KMS emulator by sending an "overcharge request" with a required client count of 376 or more and then request activation for 671 clients. vlmcsd can be reset from this condition by restarting it. If -M0 is used, vlmcsd reports current active clients as good as possible. If no client sends an "overcharge request", it is not possible to detect vlmcsd as an emulator with -M0. -M1 requires the allocation of a buffer that is about 50 kB in size. On hardware with few memory resources use it only if you really need it.
If you start vlmcsd from an internet superserver, -M1 cannot be used. Since vlmcsd exits after each activation, it cannot maintain any state in memory.
-E0 and -E1
These options are ignored if you do not also specify -M1. If you use -E0 (the default), vlmcsd starts up as a fully "charged" KMS server. Clients activate immediately. -E1 lets you start up vlmcsd with an empty CMID list. Activation will start when the required minimum clients (25 for Windows Client OSses, 5 for Windows Server OSses and Office) have registered with the KMS server. As long as the minimum client count has not been reached, clients end up in HRESULT 0xC004F038 "The count reported by your Key Management Service (KMS) is insufficient. Please contact your system administrator". You may use vlmcs(1) or another KMS client emulator to "charge" vlmcsd. -E1 does not improve emulator detection prevention. It’s primary purpose is to help developers of KMS clients to test "charging" a KMS server.
-R renewal-interval
Instructs clients to renew activation every renewal-interval. The renewal-interval is a number optionally immediately followed by a letter indicating the unit. Valid unit letters are s (seconds), m (minutes), h (hours), d (days) and w (weeks). If you do not specify a letter, minutes is assumed.
-R3d for instance instructs clients to renew activation every 3 days. The default renewal-interval is 10080 (identical to 7d and 1w).
Due to poor implementation of Microsofts KMS Client it cannot be guaranteed that activation is renewed on time as specfied by the -R option. Don’t care about that. Renewal will happen well before your activation expires (usually 180 days).
Even though you can specify seconds, the granularity of this option is 1 minute. Seconds are rounded down to the next multiple of 60.
-A activation-interval
Instructs clients to retry activation every activation-interval if it was unsuccessful, e.g. because it could not reach the server. The default is 120 (identical to 2h). activation-interval follows the same syntax as renewal-interval in the -R option.
|
-s |
Installs vlmcsd as a Windows service. This option only works with the native Windows version and Cygwin. Combine -s with other command line options. These will be in effect when you start the service. The service automatically starts when you reboot your machine. To start it manually, type "net start vlmcsd". |
If you use Cygwin, you must include your Cygwin system DLL directory (usually C:\Cygwin\bin or C:\Cygwin64\bin) into the PATH environment variable or the service will not start.
You can reinstall the service anytime using vlmcsd -s again, e.g. with a different command line. If the service is running, it will be restarted with the new command line.
When using -s the command line is checked for basic syntax errors only. For example "vlmcsd -s -L <IP_ADDRESS>" reports no error but the service will not start if <IP_ADDRESS> is not an IP address on your system.
|
-S |
Uninstalls the vlmcsd service. Works only with the native Windows version and Cygwin. All other options will be ignored if you include -S in the command line. |
-U [domain\]username
Can only be used together with -s. Starts the service as a different user than the local SYSTEM account. This is used to run the service under an account with low privileges. If you omit the domain, an account from the local computer will be used.
You may use "NT AUTHORITY\NetworkService". This is a pseudo user with low privileges. You may also use "NT AUTHORITY\LocalService" which has more privileges but these are of no use for running vlmcsd.
Make sure that the user you specify has at least execute permission for your executable. "NT AUTHORITY\NetworkService" normally has no permission to run binaries from your home directory.
For your convenience you can use the special username "/l" as a shortcut for "NT AUTHORITY\LocalService" and "/n" for "NT AUTHORITY\NetworkService". "vlmcsd -s -U /n" installs the service to run as "NT AUTHORITY\NetworkService".
-W password
Can only be used together with -s. Specifies a password for the corresponding username you use with -U. SYSTEM, "NT AUTHORITY\NetworkService", "NT AUTHORITY\LocalService" do not require a password.
If you specify a user with even lower privileges than "NT AUTHORITY\NetworkService", you must specify its password. You also have to grant the "Log on as a service" right to that user.
The following
signals differ from the default behavior:
SIGTERM, SIGINT
These signals cause vlmcsd to exit gracefully. All global semaphores and shared memory pages will be released, the pid file will be unlinked (deleted) and a shutdown message will be logged.
|
SIGHUP |
Causes vlmcsd to be restarted completely. This is useful if you started vlmcsd with an ini file. You can modify the ini file while vlmcsd is running and then sending SIGHUP, e.g. by typing "killall -SIGHUP vlmcsd" or "kill -SIGHUP ’cat /var/run/vlmcsd.pid’". |
The SIGHUP handler has been implemented relatively simple. It is virtually the same as stopping vlmcsd and starting it again immediately with the following exceptions:
|
— |
The new process does not get a new process id. | ||
|
— |
If you used a pid file, it is not deleted and recreated because the process id stays the same. | ||
|
— |
If you used the ’user’ and/or ’group’ directive in an ini file these are ignored. This is because once you switched to lower privileged users and groups, there is no way back. Anything else would be a severe security flaw in the OS. |
Signaling is not available in the native Windows version and in the Cygwin version when vlmcsd runs as a Windows service.
vlmcsd compiles and runs on Linux, Windows (no Cygwin required but explicitly supported), Mac OS X, FreeBSD, NetBSD, OpenBSD, Dragonfly BSD, Minix, Solaris, OpenIndiana, Android and iOS. Other POSIX or unixoid OSses may work with unmodified sources or may require minor porting efforts.
vlmcsd can answer activation requests for the following products: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 (up to 1703), Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Office 2010, Project 2010, Visio 2010, Office 2013, Project 2013, Visio 2013, Office 2016, Project 2016, Visio 2016. Newer products may work as long as the KMS protocol does not change. A complete list of fully supported products can be obtained using the -x option of vlmcs(1).
Office, Project and Visio must be volume license versions.
vlmcsd.ini(5)
vlmcsd -De
Starts vlmcsd in foreground. Useful if you use it for the first time and want to see what’s happening when a client requests activation.
vlmcsd -l /var/log/vlmcsd.log
Starts vlmcsd as a daemon and logs everything to /var/log/vlmcsd.log.
vlmcsd -L <IP_ADDRESS>
Starts vlmcsd as a daemon and listens on IP address <IP_ADDRESS> only. This is useful for routers that have a public and a private IP address to prevent your KMS server from becoming public.
vlmcsd -s -U /n -l C:\logs\vlmcsd.log
Installs vlmcsd as a Windows service with low privileges and logs everything to C:\logs\vlmcsd.log when the service is started with "net start vlmcsd".
An ePID specified in an ini file must not contain spaces.
Written by crony12, Hotbird64 and vityan666. With contributions from DougQaid.
Thanks to abbodi1406, CODYQX4, deagles, eIcn, mikmik38, nosferati87, qad, Ratiborus, ...
vlmcsd.ini(5), vlmcsd(7), vlmcs(1), vlmcsdmulti(1)


BpForms: toolkit for concretely describing non-canonical DNA, RNA, and proteins
To suggest new residues or modifications to existing residues, please use this GitHub issue template , submit a GitHub pull request , or contact us by email .
Atom/bond legend
See help for more information
X- Left bonding site X- Displaced by left bonding
X- Right bonding site X- Displaced by right bonding