Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
/* | |
* Selenium WebDriver JavaScript test with Mocha and NodeJS | |
* | |
* Start with: SELENIUM=PATH_TO_SELENIUM_JAR/selenium-server-standalone-2.31.0.jar mocha -t 10000 -R list google-sample.js | |
* | |
* Download selenium-server-standalone-2.31.0.jar from https://selenium.googlecode.com/files/selenium-server-standalone-2.31.0.jar | |
* 'sudo su' and 'npm install -g colors mocha selenium-webdriver' | |
* | |
* http://visionmedia.github.io/mocha/ | |
* https://code.google.com/p/selenium/wiki/WebDriverJs |
PUSH: | |
* tar cvf - . | gzip -c -1 | ssh user@host cat ">" remotefile.gz | |
* ssh target_address cat <localfile ">" remotefile | |
* ssh target_address cat <localfile - ">" remotefile | |
* cat localfile | ssh target_address cat ">" remotefile |
@Bean | |
EmbeddedServletContainerCustomizer containerCustomizer( | |
@Value("${keystore.file}") Resource keystoreFile, | |
@Value("${keystore.pass}") String keystorePass) throws Exception { | |
String absoluteKeystoreFile = keystoreFile.getFile().getAbsolutePath(); | |
return (ConfigurableEmbeddedServletContainer container) -> { | |
if (container instanceof TomcatEmbeddedServletContainerFactory) { |
import oracle.ons.ONS; | |
import oracle.ons.SenderThread; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.util.ReflectionUtils; | |
import javax.management.MBeanServer; | |
import javax.management.ObjectName; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; |
//: # State machine: handling three state and transition | |
import GameplayKit | |
class RetrievingDataState: GKState { | |
override func isValidNextState(stateClass: AnyClass) -> Bool { | |
print("\n---> \(stateClass) class") | |
return (stateClass == DataAvailableState.self) || (stateClass == DataNotAvailableState.self) | |
} |
//: Playground - noun: a place where people can play | |
import GameplayKit | |
class ShootingComponent: GKComponent { | |
let power: Int | |
init(power: Int) { | |
self.power = power |
//: Check divisible by 3 and 5 with GameplayKit Rule System | |
import GameplayKit | |
let divisibleBy3Rule = GKRule(blockPredicate: { system in | |
(system.state["value"] as! Int) % 3 == 0 | |
}, action: { system in | |
system.assertFact("divisibleBy3and5", grade: 0.5) | |
system.assertFact("divisibleBy3", grade: 1) | |
}) |
#Container Resource Allocation Options in docker-run You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.
##Dynamic CPU Allocation
-c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)
##Reserved CPU Allocation