Inspired on this other gist
function hook(callback){
var oldWrite = process.stdout.write;
var output = { str : '' };
return {
restore : function(){
curl -b cookies.txt -c cookies.txt -X PUT -F "address=smtp.gmail.com" -F "tls=true" -F "username=****" -F "password=*****" -F "port=587" -F "use_sender=false" "http://api-local.cloud.appcelerator.com/v1/admins/apps/emails/smtp?key=xAP777Rw7uOSlOyRwW7F1BgqBJCsP9S9&pretty_json=true&pretty_json=true" | |
{ | |
"meta": { | |
"code": 200, | |
"status": "ok", | |
"method_name": "setSMTP" | |
}, | |
"response": { |
curl -b cookies.txt -c cookies.txt -X PUT -F "apikey=***" -F "accountid=***" -F '[email protected]' -F 'sender_name=support team' -F 'provider=message_gears' -F 'endpoint=https://api.messagegears.net/3.1/WebService' "http://api-local.cloud.appcelerator.com/v1/admins/apps/emails/setting?key=xAP777Rw7uOSlOyRwW7F1BgqBJCsP9S9&pretty_json=true" | |
{ | |
"meta": { | |
"code": 200, | |
"status": "ok", | |
"method_name": "setAppEmailSettings" | |
}, | |
"response": { | |
"apps": [ |
var util = require('util') | |
function hook_stdout(callback) { | |
var old_write = process.stdout.write | |
process.stdout.write = (function(write) { | |
return function(string, encoding, fd) { | |
write.apply(process.stdout, arguments) | |
callback(string, encoding, fd) | |
} |
Inspired on this other gist
function hook(callback){
var oldWrite = process.stdout.write;
var output = { str : '' };
return {
restore : function(){
#!/bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8 (Jessie).
With minor modifications, this script can also be used on dedicated servers or any KVM- or XEN- based Virtual Private Server (VPS) from other providers.
Alternative VPN script for CentOS/RHEL
Original post by Thomas Sarlandie
Reference
https://jira.appcelerator.org/browse/NODEJS-2685
https://jira.appcelerator.org/browse/CLI-1138
https://wiki.appcelerator.org/display/PartnerDocs/Registry+and+Security+Server
1. Enable the more verbose logging can be enabled here in /opt/appcelerator/360/conf/default/partners/acs.js on line 16. nodeAcsDebugApiCalls, | |
change it to nodeAcsDebugApiCalls: true, | |
You will get following Error: | |
``` | |
GET /api/v1/org/env 200 59.349 ms - 506 | |
[Node.ACS] API call: {"method":"GET","uri":"https://admin.mbaas.perf.api.enedis.fr/admin/apps/777887479634955","timeout":30000,"headers":{"x-auth-token":"25NwQ6IvZsDoS8outJBz2b7aaZ58dQ"}} | |
{ [Error: Hostname/IP doesn't match certificate's altnames] | |
__cached_trace__: | |
[ { receiver: [Object], fun: [Function], pos: 39197 }, | |
{ receiver: [Object], fun: [Function: emit], pos: 3276 }, |
/** | |
* MongoDB NodeJS Driver Production Connection Example | |
* | |
* Copyright (c) 2015 ObjectLabs Corporation | |
* Distributed under the MIT license - http://opensource.org/licenses/MIT | |
*/ | |
var MongoClient = require('mongodb').MongoClient; | |
/** |
#!/bin/bash | |
bucket=$1 | |
set -e | |
echo "Removing all versions from $bucket" | |
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'` | |
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'` |