Friday, 22 April 2022

Php Questions

//Mongo ISO date and time $asset['insert_time']->toDateTime()->format('d/m/Y') ; // connect_error) { die("Connect Error (" . $mysqli->connect_errno . ") " . $mysqli->connect_error); } echo "

Connection OK ". $mysqli->host_info."

"; echo "

Server ".$mysqli->server_info."

"; echo "

Initial charset: ".$mysqli->character_set_name()."

"; $mysqli->close(); */ /* $array="{$match: { parent_id: 0 }}, {$sort: { _id: 1 }}, {$addFields: { parent_id: { $toString: '$_id' } }}, {$lookup: { from: 'PAYMENTMODES', localField: 'parent_id', foreignField: 'parent_id', as: 'data' }}, {$addFields: { final_data: { $map: { input: '$data', as: 'g', 'in': { k: '$$g.title', v: { is_recurring: '$$g.is_recurring', image: '$$g.image' } } } } }}, {$replaceRoot: { newRoot: { $arrayToObject: { $concatArrays: [ [ { k: '$title', v: { $arrayToObject: { $concatArrays: [ [ { k: 'is_recurring', v: '$is_recurring' }, { k: '$title', v: { $arrayToObject: { $concatArrays: [ '$final_data' ] } } } ] ] } } } ] ] } } }}"; echo JSON.parse($array); */ //echo "111"; die; /* $numbers = array(1,3,2,5,2); $array_size = count($numbers); echo "Numbers before sort: "; for ( $i = 0; $i < $array_size; $i++ ) echo $numbers[$i]; echo "n"; for ( $i = 0; $i < $array_size; $i++ ) { for ($j = 0; $j < $array_size; $j++ ) { if ($numbers[$i] < $numbers[$j]) { $temp = $numbers[$i]; $numbers[$i] = $numbers[$j]; $numbers[$j] = $temp; } } } echo "Numbers after sort: "; for( $i = 0; $i < $array_size; $i++ ) echo $numbers[$i]; echo "n"; */ /* $strname="manoj"; $string = "JAVATPOINT"; $length = strlen($string); for ($i=($length-1) ; $i >= 0 ; $i--) { echo $string[$i]; } */ //JWT Decode //you can use this one line to decode the jwt token /* $token = "your encrypted token goes here"; print_r(json_decode(base64_decode(str_replace('_', '/', str_replace('-','+',explode('.', $token)[1]))))); $here= "/a/b/c/d"; //list($i1,$i2,$i3,$i4)= explode('/',$here); //print "$i3"; for($i=1;$i<20;$i++) print ($i); */ //$arr1 = array(1,2,4,5,7); $arr1= [40,41,42,43,44,45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,35,36,37,38,39,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,67,68,69,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]; // construct a new array:1,2....max(given array). //echo max($arr1); die; $arr2 = range(1,max($arr1)); echo "
";
//print_r($arr2);                                                  

// use array_diff to get the missing elements 
$missing = array_diff($arr2,$arr1); // (3,6)

//print_r($missing); die;

$InputArray = array(1,2,4,5,7); 

// $largeInput = [40,41,42,43,44,45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,35,36,37,38,39,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,67,68,69,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34];

$largeInput = [1,10,11,3,89,15,20,23,32,43,45,41,65,12,];
$missingIds = [];
$min = 0;
$max = 0;
$chunkSize = 10;
$chunkNo = 0;
 $currentInput = array_slice($largeInput, $chunkNo, $chunkSize);
 //print_r($currentInput); die;
while(count($currentInput) > 0) {
    foreach($currentInput as $id) {
        if(in_array($id,$missingIds)) {
            $missingIds = array_diff($missingIds,[$id]);
            continue;
        }
        if($id <= $min) {
            $distMin = $min - $id;
            if($distMin > 2) {
                $tempArr = range($id+1,$min-1);
                $missingIds = array_merge($missingIds, $tempArr);
                $tempArr = [];
            } else if ($distMin > 1) {
                $tempArr = [$id+1];
                $missingIds = array_merge($missingIds, $tempArr);
                $tempArr = [];
            } 
            $min = $id;
        } else if ($id >= $max){
            $distMax = $id - $max;
            if($distMax > 2) {
                $tempArr = range($max+1,$id-1);
                $missingIds = array_merge($missingIds, $tempArr);
                $tempArr = [];
            } else if ($distMax > 1) {
                $tempArr = [$max+1];
                $missingIds = array_merge($missingIds, $tempArr);
                $tempArr = [];
            } 
            $max = $id;
        }   
    }
    $chunkNo++;
    $currentInput = array_slice($largeInput, $chunkNo, $chunkSize);
}
//print_r($missingIds);

//curl -XPUT "http://localhost:9200/my_index/_settings" -d '{ "index" : { "max_result_window" : 500000 } }' -H "Content-Type: application/json"

$a=10;
$b=20;
$a=$a+$b;
$b=$a-$b;
$a=$a-$b;



echo $a;
echo "
"; echo $b; //=======================================similar================= /* function similar(a,b) { var equivalency = 0; var minLength = (a.length > b.length) ? b.length : a.length; var maxLength = (a.length < b.length) ? b.length : a.length; for(var i = 0; i < minLength; i++) { if(a[i] == b[i]) { equivalency++; } } var weight = equivalency / maxLength; return (weight * 100) + "%"; } alert(similar("test","tes")); // 75% alert(similar("test","test")); // 100% alert(similar("test","testt")); // 80% alert(similar("test","tess")); // 75% */ //=========================================================================== $strRec="manoj tiwari"; for($i=strlen($strRec)-1;$i>=0;$i--){ //echo $i; echo $strRec[$i]; } echo "
"; $a=[5,3,2,18,9]; for($i=0;$i"; //Print star Trangile for($i=0;$i<=5;$i++){ for($j=0;$j<=$i;$j++){ echo "*"; } echo "
"; } echo "
"; for($i=0;$i<=5;$i++){ for($j=5-$i;$j>0;$j--){ echo "*"; } echo "
"; } echo "
"; for($i=1;$i<=5;$i++){ for($j=1;$j<=5-$i;$j++){ echo "  "; } for($k=1;$k<=$i;$k++){ echo "*  "; } echo "
"; }

Wednesday, 2 February 2022

rootReplace in mongoDB

//root replace in mongodb [ { '$match': { 'parent_id': 0 } }, { '$addFields': { 'parent_id': { '$toString': '$_id' } } }, { '$lookup': { 'from': 'PAYMENTMODES', 'localField': 'parent_id', 'foreignField': 'parent_id', 'as': 'data' } }, { '$addFields': { 'final_data': { '$map': { 'input': '$data', 'as': 'g', 'in': { 'k': '$$g.title', 'v': { 'is_recurring': '$$g.is_recurring', 'image': '$$g.image' } } } } } }, { '$replaceRoot': { 'newRoot': { '$arrayToObject': { '$concatArrays': [ [ { 'k': '$title', 'v': { '$arrayToObject': { '$concatArrays': [ [ { 'k': 'is_recurring', 'v': '$is_recurring' }, { 'k': '$title', 'v': { '$arrayToObject': { '$concatArrays': [ '$final_data' ] } } } ] ] } } } ] ] } } } } ] // replace root with key value https://stackoverflow.com/questions/66237048/how-to-replace-the-root-with-object-value-in-mongodb ====================================================================================================================================================================== ====================================================================================================================================================================== db.packages.update( {"catalogue.0":"58356a157f8b9a50613c5ec7",record_date:{"$gte": new Date('2019-02-14T00:00:00Z'),"$lte": new Date('2019-02-16T00:00:00Z')}}, { $set : { "streaming_mode" : "vodafone_android"}}, {multi: true}); db.SESSION.update({"catlogue.0":"58356a157f8b9a50613c5ec7"},{ $set : { "device_token" : ""}}, {multi: true}) db.SESSION.update({"catlogue.0":"58356a157f8b9a50613c5ec7"},{ $set : { "device_token" : ""}}, {multi: true}) db.SESSION.update({"catlogue.0":"58356a157f8b9a50613c5ec7"},{ $set : { "device_token" : ""}}, {multi: true}) db.SESSION.find({"catlogue.0":"58356a157f8b9a50613c5ec7" ,"device_token" : ""}) db.SESSION.find({"catlogue.0":"58356a157f8b9a50613c5ec7","device_token": {$exists: true, $not: {$size: 0}}}) db.SESSION.find({"catlogue.0":"58356a157f8b9a50613c5ec7","device_token": {$exists: true, $ne:''}}) {"streaming_mode" : "vodafone_android","asset_code" : "CH689","record_date" : ISODate("2019-06-15T18:30:00.000+0000")} db.packages.count( {"streaming_mode" : "vodafone_android","asset_code" : "CH689",record_date:{"$gte": new Date('2019-06-15T00:00:00Z'),"$lte": new Date('2019-06-15T23:59:00Z')}} ) db.packages.count( {"content_type":"LIVE","os_name" : "android","asset_code" : "CH689",record_date:{"$gte": new Date('2019-06-15T00:00:00Z'),"$lte": new Date('2019-06-15T23:59:00Z')}} ) db.packages.find( {"duration":{"$gte":30},"asset_code":{"$in":["CH370","CH369","CH368"]},"streaming_mode" : "vodafone_android","msisdn":/VFPlay/,record_date:{"$gte": new Date('2018-02-22T00:00:00Z'),"$lte": new Date('2019-02-23T00:00:00Z')}} ) db.packages.find( {"msisdn":/VFPlay/,record_date:{"$gte": new Date('2019-02-14T00:00:00Z'),"$lte": new Date('2018-07-16T00:00:00Z')}} ) db.packages.find( {"msisdn":/VFPlay/,"streaming_mode" => "vodafone_android",record_date:{"$gte": new Date('2019-02-23T00:00:00Z'),"$lte": new Date('2019-02-23T00:00:00Z')}} ) db.packages.find( {"msisdn":/VFPlay/,record_date:{"$gte": new Date('2019-02-14T00:00:00Z'),"$lte": new Date('2019-02-16T00:00:00Z')}} ) "msisdn":/VFPlay/,"streaming_mode" : "vodafone_android" {"msisdn":/VFPlay/,record_date:{"$gte": new Date('2019-02-14T00:00:00Z'),"$lte": new Date('2019-02-16T00:00:00Z')} db.packages.update( {"msisdn":/VFPlay/,record_date:{"$gte": new Date('2019-02-14T00:00:00Z'),"$lte": new Date('2019-02-16T00:00:00Z')}}, { $set : { "streaming_mode" : "vodafone_android"}}, {multi: true}); db.packages.find( {"duration":{"$gte":30},"asset_code":{"$in":["CH370","CH369","CH368"]},"streaming_mode" : "vodafone_android","msisdn":/VFPlay/,record_date:{"$gte": new Date('2018-06-05T00:00:00Z'),"$lte": new Date('2018-07-10T00:00:00Z')}} ) ====================================================================================================================================================================== db.ASSETS.update({"subject" : "epg"}, {$push: { "catlogue": "5ab0b35088abf255501c12f2" }},{multi:true}) db.UPLOADCRON.update({ "subject" : "epg" }, { $set: { "sync_status" : "pending" } }) ================================================================================================================================================================ db.packages.count({"streaming_mode" : "dailyhunt_digivive_offdeck",record_date:new Date('2018-07-03T00:00:00Z')}) db.packages.count({"streaming_mode" : "dailyhunt_digivive_offdeck",record_date:{"$gte": new Date('2018-07-03T00:00:00Z'),"$lte": new Date('2018-07-03T23:59:59Z')}}) db.free_paid_details.find({"app":"dailyhunt_digivive_offdeck",date:{"$gte": new Date('2018-07-04T00:00:00Z'),"$lte": new Date('2018-07-04T23:59:59Z')}}) db.packages.count({"streaming_mode" : "dailyhunt_digivive_offdeck",record_date:{"$gte": new Date('2018-07-03T00:00:00Z'),"$lte": new Date('2018-07-03T23:59:59Z')}}) db.packages.count({"streaming_mode" : "dailyhunt_digivive_offdeck",record_date:{"$gte": new Date('2018-07-03T00:00:00Z'),"$lte": new Date('2018-07-03T23:59:59Z')}}) db.free_paid_details.aggregate([{$match:{"app":"dailyhunt_digivive_offdeck",date:{"$gte": new Date('2018-06-18T00:00:00Z'),"$lte": new Date('2018-06-20T23:59:59Z')}}},{$group:{_id :total:{$sum:1},app:{$first:'$app'}}}]) db.free_paid_details.aggregate([{$match:{"app":"dailyhunt_digivive_offdeck",date:{"$gte": new Date('2018-06-01T00:00:00Z'),"$lte": new Date('2018-06-30T23:59:59Z')}}}]) db.nexgtv_app_hits_report.aggregate([{$match:{date:{"$gte": new Date('2018-06-18T00:00:00Z'),"$lte": new Date('2018-06-20T23:59:59Z')}}},{$group:{_id :{"date":"$date"}}}]) $group:{_id :{"tv_n":"$tv_n"} =============================================================================================================================================================== db.nexgtv_app_hits_report.aggregate([{$match:{date:{"$gte": new Date('2018-06-18T00:00:00Z'),"$lte": new Date('2018-06-20T23:59:59Z')}}},{$group:{_id :{"date":"$date"},totalcnt:{$sum:1},appname:{$first:'$appname'},totalcnt:{$first:'$totalcnt'},date:{$first:'$date'}}}]) //May -2021 db.packages.aggregate( [{$match:{"streaming_mode" : {'$ne':"vodafone_android"},asset_code:"CH903" ,"record_date":{'$gte': new Date('2020-12-01T00:00:00Z'), '$lte': new Date('2020-12-31T23:59:59Z')}}},{$group:{_id :{"asset_code": "$asset_code"},total_hits:{$sum:1}, ] ) db.packages.aggregate( [{$match:{"streaming_mode" : "dailyhunt_digivive_offdeck",asset_code:{$ne:'',$ne:null},record_date:{"$gte": new Date('2018-03-01T00:00:00Z'), "$lte": new Date('2018-03-04T23:59:59Z')}}},{$group:{_id :{"record_date": "$record_date" ,"asset_code":"$asset_code","paid_status":"$paid_status"},total_hits:{$sum:1},'duration':{'$sum':'$duration'}, duration:{$sum:'$duration'},record_date:{$first:'$record_date'}, asset_code:{$first:'$asset_code'},channel_content:{$first:'$channel_content'},broadcaster:{$first:'$broadcaster'},content_type:{$first:'$content_type'},language:{$first:'$language'},genre:{$first:'$genre'}}},{$sort:{'duration':-1}}] ) db.packages.aggregate( [{$match:{"streaming_mode" : {'$ne':"vodafone_android"},"duration":{"$gte":57},asset_code:"CH903" ,"record_date":{'$gte': new Date('2020-12-01T00:00:00Z'), '$lte': new Date('2020-12-31T23:59:59Z')}}},{$group:{_id :{"asset_code": "$asset_code","msisdn": "$msisdn"},total_hits:{$sum:1},"total_duration":{"$sum":"$duration"} ] ) "catalogue_name":"platform8" db.packages.aggregate( [{$match:{"catalogue_name" : "platform8",asset_code:"PFMOVASG01" ,"record_date":{'$gte': new Date('2021-09-06T00:00:00Z'), '$lte': new Date('2021-09-07T23:59:59Z')}}},{$group:{_id :{"asset_code": "$asset_code"},total_hits:{$sum:1},"total_duration":{"$sum":"$duration"} ] ) db.packages.aggregate([{"$match":{"record_date":{"$gte":{"$date":{"$numberLong":"1630953000000"}},"$lte":{"$date":{"$numberLong":"1631039399999"}}},"streaming_mode":{"$regex":"^platform8","$options":"i"}}},{"$group":{"_id":null,"totalHits":{"$sum":1},"total_duration":{"$sum":"$duration"}}},{"$project":{"_id":0,"totalHits":1,"total_duration":1}}]) db.packages.aggregate( [{$match:{"streaming_mode" : {'$ne':"vodafone_android"},"duration":{"$gte":57},asset_code:"CH903" ,"record_date":{'$gte': new Date('2020-12-01T00:00:00Z'), '$lte': new Date('2020-12-31T23:59:59Z')}}},{$group:{_id :{"asset_code": "$asset_code"},total_hits:{$sum:1}}} ] ) db.packages.aggregate( [{$match:{"streaming_mode" : {'$ne':"vodafone_android"},"duration":{"$gte":57},asset_code:"CH903" ,"record_date":{'$gte': new Date('2020-12-01T00:00:00Z'), '$lte': new Date('2020-12-31T23:59:59Z')}}},{$group:{_id :{"msisdn": "$msisdn"},total_hits:{$sum:1}}}, {$group:{_id :{"msisdn": "$_id.msisdn"},totalCount:{$sum:"$total_hits"},"distinctCount": { "$sum": 1 }}} ] ) db.packages.aggregate( [{$match:{"streaming_mode" : {'$ne':"vodafone_android"},"duration":{"$gte":57},asset_code:"CH902" ,"record_date":{'$gte': new Date('2020-12-01T00:00:00Z'), '$lte': new Date('2020-12-31T23:59:59Z')}}},{$group:{_id :{"msisdn": "$msisdn"},total_hits:{$sum:1}}}, {$group:{_id :{"msisdn": "$_id.msisdn"},totalCount:{$sum:"$total_hits"},"distinctCount": { "$sum": 1 }}} ] ) db.packages.aggregate( [{$match:{asset_code:{$ne:'',$ne:null},record_date:{"$gte": new Date('2018-03-01T00:00:00Z'), "$lte": new Date('2018-03-31T23:59:59Z')}}},{$group:{_id :{"record_date": "$record_date" ,"asset_code":"$asset_code","paid_status":"$paid_status"},total_hits:{$sum:1},'duration':{'$sum':'$duration'}, duration:{$sum:'$duration'},record_date:{$first:'$record_date'}, asset_code:{$first:'$asset_code'},channel_content:{$first:'$channel_content'},broadcaster:{$first:'$broadcaster'},content_type:{$first:'$content_type'},language:{$first:'$language'},genre:{$first:'$genre'}}},{$sort:{'duration':-1}}] ) db.KEYWORDS.aggregate( {$group : { '_id' : "$title",'status':{'$first':'$status'},'id':{'$first':'$_id'},"uniqueIds":{"$addToSet":"$_id"} }}, { $project : { title : 1,status:1,uniqueIds:1 } } ) db.KEYWORDS.aggregate( [ { $group : { _id : "$title", data: { $push: "$$ROOT" } } } ] ) db.ASSETS.update( { _id: 56e156139da23c60750e692d }, { $addToSet: { catlogue: "5d52a59dc8d1450aa73a8595" } } ) =========================================================================================================================================================== //Filter Records db.KEYWORDS.aggregate( [ { $match: { $text: { $search: "operating" } } }, { $sort: { score: { $meta: "textScore" }, posts: -1 } } ] ) ===================================================================================================================================================================== //Month Wise channel hits db.packages.aggregate( [{$match:{"content_type":"LIVE",streaming_mode:{$ne:'vodafone_android'},asset_code:{$ne:'',$ne:null},record_date:{"$gte": new Date('2021-08-01T00:00:00Z'), "$lte": new Date('2021-08-31T23:59:59Z')}}},{$group:{_id :{"asset_code":"$asset_code","paid_status":"$paid_status"},total_hits:{$sum:1},'duration':{'$sum':'$duration'}, duration:{$sum:'$duration'}, asset_code:{$first:'$asset_code'},channel_content:{$first:'$channel_content'},broadcaster:{$first:'$broadcaster'},content_type:{$first:'$content_type'},language:{$first:'$language'},genre:{$first:'$genre'}}},{$sort:{'duration':-1}}] ) ======================================================================================================================================================== $conver with on error /** * replacementDocument: A document or string. */ { "newRoot": { "$arrayToObject": [ [ { k: "$title", v: { '$arrayToObject': { '$concatArrays': [ [ { 'k': 'is_recurring', 'v': '$is_recurring' }, { 'k': '$title', 'v': { '$arrayToObject': { '$concatArrays': [ '$final_data' ] } } } ] ] } } } ] ] } } ============================================================================================================= [ { '$match': { 'parent_id': 0 } }, { '$sort': { '_id': 1 } }, { '$addFields': { 'parent_id': { '$toString': '$_id' } } }, { '$lookup': { 'from': 'PAYMENTMODES', 'localField': 'parent_id', 'foreignField': 'parent_id', 'as': 'data' } }, { '$addFields': { 'final_data': { '$map': { 'input': '$data', 'as': 'g', 'in': { 'k': '$$g.title', 'v': { 'is_recurring': '$$g.is_recurring', 'image': '$$g.image' } } } } } }, { '$replaceRoot': { 'newRoot': { '$arrayToObject': { '$concatArrays': [ [ { 'k': 'is_recurring', 'v': '$is_recurring' }, { 'k': 'image', 'v': { '$convert': { 'input': '$image', 'to': 'string', 'onNull': '', 'onError': '' } } }, { 'k': 'mode', 'v': '$title' }, { 'k': '$title', 'v': { '$arrayToObject': { '$concatArrays': [ '$final_data' ] } } } ] ] } } } } ] ============================================================================================================================================================ Key value root replace [ { '$match': { 'parent_id': 0 } }, { '$sort': { '_id': 1 } }, { '$addFields': { 'parent_id': { '$toString': '$_id' } } }, { '$lookup': { 'from': 'PAYMENTMODES', 'localField': 'parent_id', 'foreignField': 'parent_id', 'as': 'data' } }, { '$addFields': { 'final_data': { '$map': { 'input': '$data', 'as': 'g', 'in': { 'is_recurring': '$$g.is_recurring', 'image': '$$g.image', 'title': '$$g.title' } } } } }, { '$replaceRoot': { 'newRoot': { '$arrayToObject': { '$concatArrays': [ [ { 'k': 'is_recurring', 'v': '$is_recurring' }, { 'k': 'image', 'v': { '$convert': { 'input': '$image', 'to': 'string', 'onNull': '', 'onError': '' } } }, { 'k': 'mode', 'v': '$title' }, { 'k': '$title', 'v': '$final_data' } ] ] } } } } ] ========================================================================================================================================================== Filter with lookup [ { '$match': { 'type': 'movie' } }, { '$lookup': { 'from': 'BITFRAME', 'let': { 'code': '$code' }, 'pipeline': [ { '$match': { '$expr': { '$and': [ { '$eq': [ '$code', '$$code' ] } ] } } }, { '$sort': { 'bit_frame': 1 } } ], 'as': 'bitframeurl' } }, { '$addFields': { 'sd_download': { '$filter': { 'input': '$bitframeurl', 'as': 'num', 'cond': { '$and': [ { '$eq': [ '$$num.content_download', '1' ] }, { '$in': [ '$$num.bit_frame', [ '360', '320' ] ] } ] } } }, 'hd_download': { '$filter': { 'input': '$bitframeurl', 'as': 'num', 'cond': { '$and': [ { '$eq': [ '$$num.content_download', '1' ] }, { '$eq': [ '$$num.bit_frame', '720' ] } ] } } }, 'content': { '$filter': { 'input': '$bitframeurl', 'as': 'num', 'cond': { '$and': [ { '$eq': [ '$$num.content_download', '0' ] } ] } } } } }, { '$addFields': { 'content_obj': { '$first': '$content' }, 'sd_obj': { '$first': '$sd_download' }, 'hd_obj': { '$first': '$hd_download' } } }, { '$project': { '_id': 1, 'code': 1, 'premium_hls': '$content_obj.url', 'hd_url': '$hd_obj.url', 'sd_url': '$sd_obj.url', 'hd_bitframe': '$hd_obj.bit_frame', 'sd_bitframe': '$sd_obj.bit_frame', 'hd_size': 1, 'sd_size': 1 } } ] ==================================================================================================================================================== Update with foreach ["VOD81600"].forEach(function(result) { db.ASSETS.update({"code" : result}, {$set : {"viewerrating_id" : "6053008864dee72bd4e52ebe","content_advisory" : [ "605993c9e1e5ed93d4d36af9" ]}}); }) ==================================================================================================================================================== //BitFrame URL query [ { '$match': { 'type': 'movie', 'code': 'MOV4022' } }, { '$lookup': { 'from': 'BITFRAME', 'let': { 'code': '$code' }, 'pipeline': [ { '$match': { '$expr': { '$and': [ { '$eq': [ '$code', '$$code' ] } ] } } }, { '$sort': { 'bit_frame': 1 } } ], 'as': 'bitframeurl' } }, { '$addFields': { 'sd_download': { '$filter': { 'input': '$bitframeurl', 'as': 'num', 'cond': { '$and': [ { '$eq': [ '$$num.content_download', '1' ] }, { '$in': [ '$$num.bit_frame', [ '360', '320' ] ] } ] } } }, 'hd_download': { '$filter': { 'input': '$bitframeurl', 'as': 'num', 'cond': { '$and': [ { '$eq': [ '$$num.content_download', '1' ] }, { '$eq': [ '$$num.bit_frame', '720' ] } ] } } }, 'content': { '$filter': { 'input': '$bitframeurl', 'as': 'num', 'cond': { '$and': [ { '$eq': [ '$$num.content_download', '0' ] } ] } } } } }, { '$addFields': { 'content_obj': { '$first': '$content' }, 'sd_obj': { '$first': '$sd_download' }, 'hd_obj': { '$first': '$hd_download' } } }, { '$addFields': { 'bitframeurl_play': { 'premiumn_hls': { '$convert': { 'input': { '$first': '$content.url' }, 'to': 'string', 'onNull': '', 'onError': '' } }, 'standred_hls': '' }, 'hd': { 'url': { '$convert': { 'input': { '$first': '$hd_download.url' }, 'to': 'string', 'onNull': '', 'onError': '' } }, 'bitframe': { '$convert': { 'input': { '$first': '$hd_download.bit_frame' }, 'to': 'string', 'onNull': '', 'onError': '' } }, 'size': { '$convert': { 'input': '$hd_size', 'to': 'int', 'onNull': 0, 'onError': 0 } } }, 'sd': { 'url': { '$convert': { 'input': { '$first': '$sd_download.url' }, 'to': 'string', 'onNull': '', 'onError': '' } }, 'bitframe': { '$convert': { 'input': { '$first': '$sd_download.bit_frame' }, 'to': 'string', 'onNull': '', 'onError': '' } }, 'size': { '$convert': { 'input': '$sd_size', 'to': 'int', 'onNull': 0, 'onError': 0 } } } } }, { '$project': { '_id': 0, 'bitframeurl_play': 1, 'hd': 1, 'sd': 1, 'code': 1 } } ] ==================================================================================================================================================

Wednesday, 28 April 2021

MongoB 4.2 and yii2 composer update

1. remove composer.lock and vender folder first.then update composer . 2. composer require yidas/yii2-bower-asset ececute given command . mongo db 4.2 installation . Remove mongodb https://stackoverflow.com/questions/8766579/uninstalling-mongo This should work rpm -qa | less | grep mongo using that command will give you the mongo packages you have installed, after that you can do rpm -qa | less | grep mongo | xargs yum remove // <-- this will remove all packages automatically ========================================================================================================================== Install mongodb https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-latest-mongodb-2-6-4-on-centos-7-rhel-7.html ================================================================================================================================== ========================================================================================================================================= Install mongodb https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-latest-mongodb-2-6-4-on-centos-7-rhel-7.html Prepare Replica set =============== 172.31.22.64 E-App-DB-03 172.31.22.65 E-App-DB-01 172.31.22.66 E-App-DB-02 172.31.22.233 CMS-01 rs.initiate( { _id : "WAPRS01", version: 1, members: [ { _id: 0, host: "E-App-DB-01:27017" }, { _id: 1, host: "E-App-DB-02:27017" }, { _id: 2, host: "E-App-DB-03:27017" } ] }) rs.addArb("ip-172-20-2-169") rs.initiate( { _id : "WAPRS01", version: 1, members: [ { _id: 0, host: "ip-172-20-2-240:27017" }, { _id: 1, host: "ip-172-20-3-28:27017" }, { _id: 2, host: "ip-172-20-2-169:27017" } ] }) mongo --host 172.20.2.240 E-App-DB-01:27017 ,E-App-DB-02:27017,E-App-DB-03:27017 WAPRS01 E-App-DB-01:27017 ,E-App-DB-02:27017 WAPRS01 rs.addArb("E-App-DB-03") 172.31.22.65 E-App-DB-01 172.31.22.66 E-App-DB-02 WAPRS01 rs.remove("E-App-DB-03:27017") rs.remove("mongod3.example.net") rs.addArb("App-Node-02:27017") rs.remove("App-Node-02:27017") mongorestore --host 172.20.2.240 -d nexgtv_16 --port 27017 --verbose /home/centos/mongo_backups/nexgtv_whitelabel_elxire_AWS-2021-05-12-0200/nexgtv_16 mongorestore --host -d --port foldername #mongodump -h 172.20.3.28 --port 27017 --db wowza --out /home/centos/mongo_backups/nexgtv_whitelabel_elxire_AWS/ mongodump -h 172.20.3.28 --port 27017 --db wowza --out /home/centos/mongo_backups/ scp -i Digi-OTT-key.pem subscriber.json centos@172.20.2.240:/home/centos/ (copy file on server to another) rs.printSlaveReplicationInfo() rs.status() db.serverStatus().connections mongostat ==================================================================================================== Install PHP 7.4.19 yum --enablerepo=remi-php74 install php74-php php74-php-pear php74-php-bcmath php74-php-pecl-jsond-devel php74-php-mysqlnd php74-php-gd php74-php-common php74-php-intl php74-php-cli php74-php php74-php-xml php74-php-opcache php74-php-pecl-apcu php74-php-pecl-jsond php74-php-pdo php74-php-gmp php74-php-process php74-php-pecl-imagick php74-php-devel php74-php-mbstring php74-php-soap php74-php-mcrypt php-mcrypt php-soap phpMyAdmin roundcubemail memcached php-pecl-memcached php74-php-pecl-memcached php-opcache php-redis redis php74-php-redis php74-php-zip php74-php-pspell php-brotli rm -f /usr/bin/php ln -s /usr/bin/php74 /usr/bin/php rm -f /usr/lib/systemd/system/php-fpm.service ln -s /usr/lib/systemd/system/php74-php-fpm.service /usr/lib/systemd/system/php-fpm.service systemctl daemon-reload yum install php-devel pecl install mongodb vi /etc/php.ini extension=mongodb.so vi /etc/opt/remi/php74/php.ini =====================================nginx install================================== sudo yum install epel-release sudo yum install nginx sudo systemctl start nginx sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload sudo systemctl enable nginx ======================================================================================

Monday, 15 February 2021

Mongodb3.4 installation

https://www.hugeserver.com/kb/install-mongodb-centos-6-7/ ION LOGIN Tel: 1.888.842.8570E-mailLive Chat Home Dedicated Hosting Dedicated Servers Overview Pricing Los Angeles Jacksonville Meppel Colocation Overview Custom Quote Special Promotion Virtual Hosting Virtual Servers Overview Pricing Hybrid Servers Overview Pricing Virtualization Solutions Virtualization Hardware Solutions Software Solutions Administration Company About Us Company Overview Our Team Carriers Blog Contact Partner Programs Reseller Program Referral Datacenters Overview Los Angeles Datacenter Jacksonville Datacenter Meppel Datacenter Why HugeServer ION Platform SLA Plus Testimonials Optimized Network Knowledgebase HugeServer Knowledgebase HugeServer Knowledgebase > Linux > CentOS > Install MongoDB 3.4 on CentOS 6 and 7 Install MongoDB 3.4 on CentOS 6 and 7 on May 7, 2017 by AmirLeave a comment Introduction MongoDB is a scalable, high-performance, open source NoSQL database. The database is document-oriented so it manages collections of JSON-like documents. Many applications can thus model data in a more natural way, as data can be nested in complex hierarchies and still be queryable and indexable. We are assuming that you have root permission, otherwise, you may start commands with “sudo”. MongoDB Logo Install MongoDB For installing the latest stable version of MongoDB you should add MongoDB repository first. Adding MongoDB Repository Move to the following directory: cd /etc/yum.repos.d/ Create the following file with your favorite text editor: nano mongodb-org-3.4.repo For the latest stable version of MongoDB paste the following line in the file then save and exit: [mongodb-org-3.4] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc Installing MongoDB Update your repositories list executing the following command: yum repolist Now you can install the latest stable version of MongoDB using “Yum”: yum install mongodb-org -y Configuring SELINUX If you are using SELinux, you must configure SELinux to allow MongoDB to start on Red Hat Linux-based systems If SELinux is in enforcing mode, enable access to the relevant ports that the MongoDB deployment will use (e.g. 27017). semanage port -a -t mongod_port_t -p tcp 27017 Manage your MongoDB Service You can manage your MongoDB service with “systemctl”: For making MongoDB run at startup: systemctl enable mongod or chkconfig mongod on For Start/Stop MongoDB service: systemctl start mongod systemctl stop mongod or service mongod start service mongod stop See your MongoDB status: systemctl status mongod or service mongod status ========================================================================================================================================== =========================================================================================================================================== mongod.conf # mongod.conf # for documentation of all options, see: # http://docs.mongodb.org/manual/reference/configuration-options/ # where to write logging data. systemLog: destination: file logAppend: false path: /var/log/mongodb/mongod.log # Where and how to store data. storage: dbPath: /var/lib/mongo journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 5 journalCompressor: none collectionConfig: blockCompressor: snappy indexConfig: prefixCompression: true # engine: # mmapv1: # wiredTiger: # how the process runs processManagement: fork: true # fork and run in background pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile # network interfaces net: port: 27017 # bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces. replication: replSetName: WAPRS01 oplogSizeMB: 100 #security: #operationProfiling: #replication: #sharding: ## Enterprise-Only Options #auditLog: #snmp:

Tuesday, 12 February 2019

htaccess

RewriteEngine On
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteRule ^watch/(.*)$ red.php/$1/$2 [QSA,L]
RewriteRule ^watch1/(.*)$ red1.php/$1/$2 [QSA,L]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

RewriteCond %{HTTP_HOST} ^nexgtv.com$
RewriteRule (.*) http://www.nexgtv.com/$1 [R=301,L]

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ## 

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

<files *.js>
SetOutputFilter DEFLATE
</files>

<files *.css>
SetOutputFilter DEFLATE
</files>


Monday, 31 December 2018

rsync with linuxsh file

#!/bin/bash
while true; do
#dt=`date`
#APP_NAME="wowza_analytics-"
#con1 ="-0220.tgz"
#rsync -arv /home/wowza_analytics_bcup/wowza_analytics/$APP_NAME-$con1 root@172.31.22.233:/home/manoj/101server/wowza_analytics_bcup/$APP_NAME-$con1 >/dev/null 2>&1

rsync -arv /home/wowza_analytics_bcup/wowza_analytics/. root@172.31.22.233:/home/manoj/101server/wowza_analytics_db_bcup/ >/dev/null 2>&1

#rsync -arv /data/www/html/unified/admin/banner/. root@172.31.22.50:/home/www/html/unified/admin/banner/ >/dev/null 2>&1


sleep 30
done

Monday, 17 December 2018

nodejs installation problem

REDIS CLI

https://www.linode.com/docs/databases/redis/install-and-configure-redis-on-centos-7/

===============================================
supervisor installation

https://stackoverflow.com/questions/45224707/install-and-config-supervisord-on-centos-7-to-run-laravel-queues-permanently

========================================================================

Node JS installation
(NPM Install) https://stackoverflow.com/questions/15890958/install-a-previous-version-of-a-package

(NVM)https://linuxize.com/post/how-to-install-node-js-on-debian-9/








https://stackoverflow.com/questions/14948179/how-to-make-nvm-automatically-sourced-upon-login







http://stackoverflow.com/questions/12594541/npm-global-install-cannot-find-module



240 down vote accepted
For anyone else running into this, I had this problem due to my npm installing into a location that's not on my NODE_PATH.
[root@uberneek ~]# which npm
/opt/bin/npm
[root@uberneek ~]# which node
/opt/bin/node
[root@uberneek ~]# echo $NODE_PATH
My NODE_PATH was empty, and running npm install --global --verbose promised-io showed that it was installing into /opt/lib/node_modules/promised-io:
[root@uberneek ~]# npm install --global --verbose promised-io
npm info it worked if it ends with ok
npm verb cli [ '/opt/bin/node',
npm verb cli   '/opt/bin/npm',
npm verb cli   'install',
npm verb cli   '--global',
npm verb cli   '--verbose',
npm verb cli   'promised-io' ]
npm info using npm@1.1.45
npm info using node@v0.8.4
[cut]
npm info build /opt/lib/node_modules/promised-io
npm verb from cache /opt/lib/node_modules/promised-io/package.json
npm verb linkStuff [ true, '/opt/lib/node_modules', true, '/opt/lib/node_modules' ]
[cut]
My script fails on require('promised-io/promise'):
[neek@uberneek project]$ node buildscripts/stringsmerge.js 

module.js:340
    throw err;
          ^
Error: Cannot find module 'promised-io/promise'
    at Function.Module._resolveFilename (module.js:338:15)
I probably installed node and npm from source using configure --prefix=/opt. I've no idea why this has made them incapable of finding installed modules. The fix for now is to point NODE_PATH at the right directory:
export NODE_PATH=/opt/lib/node_modules
My require('promised-io/promise') now succeeds.




=================================================


Node command

476  yum install pm2
  477  npm install pm2 -g
  478  npm install pm2@latest -g
  479  pm2 list
  480  yum install memcached
  481  yum install redis-tools
  482  git clone http://github.com/antirez/redis.git
  483  cd redis && git checkout 3.0
  484  make redis-cli
  485  redis-cli
  486  make redis-cli
  487  ln -s src/redis-cli /usr/local/bin/redis-cli
  488  redis-cli
  489  cd /usr/src
  490  wget -c http://download.redis.io/redis-stable.tar.gz
  491  redis-cli
  492  yum install redis-cli
  493  tar xvzf redis-stable.tar.gz
  494  cd redis-stable
  495  make && make install
  496  Install the Redis script0  redis-server
  501  redis-cli programme_schedule '*'
  502  redis-cli monitor
  503  telnet localhost 6379
  504  chkconfig redis on
  505  /etc/init.d/redis_6379 start
  506  yum install redis
  507  yum install make gcc wget
  508  cd tools
  509  wget http://download.redis.io/releases/redis-3.0.2.tar.gz
  510  tar -zxvf redis-3.0.2.tar.gz
  511  cd redis-3.0.2
  512  ll
  513  make
  514  make install
  515  cd utils/
  516  ./install_server.sh
  517  chkconfig redis on
  518  etc/init.d/redis_6379 start
  519  /etc/init.d/redis_6379 start
  520  chkconfig redis on










  497  redis-cli
  498  redis-server









    chkconfig redis_6379 on
  522  redis-cli
  523  /etc/init.d/redis_6379 stop
  524  /etc/init.d/redis_6379 start
  525  chkconfig redis on
  526  chkconfig redis_6379 on
  527  reboot
  528  yum intall memcache
  529  yum update
  530  ps ax | grep yum
  531  kill -9 2814
  532  ping yahoo.com
  533  vim /etc/resolv.conf
  534  yum install telnet
  535  ps ax | grep yum
  536  kill -9 2870



  537  cd /etc/yum.repos.d/
  538  ls
  539  rm mongodb-org.repo
  540  yum cleana ll
  541  yum update
  542  vim /etc/resolv.conf
  543  ps ax | grep yum
  544  kill -9 2970
  545  nslookup
  546  yum update
  547  yum clean all
  548  yum repolist
  549  yum install yum-utils
  550  yum install telnet
  551  yum install memcache
  552  yum install memcached
  553  clear
  554  df
  555  df -h
  556  free -m
  557  clear
  558  df
  559  cd /home



   564  redis-cli
  565  service memcached start
  566  service memcache start
  567  yum install  memcached
  568  yum install telnetd
  569  service memcahed start
  570  service memcahe start
  571  yum install  memcached
  572  service memcached start
  573  pm2 start scheduleworker.js -n cathcup
  574  pm2 list
  575  pm2 strat
  576  pm2 list
  577  cd /etc
  578  pm2
  579  npm install pm2@latest -g
  580  npm -v
  581  nvm ls
  582  node -v
  583  vpm -v
  584  npm -v


   587  node -v
  588  npm -v
  589  nvm install node
  590   node -v
  591  npm -v
  592  npm install pm2 -g
  593  pm2 install
  594  reboot
  595  service memcached start
  596  chkconfig memcached on
  597   service memcached start
  598  chkconfig memcached on
  599  chkconfig memcache on
  600  pm2 list
  601  npm -v
  602  npm install pm2 -g
  603  node -v
  604  command -v nvm
  605  nvm install node
  606  node -v
  607  chkconfig npm on




   608  chkconfig nvm on
  609  chkconfig node on
  610  top -d 2
  611  command -v nvm
  612  npm install pm2 -g
  613  pm2 install
  614  chkconfig pm2 on
  615  systemctl enable pm2
  616  systemctl enable mpm
  617  systemctl enable npm
  618  systemctl enable node
  619  node -v
  620  sudo pm2 startup systemd
  621  systemctl enable nodeserver.service
  622  systemctl start nodeserver.service
  623  systemctl status nodeserver.service

  624  npm install pm2 -g
  625  pm2 list
  626  node
  627  pm2 save
  628  node -v
  629  which node
  630  redis-cli
  631  reboot
  632  pm2 list
  633  nvm list
  634  yum uninstall --force node
  635  uninstall node
  636  yum uninstall node
  637  yum rm -rf node*
  638  rm -rf /usr/local/share/man/man1/node.1
  639  rm -rf /usr/local/lib/dtrace/node.d
  640  rm -rf ~/.npm
  641  nvm
  642  mpn -v
  643  npm -v
  644  npm cache clean -f


   648  nvm ls
  649  nvm use 0.11.16
  650  nvm install stable
  651  nvm use 0.11.16
  652  nvm deactivate
  653  nvm uninstall 10.2.1
  654  nvm use 0.11.16
  655  nvm install stable
  656  nvm ls
  657  nvm deactivate
  658  nvm ls
  659  nvm uninstall 10.2.1
  660  nvm ls 666  node -v
  667  ifconfig -a
  668  npm -v
  669  npm install pm2 -g
  670  pm2 install
  671  pm2 save
  672  pm2 list
  673  pm2 startup
  674  pm2 save
  675  pm2 startup
  676  pm2 list
  677  cd /etc/scripts
  678  ls
  679  cd digiapis
  680  pm2 startup
  681  yum install pm2
  682  pm2 list
  683  pm2 startup
  684  npm install pm2@latest -g
  685  node -v
  686  npm -v
  687  yum install npm
  688  yum install node




  703  echo $NODE_PATH
  704  npm install --global --verbose promised-io
  705  npm install --global --verbose
  706  which node
  707  nvm install 0.11
  708  nvm current
  709  nvm install stable
  710  nvm current
  711  v0.12.2 (npm v2.7.4)
  712  nvm ls
  713  which node
  714  echo $NODE_PATH
  715  npm install --global --verbose
  716  npm install --global --verbose promised-io
  717  node -v
  718  nvm current
  719  locate nvm.sh
  720  locate .bash_profile


  721  vim /root/.bash_profile
  722  npm -v
  723  nvm ls
  724  nvm alias default v0.11.16
  725  nvm ls
  726  nvm alias default v0.11.16
  727  nvm ls
  728  npm install pm2@latest -g
  729  pm2 startup
  730  pm2 list
  731  service memcached status
  732  node -v
  733  reboot
  734  npm -v
  735  node -v
  736  pm2 list
  737  npm install pm2@latest -g
  738  pm2 list
  739  pm2 startup




  740  pm2 save
  741  reboot
  742  passwd
  743  ps ax
  744  exit
  745  top
  746  node -v
  747  npm -v
  748  pm2 list
  749  ssh-keygen
  750  cd /root/.ssh
  751  npm -v
  752  cd /etc/scripts
  753  ll
  754  cd digiapis
  755  pm2 start scheduleworker.js -n cathcup
  756  cd epgrecording
  757  pm2 start scheduleworker.js -n cathcup
  758  cd /etc/scripts/epgrecording
  759  pm2 start scheduleworker.js -n cathcup



   761  ll
  762  cd digiapis
  763  ll
  764  crontab -l
  765  pm2 start app.js -n digiapis -i 0
  766  pm2 logs
  767  top
  768  crontab -e
  769  * /root/.nvm/versions/node/v7.10.0/bin/node /etc/scripts/epgrecording/index.js
  770  nvm ls
  771  locate v0.11.16
  772  locate .nvm
  773  nvm ls
  774  /root/.nvm/versions/node/ v10.2.1/bin/node /etc/scripts/epgrecording/index.js
  775  /root/.nvm/versions/node/v10.2.1/bin/node /etc/scripts/epgrecording/index.js
  776  crontab -e

   778  nvm current
  779  nvm use v7.10.0
  780  nvm install v7.10.0 && nvm use v7.10.0 && nvm alias default v7.10.0
  781  nvm -v
  782  mpm -v
  783  npm -v
  784  nvm -v
  785  ls -v
  786  nvm ls
  787  pm2 list
  788  locate .bash_profile
  789  vim /root/.bash_profile
  790  npm install pm2@latest -g
  791  pm2 startup
  792  pm2 save
  793  cd epgrecording
  794  cd /epgrecording
  795  cd /etc/scripts/epgrecording
  796  pm2 start scheduleworker.js -n cathcup
  797  reboot
  798  npm -v
  799  node -v



   800  pm2 list
  801  pm2 logs
  802  crontab -e
  803  pm2 logs
  804  crontab -e
  805  pm2 logs
  806  date
  807  clock
  808  pm2 logs
  809  ping digi2.nexg.tv
  810  pm2 logs
  811  pm2 logs | grep catchup
  812  pm2 logs
  813  telnet 119.252.192.7 8087
  814  ping digi2.nexg.tv
  815  crontab -l
  816  /root/.nvm/versions/node/v7.10.0/bin/node /etc/scripts/epgrecording/index
.js
  817  redis-cli
  818  pm2 list
  819  pm2 logs
  820  vim /etc/hosts
  821  redis-cli monitor



  822  telnet localhost 6379
  823  redis-cli monitor
  824  redis-cli monitor | grep "programme_schedule"
  825  redis-cli monitor
  826  redis-cli monitor  | grpe "more"
  827  redis-cli monitor  | grep  "more"
  828  pn2 logs
  829  pm2 logs
  830  top
  831  pm2 logs
  832  redis-cli monitor
  833  pm2 logs
  834  top
  835  iotop
  836  yum install iotop
  837  iotop
  838  iostat
  839  pm2 logs
  840  redis-cli monitor
  841  vim /root/.ssh/authorized_keys




  862  route add -net 172.29.2.0/23 gw 172.31.22.1
  863  route -n
  864  exit
  865  pm2 logs



  netstat -anp | grep 172.31.22.55 | awk '{print $6 }' | sort | uniq -c







    966  yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n
oarch.rpm
  967  yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  968  yum install yum-utils
  969  yum-config-manager --enable remi-php56
  970  php -v
  971  service httpd start
  972  yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php
-zip php-fileinfo
  973  php -v
  974  service httpd start
  975  yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php
-zip php-fileinfo
  976  php -v
  977  top
  978  service httpd stop
  979  top
  980  service memcached status
  981  telnet localhost 11211
  982  top
  983  free -m

 
  661  nvm uninstall *
  662  nvm uninstall*
  663  command -v nvm
  664  nvm install node
  665  pm2 list