Skip to content

Instantly share code, notes, and snippets.

View tvvignesh's full-sized avatar
🤓
Hacking my way through this world..

Vignesh T.V. tvvignesh

🤓
Hacking my way through this world..
View GitHub Profile
@tvvignesh
tvvignesh / flattenArray.js
Created October 15, 2016 16:47
Flatten an array of nested arrays of integers
/**
* Flatten an Array of Arbitrarily nested Arrays of Integers
* into a Flat Array of Integers.
* @param {Array} intArray - Array of Numbers
* @param {Array} flatArray - Flatten array (recursive)
* @return {Array} - Array of Numbers
*
* Link to JSBin - http://jsbin.com/dofuneb/edit?js,output
*/
var flatten = function(intArray, flatArray) {
@tvvignesh
tvvignesh / program.js
Created March 19, 2018 18:01
Grep implementation in Node.js
/*
Instructions to run:
node program.js grep "search term" file1.xyz file2.xyz /path/to/file/file3.xyz
*/
var fileList = [];
var countObj = {};
console.log(process.argv);
@tvvignesh
tvvignesh / gpg.md
Last active July 19, 2018 20:34
Encrypt and Decrypt files using GPG Algorithm - https://www.gnupg.org/

Remove existing GPG Secret Keys

gpg --delete-secret-keys "Vignesh T.V."

Remove existing GPG Public Keys

gpg --delete-keys "Vignesh T.V."

Generate GPG Keys

gpg --gen-key

Export GPG Public Key

@tvvignesh
tvvignesh / ops.md
Last active May 18, 2019 12:13
Quick Commands

SEMODULE DISABLE IN CentOS

sudo cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M mynginx

sudo semodule -i mynginx.pp

ALLOW HTTP & HTTPS TRAFFIC IN FIREWALL

sudo systemctl stop firewalld

@tvvignesh
tvvignesh / iisnode.md
Last active May 18, 2019 12:11
Using IISNode

Webconfig file when using IIS Node - https://github.com/Azure/iisnode

<configuration>
  <system.webServer>

    <!-- indicates that the hello.js file is a node.js application 
    to be handled by the iisnode module -->

 
@tvvignesh
tvvignesh / DocumentProcessing.md
Created November 23, 2018 11:47
Process Documents

Convert PPTX to PDF using libreoffice

libreoffice --headless --invisible --convert-to pdf *.pptx

Combine multiple PDFs to form a single PDF with layout options

pdfjam *.pdf --nup 3x4 --landscape --outfile output.pdf