Skip to content

Instantly share code, notes, and snippets.

@zymr-keshav
zymr-keshav / kep.sh
Last active April 20, 2023 08:23
Shell script which help to create a dynamic json file and run python script based on the arguments
#!/bin/bash
# @author: Keshav Mohta
# file use to pump events using python script; this shell script help to build the required json data
# call as `sh kep_flag.sh -a <appName> -e <event> -t <eventType> -h <hostname>`
# example sh kep_flag.sh -a "Magento" -e "Attack" -t "Buffer Error" -h "20.20.1.47"
# event = Attack | Threat | File|
# appName: Magento | Sap | OpenText | Nginx | Tomcat | Wondercare
# eventType
# Attack : "ReflectiveXSS" | "File Integrity" | "SQLi"| "Spectre" | "DLLi" | "CSRF" | "CMDi" | "Buffer Error"
# Threat: "ReflectiveXSS" | "File Integrity" | "CSRF" |
@zymr-keshav
zymr-keshav / Ubuntu to macOS.md
Created September 15, 2017 04:27
useful tweaks and tip while switching from ubuntu to macOS x

MacOS Sierra 10.12.5 Macbook Pro ( Ratina )

Ubuntu to Mac os.

  1. You can not create new file from context menu but can create new folder only. alternative: use touch filename
  2. No utility to lock the monitor alternative: a. Navigate to  icon --> System Prefrences --> Security & Privacy --> General --> Check Require Password immediately after sleep or screen saver starts b. hit Shift-Control-Power hold them down for two seconds, revoke by Spacebar
  3. No way to see hidden files in a folder.
@zymr-keshav
zymr-keshav / chart dataset
Last active June 26, 2018 06:35
javascript array
const dataset = [
{
detail: {
team: [
{ name: 'alpha', game: 1 },
{ name: 'beta', game: 1 },
{ name: 'gamma', game: 1 },
{ name: 'delta', game: 1 },
{ name: 'echo', game: 1 }
@zymr-keshav
zymr-keshav / chartdata.js
Last active April 9, 2018 10:19
generate chartjs data from response which comes as key and data and turn into lables and data
remakeChartData(input) {
const output = {};
input.map((item) => {
for (let key in item) {
if (!(key in output)) {
output[key] = [];
}
output[key].push(item[key]);
}
});
@zymr-keshav
zymr-keshav / canvas_initials.html
Created March 28, 2018 19:58
create image with name initials using html5vcanvas
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Use Initials Image</title>
</head>
<body>
<img src="" / >
<script>
(function() {
@zymr-keshav
zymr-keshav / invite.html
Last active February 1, 2018 10:14
email_template.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Account Activation Mail</title>
<style>
body {
display: grid;
justify-content: center;
@zymr-keshav
zymr-keshav / .editorconfig
Created December 8, 2017 06:14
editor config for sublime text
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@zymr-keshav
zymr-keshav / SublimeLinter.sublime-settings
Created December 5, 2017 06:09
Sublime linter setting
{
"user": {
"debug": true,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/Boxy Theme/extras/SublimeLinter/Boxy.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "load/save",
"linters": {
"eslint": {
@zymr-keshav
zymr-keshav / node.sublime-build
Created December 5, 2017 06:08
Sublime Build to run es6 properies
{
"shell_cmd": "babel-node ${file}",
"selector": "source.js"
}
@zymr-keshav
zymr-keshav / eslint.sublime-build
Created December 5, 2017 06:07
eslint quick fix sublime build
{
"shell_cmd": "$project_path/node_modules/eslint/bin/eslint.js --fix $file"
}