Skip to content

Instantly share code, notes, and snippets.

View raojeet's full-sized avatar

Jeet Yadav raojeet

  • Pixelwebwrox
  • Gurgaon
View GitHub Profile
@raojeet
raojeet / clonescript.sh
Last active October 24, 2019 20:23
This script is used to copy from one GIT/BITBUCKET/GITLAB repository to any other GIT/BITBUCKET/GITLAB repository github repository clone script
#!/bin/bash
## your repo path from where you need to run script
SOURCE_PATH=/Applications/XAMPP/htdocs/bitbucket
CUREENT_PATH=`pwd`
BRANCH=master
## gitlab repo path where you want to copy changes only
GITLAB_REPO_PATH=/Applications/XAMPP/xamppfiles/htdocs/hdfcforex
#default branch
@raojeet
raojeet / sftp
Last active April 25, 2020 06:15 — forked from manimike00/sftp
SFTP setup
STEPS to CREATE sftp
# generate key
ssh-keygen
#Configure an SSH/SFTP User for Your Key
#add public key in below path
.ssh/authorized_keys
To Create a SFTP server for user to login and access particular folder
@raojeet
raojeet / setup_sftp.sh
Last active July 9, 2020 18:43 — forked from thomascannon/setup_sftp.sh
Script to setup a sftp service with KEY authentication
#!/bin/bash
# Assumes SSH is setup already with publickey authentication, i.e.
# PubkeyAuthentication yes
# PasswordAuthentication no
if [ "$EUID" -ne 0 ]
then echo "Please run with sudo"
exit
fi
@raojeet
raojeet / setup_sftp_key_pass.sh
Created July 9, 2020 18:44
Script to Setup a SFTP with KEY+PASSWORD authentication
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run with sudo"
exit
fi
read -p 'Enter sftp username to create: ' username
echo Creating user account for $username
adduser $username --shell /sbin/nologin
read -p 'Enter sftp password to create: ' password
echo "$username:$password" | chpasswd
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS||function(a,m){var r={},f=r.lib={},g=function(){},l=f.Base={extend:function(a){g.prototype=this;var b=new g;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
p=f.WordArray=l.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=m?b:4*a.length},toString:function(a){return(a||q).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var j=0;j<a;j++)b[c+j>>>2]|=(d[j>>>2]>>>24-8*(j%4)&255)<<24-8*((c+j)%4);else if(65535<d.le

OpenSSL Playground

Certificates

Print Certificate ( crt file )

openssl x509 -in stackexchangecom.crt -text -noout

Print Certificate ( pem file )

openssl x509 -in cert.pem -text -noout

Print Certificate ( cer file )

openssl x509 -inform der -in foobar.cer -noout -text

Read part of Certificate
@raojeet
raojeet / stopstartec2.py
Created April 6, 2021 17:35
Stop and Start ec2 instances by tag name
import boto3
region = 'us-west-1'
def get_instance_ids(type):
# create ec2 resource object to get all info about ec2
ec2 = boto3.resource('ec2')
instance_ids = []
# define tag you want to perform action on it
tags = ['stag-test']
# it will give you only running instance
@raojeet
raojeet / openssl_commands.md
Created January 21, 2023 08:10 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl