Skip to content

Instantly share code, notes, and snippets.

View manojrammurthy's full-sized avatar

manoj kumar manojrammurthy

View GitHub Profile
@manojrammurthy
manojrammurthy / Uploadgdriveremote.md
Created July 3, 2018 16:31
Upload File to google drive via command line

go to drive where you want to install googledrive cd ~ then wget googledrive wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download then you will see a file like uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE now rename the above file to gdrive mv uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive assign file executing rights mv uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive install gdrive in usr folder

Setting up a SSL Cert from Comodo
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
Purchase the cert
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You'll be asked for the content of the CSR file when ordering the certificate.
@manojrammurthy
manojrammurthy / splice.js
Created December 4, 2015 05:56
bonfire slacher flick
function splicing(arr,howMany){
arr.splice(0,howMany);
return arr;
}
splicing([2,3,4],2);
@manojrammurthy
manojrammurthy / slicearrayofsize.js
Created December 4, 2015 05:43
bonfire chunkymonky
function chunk(arr,size){
var temp=[];
for(var i=0; i<arr.length; i){
temp.push(arr.slice(i,i+=size));
}
return temp;
}
chunk(['a', 'b', 'c', 'd'], 2);
@manojrammurthy
manojrammurthy / truncatestring.js
Created December 4, 2015 04:40
bonfire freecodecamp basic algorithm javascript
function truncate(str, num) {
if(str.length<=num)
return str;
if (num <= 3)
return str.substr(0,num) + "...";
return str.substr(0,num-3) + "...";
}
truncate("A-tisket a-tasket A green and yellow basket", 11);
function repeat(str, num) {
// repeat after me
var op =[];
while(op.length <num){
op.push(str);
}
return op.join('');
}
//to check if a string ends with the specific target
function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
if(str.substring((str.length-target.length),(str.length))==target){
return true;
}
else{
return false;
function largestOfFour(arr) {
// You can do this!
var arr1=[];
for(var i=0; i<arr.length; i++){
var subArr=arr[i];
var largest= Math.max.apply(Math,subArr);
arr1.push(largest);
}
return arr1;
}
@manojrammurthy
manojrammurthy / AIMLTAGS
Last active August 29, 2015 14:22
AIML Description is done here
<AIML>= BEGINNING OF aiml FILE
<CATEGORY>=IT DEFINES A UNIT OF KNOWLEDGE
<PATTERN>=DEFINES a pattern to match what a user may input to bot
<TEMPLATE>= defines a pattern of response of bot to user
</TEMPLATE>
</PATTERN>
</CATEGORY>
</AIML>
<STAR> = used to match wildcard characters in pattern tag