Skip to content

Instantly share code, notes, and snippets.

Service unavailable, check service exists and is running ok - { [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
@cianclarke
cianclarke / templates.json
Last active August 29, 2015 14:11
Templates with openshift helloworld
{
"show": {
"projectTemplates": [{
"id": "bare_project",
"priority": 0.4,
"name": "Bare Project",
"description": "An empty project into which you can add apps and cloud instances",
"type": "default",
"icon": "icon-circle-blank",
@cianclarke
cianclarke / application.js
Created December 16, 2014 13:52
Weather Service
var mbaasApi = require('fh-mbaas-api');
var express = require('express');
var mbaasExpress = mbaasApi.mbaasExpress();
var cors = require('cors');
// list the endpoints which you want to make securable here
var securableEndpoints;
// fhlint-begin: securable-endpoints
securableEndpoints = ['hello'];
// fhlint-end
Cians-MacBook-Pro:helloworld-cloud cianclarke$ rhc app create delme nodejs-0.10 --from-code https://github.com/cianclarke/empty-os-test.git
Application Options
-------------------
Domain: cianclarke
Cartridges: nodejs-0.10
Source Code: https://github.com/cianclarke/empty-os-test.git
Gear Size: default
Scaling: no
Creating application 'delme' ...
@cianclarke
cianclarke / gist:54d58cad0c3a9cbecdd5
Created December 5, 2014 16:52
OpenShift Online Login
var request = require('request'),
jsdom = require('jsdom'),
jar = request.jar(); // stores cookies in the "jar", we can re-use them in future authenticated requests
request({
url : 'https://openshift.redhat.com/app/login',
method : 'get',
jar : jar,
followAllRedirects : true
}, function(err, response, body){
@cianclarke
cianclarke / polling.js
Created December 1, 2014 22:34
polling
var request = require('request'),
http = require('http'),
jsdom = require('jsdom'),
cache = require('memory-cache'),
jar = request.jar(); // stores cookies in the "jar", we can re-use them in future authenticated requests
const username = "[email protected]",
password = "Blogpost123",
INTERVAL = 15 * (60 * 1000); // 15 mins
function scraper(){
var request = require('request'),
jsdom = require('jsdom'),
jar = request.jar(), // stores cookies in the "jar", we can re-use them in future authenticated requests
// A closure function to enclose our code within
(function(username, password){
request.post({
url : 'https://testing.feedhenry.me/box/srv/1.1/act/sys/auth/login',
jar : jar,
form : {
var request = require('request'),
jsdom = require('jsdom'),
jar = request.jar(), // stores cookies in the "jar", we can re-use them in future authenticated requests
// A closure function to enclose our code within
(function(username, password){
request.post({
url : 'https://testing.feedhenry.me/box/srv/1.1/act/sys/auth/login',
method : 'post',
jar : jar,
fhc ERR! No action specified. Usage:
fhc ERR! fhc app <action>
fhc ERR! Where <action> is one of:
fhc ERR! act Performs an act request on a cloud app.
fhc ERR! cloud Performs a cloud request on a cloud app
fhc ERR! create Creates an application.
fhc ERR! delete Deletes an app under a project.
fhc ERR! endpoints Provides the endpoints for the specified app in the specified environment.
fhc ERR! list Lists apps under a project.
fhc ERR! stage Stages a cloud application.
FeedHenry CLI, the Command Line Interface to FeedHenry.
Usage: fhc <command>
where <command> is one of:
admin-appstore Operations on the MAM App Store
admin-auditlog Audit logs for the MAM App Store
admin-devices Operations specific to devices connected to the MAM App Store
admin-groups Administer MAM App Store groups
admin-policies Operations on Auth Policies for connecting to 3rd party auth systems