Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
function writeScreenshot(data, name) { | |
name = name || 'ss.png'; | |
var screenshotPath = 'C:\\selenium_local_map\\'; | |
fs.writeFileSync(screenshotPath + name, data, 'base64'); | |
}; | |
driver.takeScreenshot().then(function(data) { | |
writeScreenshot(data, 'out1.png'); | |
}); |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
#!/bin/bash | |
DIR=$1; | |
DIR=`echo $1 |sed -e 's,\(.\)/$,\1,'` | |
back() { | |
mkdir "$DIR.old"; | |
for i in `ls $DIR`; | |
do | |
cp -r $DIR/$i $DIR.old; |
<?php | |
/** | |
* Session Helper Class | |
* | |
* A simple session wrapper class. | |
* | |
* Recommended for use with PHP 5.4.0 or higher. (Not required.) | |
* | |
* Usage Example: |
line = "dumped hex values" | |
s="" | |
n = 8 | |
for w in [line[i:i+n] for i in range(0, len(line), n)]: | |
c = [w[i:i+2] for i in range(0, len(w), 2)] | |
c.reverse() # endian foo | |
for a in c: | |
s+=chr(int(a,16)) | |
print s |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"code.google.com/p/go.crypto/ssh" | |
"code.google.com/p/go.crypto/ssh/terminal" |
var util = require('util'); | |
var events = require('events'); | |
var redis = require('redis'); | |
var RedisQueueConsumer = function (port, host) { | |
events.EventEmitter.call(this); | |
this.port = port || 6379; | |
this.host = host || '127.0.0.1'; | |
}; |
(function() { | |
var EventEmitter = require('events').EventEmitter; | |
var inspect = require('util').inspect; | |
var emit_ = EventEmitter.prototype.emit; | |
EventEmitter.prototype.emit = function(name) { | |
var args = Array.prototype.slice.call(arguments); | |
if (!(this === process.stderr && name === 'drain')) { | |
console.error("Event '%s', arguments: %s", | |
name, inspect(args.slice(1), false, 1)); | |
} |