Skip to content

Instantly share code, notes, and snippets.

View OmkarKirpan's full-sized avatar
🎨

Omkar Kirpan OmkarKirpan

🎨
View GitHub Profile
@OmkarKirpan
OmkarKirpan / main.go
Created June 3, 2024 10:36
cloud.google.com/go/pubsub
package main
// #include <stdlib.h>
import (
"C"
"context"
"encoding/json"
"fmt"
"cloud.google.com/go/pubsub"
@OmkarKirpan
OmkarKirpan / README.md
Last active March 17, 2023 12:27
an automation javacript script that removes the "ban-sensitive-files" module from the dev dependencies of microservices hosted on GitHub Enterprise Server.

Remove Ban-Sensitive-Files Module

A script that removes the ban-sensitive-files module from the devDependencies of microservices hosted on GitHub Enterprise Server. The script performs the following actions for each repository:

  • Clone the repository to a local directory
  • Create a new branch named feature/remove-ban-sensitive-files from the given branch name
  • Remove the ban-sensitive-files module from the devDependencies of the package.json file
  • Rebuild the package-lock.json file
  • Commit the changes to the new branch and push them to the remote repository
  • Create a pull request with the title "Remove ban-sensitive-files module from dev dependencies" and a message detailing the changes made.
@OmkarKirpan
OmkarKirpan / SCORM_cheat.js
Created March 1, 2023 19:53
SCORM LMS Hack
let ok = SCORM_GetAPI()
// setting lesson_status
ok.LMSSetValue('cmi.core.lesson_status', 'completed')
ok.LMSGetValue('cmi.core.lesson_status')
// setting score
ok.LMSSetValue('cmi.core.score.raw', '100')
ok.LMSGetValue('cmi.core.score.raw')
// Saving
ok.LMSCommit()
ok.LMSFinish()
@OmkarKirpan
OmkarKirpan / FilesReadFileExample.java
Created September 14, 2022 04:09
store decoded binary file to path
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.List;
public class FilesReadFileExample {
public static void main(String[] args) {
@OmkarKirpan
OmkarKirpan / SimpleSmartContract.sol
Created July 22, 2021 15:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.0;
contract SimpleSmartContract {}
@OmkarKirpan
OmkarKirpan / fix-wsl2-dns-resolution
Created June 14, 2021 18:24 — forked from coltenkrauter/fix-wsl2-dns-resolution
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@OmkarKirpan
OmkarKirpan / OneDirect.js
Created February 11, 2021 07:44
OneDirect AutoRefresh Chats
// ==UserScript==
// @name OneDirect AutoRefresh Chats
// @namespace https://theunpaiddev.tumblr.com/
// @version 1.0
// @description Auto refresh Onedirect Chats
// @author Omkar Kirpan
// @match https://*.onedirect.in/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
@OmkarKirpan
OmkarKirpan / slackmap.sh
Created December 2, 2019 19:17 — forked from jgamblin/slackmap.sh
Script to NMAP a network and Post Differences to Slack
#!/bin/sh
TARGETS="192.168.1.0/24"
OPTIONS="-v -T4 -F -sV"
date=$(date +%Y-%m-%d-%H-%M-%S)
cd /nmap/diffs
nmap $OPTIONS $TARGETS -oA scan-$date > /dev/null
slack(){
curl -F file=@diff-$date -F initial_comment="Internal Port Change Detected" -F channels=#alerts -F token=xxxx-xxxx-xxxx https://slack.com/api/files.upload
}