Skip to content

Instantly share code, notes, and snippets.

View lakinmindfire's full-sized avatar

Lakin Mohapatra lakinmindfire

  • Mindfire Solutions
  • Bhubaneswar
View GitHub Profile
@lakinmindfire
lakinmindfire / git.md
Created May 7, 2024 06:39
15 Useful Git Commands
  1. 𝐠𝐢𝐭 𝐥𝐨𝐠 --𝐚𝐮𝐭𝐡𝐨𝐫="<𝐚𝐮𝐭𝐡𝐨𝐫>": Shows commits authored by the specified author.

  2. 𝐠𝐢𝐭 𝐝𝐢𝐟𝐟 --𝐧𝐚𝐦𝐞-𝐨𝐧𝐥𝐲: Shows only the names of files that have differences between two commits or branches.

  3. 𝐠𝐢𝐭 𝐩𝐫𝐮𝐧𝐞: Removes unreachable objects and refs from the local repository.

  4. 𝐠𝐢𝐭 𝐝𝐢𝐟𝐟 --𝐬𝐭𝐚𝐠𝐞𝐝: Show the differences between the staging area and the last commit.

  5. 𝐠𝐢𝐭 𝐫𝐞𝐟𝐥𝐨𝐠: Shows a log of all the changes made to the refs (branches, tags) in the repository.

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

@lakinmindfire
lakinmindfire / module-federation.js
Created August 10, 2023 07:50
Module Federation Example
/ App1 - Docker container 1
const App1 = () => <div>App 1</div>;
export const getFederatedModule = name => {
return {
'./App1': App1
};
};
@lakinmindfire
lakinmindfire / single-spa.js
Created August 10, 2023 07:49
single-spa example
// App1
const App1 = () => <div>App 1</div>;
export const bootstrap = [App1];
export const mount = [App1];
export const unmount = [App1];
// App2