This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* express 처음에 init 하시면 app.js 를 비롯하여 여러 디렉토리가 생기는데 | |
* logs 디렉토리에 아무것도 안남는다고 의문을 가지신 분에게 도움이 될거 같습니다. | |
* connect의 middleware logger 는 기본이 stdout 으로 출력하고 있었네요. | |
* http://senchalabs.github.com/connect/middleware-logger.html | |
* manual을 살펴보니 stream options 이 있었군요. | |
* 한번 생각나서 fs core module의 createWriteStream 을 사용하여 해봤더니 잘되네요. | |
* 다른 방법도 있으신분은 알려주세요 | |
*/ | |
var fs = require('fs'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
stdin { | |
type => "stdin-type" | |
} | |
file { | |
type => "syslog" | |
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ] | |
start_position => "beginning" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var os = require("os"); | |
//Create function to get CPU information | |
function cpuAverage() { | |
//Initialise sum of idle and time of cores and fetch CPU info | |
var totalIdle = 0, totalTick = 0; | |
var cpus = os.cpus(); | |
//Loop through CPU cores |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
using RDPCOMAPILib; | |
RDPSession currentSession = new RDPSession(); | |
public static void RDPConnect() | |
{ | |
if(currentSession != null) | |
{ | |
currentSession.OnAttendeeConnected += Incoming; | |
currentSession.Open(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// module | |
var crypto = require('crypto'); | |
// Constant | |
var HASH_TYPE = 'sha256'; | |
var HASH_UPDATE_DATA = 'PegasusNemberQer!!!'; | |
var INITIALIZE_VECTOR = '41chcgDa1qAC9c3l'; | |
var CHIPER_TYPE = 'aes-256-cbc'; | |
var ENCODE_TYPE = 'base64'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// step 1 install java | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer | |
sudo npm install java --save | |
// step 2 using | |
var java = require("java"); | |
var jarfile = "jarfileName.jar"; | |
java.classpath.push(jarPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var amqp = require('amqplib/callback_api'); | |
var qName = qname; | |
amqp.connect(host, function(err, conn) { | |
if (err != null) errorHandler(err); | |
on_consumer(conn); | |
}); | |
// Consumer | |
function on_consumer(conn) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by pegasuskim on 2015-12-07. | |
*/ | |
'use strict'; | |
var amqp = require('amqplib/callback_api'); | |
var async = require('async'); | |
function RabbitMQ(config) { | |
this.queues = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var EventEmitter = require('events').EventEmitter; | |
var inherits = require('util').inherits; | |
var apn = require('apn'); | |
module.exports = ApnsProvider; | |
function ApnsProvider( pushSettings ) { | |
var settings = pushSettings || {}; | |
var pushOptions = settings.pushOptions || {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var gcm = require('node-gcm'); | |
var EventEmitter = require('events').EventEmitter; | |
var inherits = require('util').inherits; | |
module.exports = GcmProvider; | |
function GcmProvider( pushSettings ) { | |
this._initPushConnection(pushSettings.gcm); | |
}; |