Skip to content

Instantly share code, notes, and snippets.

@vgvinay2
vgvinay2 / install-pulse.sh
Created December 18, 2017 16:28 — forked from tafarij/install-pulse.sh
Install Pulse Secure on Ubuntu 16.04
# https://vt4help.service-now.com/kb_view_customer.do?sysparm_article=KB0010740#linux
wget https://secure.nis.vt.edu/resources/downloads/pulse-8.2R5.i386.deb
sudo dpkg –i pulse-8.2R5.i386.deb
/usr/local/pulse/PulseClient.sh install_dependency_packages
@vgvinay2
vgvinay2 / Module5.js
Last active August 16, 2017 06:42
HANDLE GET POST PUT DELETE and Query parameters in NODE JS without ExpressJS
Write a program to handle GET and POST request
/**Get request**/
var request=require('request');
request.get('https://someplace',options,function(err,res,body){
if(res.statusCode !== 200 ) {
console.log("Success");
}
[11/08/17, 4:18:11 PM] Saurabh Kumar: 'use strict';
const xml2js = require('xml2js').parseString;
const js2xmlparser = require("js2xmlparser");
const PDFDocument = require('pdfkit');
const fs= require('fs');
var doc = new PDFDocument();
const tableify = require('tableify');
//question 1
@vgvinay2
vgvinay2 / Module_3.js
Created August 8, 2017 06:09
File , user info and zip and Unzip program
'use strict';
var fs = require('fs');
const https = require('https');
const util = require('util');
const zlib = require('zlib');
const os = require('os');
//question 1
var fileName = 'assign3.js';
var readStream = fs.createReadStream(fileName);
@vgvinay2
vgvinay2 / sort.rb
Created July 26, 2017 06:42
Quick sort
def quick_sort(list)
qsort_helper(list).flatten
end
def qsort_helper(list)
return [] if list.empty?
number = list.sample
lower, higher = list.partition { |n| n < number }
@vgvinay2
vgvinay2 / Module2.js
Last active July 26, 2017 11:07
Modularizing Code
Question1 Write program to implement Doubly Linked List -> use module pattern and import in other file to perform operation
//doubly-linked_list.js
function Node(value) {
this.data = value;
this.previous = null;
this.next = null;
}
function DoublyList() {
this._length = 0;
@vgvinay2
vgvinay2 / Module1.rb
Last active July 20, 2017 05:54
Callback and Promise
1. Array iteration and append its index with the value using callback
let IterationArray = function(arr){
let temp = [];
arr.forEach(function (value, i) {
let my_hash={}
my_hash[i] = value
temp.push(my_hash);
});
return temp;
};
@vgvinay2
vgvinay2 / post_xml.rb
Created December 27, 2016 10:39 — forked from mattriley/post_xml.rb
Ruby HTTP POST request containing XML content
require 'net/http'
def post_xml url_string, xml_string
uri = URI.parse url_string
request = Net::HTTP::Post.new uri.path
request.body = xml_string
request.content_type = 'text/xml'
response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request request }
response.body
end
@vgvinay2
vgvinay2 / soundex.js
Created November 21, 2016 09:19 — forked from shawndumas/soundex.js
Soundex in JavaScript
var soundex = function (s) {
var a = s.toLowerCase().split(''),
f = a.shift(),
r = '',
codes = {
a: '', e: '', i: '', o: '', u: '',
b: 1, f: 1, p: 1, v: 1,
c: 2, g: 2, j: 2, k: 2, q: 2, s: 2, x: 2, z: 2,
d: 3, t: 3,
l: 4,
@vgvinay2
vgvinay2 / security_algorithms.md
Created August 22, 2016 15:46 — forked from jamesyang124/security_algorithms.md
security algorithms for refactoring.