View deleteEventSegmentValues.js
//place script in countly root folder (if anywhere else fix path to pluginManager and common) | |
//Use this script to delete or update segment Values. | |
var pluginManager = require('./plugins/pluginManager.js'), | |
crypto = require('crypto'), | |
async = require('async'), | |
Promise = require("bluebird"), | |
common = require('./api/utils/common.js'), | |
countlyDb = pluginManager.dbConnection(), | |
countly_drill = pluginManager.dbConnection("countly_drill"); |
View deleteEventSegmentKeys.js
//place script in countly root folder | |
//Use this script to delete or update segment Keys. | |
var pluginManager = require('./plugins/pluginManager.js'), | |
crypto = require('crypto'), | |
Promise = require("bluebird"), | |
countlyDb = pluginManager.dbConnection(), | |
countly_drill = pluginManager.dbConnection("countly_drill"); |
View sharp-preinstall.sh
#!/bin/sh | |
# Use of this script is deprecated | |
echo | |
echo "WARNING: THIS SCRIPT WILL STOP WORKING AT THE END OF 2016" | |
echo | |
echo "WARNING: THIS SCRIPT IS NO LONGER REQUIRED ON MOST 64-BIT LINUX SYSTEMS WHEN USING SHARP V0.12.0+" | |
echo | |
echo "See http://sharp.dimens.io/page/install#linux" |
View default
server { | |
listen 80; | |
server_name localhost; | |
access_log off; | |
rewrite ^ https://yourdomain.com$request_uri? permanent; | |
} | |
server { | |
listen 443; | |
server_name localhost; |
View expireData.js
//run on mongodb server as | |
//mongo < expireData.js | |
var COUNTLY_DRILL = 'countly_drill', | |
COUNTLY = 'countly', | |
EXPIRE_AFTER = 31536000, | |
INDEX_NAME = "cd_1"; | |
var PROCESS = [ | |
/^drill_events\.*/, |
View generateRequests.js
var request = require('request'); | |
function makeRequest(cnt){ | |
var options = { | |
uri: 'http://localhost/i?app_key=ccab3e6e1b5ca7b42fc2194b57358b115edb45fc&device_id='+Math.random()+'&begin_session=1&events=[{%22key%22:%22click%22,%22count%22:1,%22segmentation%22:{%22message%22:%22a%22}},{%22key%22:%22go%22,%22count%22:1,%22segmentation%22:{%22message%22:%22b%22}},{%22key%22:%22do%22,%22count%22:1,%22segmentation%22:{%22message%22:%22c%22}}]', | |
method: 'GET' | |
}; | |
request(options, function (error, response, body) { | |
if(!error){ | |
try{ |
View getSources.js
var stores = {}; | |
db.stores.find({meta:{$exists:true}}).forEach(function(doc){ | |
if(doc && doc.meta && doc.meta.stores){ | |
for(var i = 0; i < doc.meta.stores.length; i++){ | |
if(!stores[doc.meta.stores[i]]) | |
stores[doc.meta.stores[i]] = 1; | |
else | |
stores[doc.meta.stores[i]]++; | |
} |