Skip to content

Instantly share code, notes, and snippets.

View saikatsgupta's full-sized avatar
🐢
at ease in my own 'shell' 8-)

Saikat Sengupta saikatsgupta

🐢
at ease in my own 'shell' 8-)
View GitHub Profile
@saikatsgupta
saikatsgupta / conn_test.py
Created October 18, 2023 15:26
Test the connectivity
View conn_test.py
import socket
def check_conn():
conn_data = [
('xyz.abc.int', '10.20.200.10', 443),
('abc.xyz.int', '10.20.200.12', 8080)
]
for name, host, port in conn_data:
@saikatsgupta
saikatsgupta / pfx.md
Created August 21, 2023 05:05
Extract Cert and Key from PFX
View pfx.md
  • Extract the CA certs only: openssl pkcs12 -in mtf.pfx -out ca_certs.pem -cacerts -nokeys

  • Extract the Client certs only: openssl pkcs12 -in mtf.pfx -out client_certs.pem -clcerts -nokeys

  • Extract Private Key Only: openssl pkcs12 -in mtf.pfx -nocerts -out private.key -nodes

@saikatsgupta
saikatsgupta / template.sh
Created October 27, 2022 15:59
bash script template
View template.sh
#!/usr/bin/env bash
# ref - https://sharats.me/posts/shell-script-best-practices/
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
@saikatsgupta
saikatsgupta / Domain Enumeration Commands
Created October 9, 2020 08:11 — forked from its-a-feature/Domain Enumeration Commands
Common Domain Enumeration commands in Windows, Mac, and LDAP
View Domain Enumeration Commands
Domain: TEST.local
User Enumeration:
Windows:
net user
net user /domain
net user [username]
net user [username] /domain
wmic useraccount
Mac:
dscl . ls /Users
@saikatsgupta
saikatsgupta / index.html
Created August 9, 2020 09:16
form-jquery
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.3/build/pure-min.css"
integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ" crossorigin="anonymous">
@saikatsgupta
saikatsgupta / TestCafeAssertions.js
Last active January 19, 2020 14:47
TestCafe Assertions
View TestCafeAssertions.js
import { Selector } from 'testcafe';
fixture `Getting Started`
.page `https://news.ycombinator.com/`;
/**
* Docs: https://devexpress.github.io/testcafe/documentation/test-api/assertions/assertion-api.html
* Signature: await t.expect( actual ).eql( expected, message, options );
*
*/
@saikatsgupta
saikatsgupta / windows-app-installs.bat
Last active March 24, 2019 13:22
admin powershell script to install all my apps using chocolatey after a fresh OS installation
View windows-app-installs.bat
REM script to install all required apps post fresh OS installation
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco -?
choco feature enable -n allowGlobalConfirmation
choco install 7zip
choco install jdk8
choco install groovy
choco install maven
choco install python
choco install cmdermini
View Jenkinsfile
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@saikatsgupta
saikatsgupta / CsvToJson.java
Created January 20, 2019 08:22
Converts multiple csv files in a singe json file
View CsvToJson.java
package com.sai;
import com.google.common.collect.MultimapBuilder;
import com.google.common.collect.SetMultimap;
import com.google.gson.GsonBuilder;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import java.io.File;
View RobotUtils.java
package com.saiko;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;