This file contains hidden or 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
const redis=require('redis'); | |
const client=redis.createClient(); | |
// event for connection | |
client.on('connect', function(){ | |
console.log("Redis connected..."); | |
//console.log(client); | |
}); |
This file contains hidden or 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
// [1] | |
// Commander: | |
// $ node index.js --path='/a/b/c/d' | |
var | |
PROGRAM = require('commander'); | |
PROGRAM | |
.option('-p,--path <path>','path to config file') | |
.parse(process.argv); |
This file contains hidden or 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
# Installing package .deb | |
sudo dpkg -i atom-amd64.deb | |
sudo apt-get install -f |
This file contains hidden or 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
$ sudo rabbitmq-plugins enable rabbitmq_management | |
http://10.0.138.147:15672/ | |
$ service rabbitmq-server start | |
$ service rabbitmq-server stop | |
$ service rabbitmq-server restart | |
$ service rabbitmq-server status | |
/* If you are not able to login */ | |
$ rabbitmqctl add_user test test |
This file contains hidden or 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
# list of crontabs | |
crontab -l | |
# remove all crontabs | |
crontab -r | |
# edit crontabs | |
crontab -e |
This file contains hidden or 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
/** | |
* Definition for singly-linked list. | |
* struct ListNode { | |
* int val; | |
* ListNode *next; | |
* ListNode(int x) : val(x), next(NULL) {} | |
* }; | |
*/ | |
class Solution { | |
public: |
This file contains hidden or 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
#include<bits/stdc++.h> | |
using namespace std; | |
void flushFile(char *f){ | |
ofstream file; | |
file.open(f,std::ios::out); | |
file.close(); | |
} |
This file contains hidden or 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
#include<bits/stdc++.h> | |
#include<fstream> | |
using namespace std; | |
bool validChar(char c) { | |
return (c>='a' && c<='z') || | |
(c>='A' && c<='Z'); | |
} |
This file contains hidden or 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
#include<bits/stdc++.h> | |
#include<fstream> | |
using namespace std; | |
bool validChar(char c) { | |
return (c>='a' && c<='z') || | |
(c>='A' && c<='Z'); | |
} |
This file contains hidden or 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
#include<bits/stdc++.h> | |
using namespace std; | |
int countTotalChar(char *in){ | |
ifstream infile; | |
infile.open(in,std::ios::in); | |
int cnt=0; | |
char ch; |
NewerOlder