Skip to content

Instantly share code, notes, and snippets.

@mdsaleemj
mdsaleemj / openssl-extract-private-key-from-pfx.md
Last active January 21, 2022 07:43
openssl-extract-private-key-from-pfx

Customers sometimes have a need to export a certificate and private key from a Windows computer to separate certificate and key files for use elsewhere. Windows doesn't provide the means to complete this process.

Exporting Certificates from the Windows Certificate Store describes how to export a certificate and private key into a single .pfx file. Follow the procedure below to extract separate certificate and private key files from the .pfx file.

Procedure:

Take the file you exported (e.g. certname.pfx) and copy it to a system where you have OpenSSL installed. Note: the *.pfx file is in PKCS#12 format and includes both the certificate and the private key.

Run the following command to export the private key: openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes

@mdsaleemj
mdsaleemj / install_execstack_on_ubuntu.md
Created October 19, 2015 07:07
How to install execstack on Ubuntu and Arch Linux

Execstack is a great tool for learning and training on Linux. It is a program which sets, clears, or queries the executable stack flag of ELF binaries and shared libraries. When I was looking to install it I took me a bit to find which package to install it in.

You can install with :

Ubuntu

$ sudo apt-get install prelink

Arch Linux

@mdsaleemj
mdsaleemj / machine.js
Created August 27, 2021 04:37
Generated by XState Viz: https://xstate.js.org/viz
const tahoeTravelMachine = Machine({
id: "tahoe-travel",
initial: "login",
states :{
login : {
on :{
LOGIN : "logged_in"
}
},
@mdsaleemj
mdsaleemj / .vimrc
Last active August 14, 2020 10:16
My .vimrc file
let mapleader=","
set number " show line numbers
"spaces to tab
set tabstop=2
set expandtab
set shiftwidth=2
" list invisible chars
@mdsaleemj
mdsaleemj / storing and downloading binary data in mongodb
Last active November 21, 2018 12:40
storing and downloading binary data in mongodb without grid-fs
//The below model is used to book a travel ride.
//The uploaded file is parsed in the formidable multipart body parser and stored in req.files.fileField.
//File is read from , in my code, req.files.file
var rideModel = function(){
var rideSchema = new Schema({
email : String,
corp_id : String,
name : String,
manager: String,
@mdsaleemj
mdsaleemj / front-end-development.md
Last active October 26, 2017 07:03
Front End development

Hi, This is my place to gather any ideas/concepts/resources related to frontend development. Right now , front dev is vast and there lot of things for different types of front end projects .

BEST Resources is : FrontEnd Master - gitbook (also pdf available in drive). This book gives nice overview of overall front-end Engineering and describes lot of different disciplines with in front end dev.

#####NOTE##### This guide needs to constantly maintained and refined and grouped in different sections for better understanding. Also, refer to git where lot of resources available for front dev and related curricula.

@mdsaleemj
mdsaleemj / app.js
Created March 12, 2017 12:55 — forked from kadishmal/app.js
Simple Node.js server which responds in chunked transfer encoding
var http = require('http');
http.createServer(function (request, response) {
response.setHeader('Content-Type', 'text/html; charset=UTF-8');
response.setHeader('Transfer-Encoding', 'chunked');
var html =
'<!DOCTYPE html>' +
'<html lang="en">' +
'<head>' +
@mdsaleemj
mdsaleemj / Software-Development-Principles.md
Last active February 25, 2017 17:55
Software Development Priniciples

The purpose of this gist is to know more about the software developing principles in general. This intention is to explore and know more about software development from industry leaders like Martin Flowers, Robrt Martin(aka UncleBob ) and many .

In addition to that , learning and practising programming and desing skill with emphasis on necessary programming styles like OOP and FP needs to be encouraged.
This guide is started as rough draft and will serve to contain information about resources , leaders to follow, topics under software development.

##Software Development

@mdsaleemj
mdsaleemj / sorting-algorithms.md
Last active December 27, 2016 10:57
sorting-algorithms
SELECTION SORT - BASIC SORTING (WITHOUT OPTIMIZATION)

for(i=0;i<array.length;i++) {
    //assume i to be  index value of smallest value
    var minIndex = i;
    //loop through the rest of element and find the index of smallest element
    for(j=i+1;j<array.length;j++){
      if(array[j] < array[minIndex]){
 minIndex = j;

##Running ES6 javascript code in NodeJS envrionment.

  1. Try to install babel-cli

npm install --save-dev babel-cli npm install --save-dev babel-preset-es2015