Skip to content

Instantly share code, notes, and snippets.

@neerajkanhere
neerajkanhere / stepbystep.txt
Created February 14, 2023 03:16 — forked from golomidov/stepbystep.txt
FFmpeg - custom filter addition
//
// ffmpeg_customfilter
// - base name - ainfoda (audio filter)
// - base name - vinfoda (video filter)
//
// 1. create new filein libavfilter/infoda_af.c
// use any filters as template, simplest is af_afnull.c
// filename is arbitrary (all recent named as af_name), but for me all my stuff called with

Recon and Attack Vectors from My Logs

This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.

There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.

$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log > requests.txt
@neerajkanhere
neerajkanhere / self-signed-certificate-with-custom-ca.md
Created September 30, 2022 18:31 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@neerajkanhere
neerajkanhere / 55-bytes-of-css.md
Created September 25, 2022 15:48 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@neerajkanhere
neerajkanhere / lit-element-in-browser.html
Created August 4, 2022 13:41 — forked from mcmoe/lit-element-in-browser.html
Using Lit Element without npm directly in the browser
<!-- From: https://gist.githubusercontent.com/sorvell/48f4b7be35c8748e8f6db5c66d36ee29/raw/67346e4e8bc4c81d5a7968d18f0a6a8bc00d792e/index.html -->
<!doctype html>
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
@neerajkanhere
neerajkanhere / README.md
Created July 1, 2022 00:19 — forked from jasonblanchard/README.md
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@neerajkanhere
neerajkanhere / Install_OpenCV4_CUDA11_CUDNN8.md
Created May 31, 2022 21:38 — forked from raulqf/Install_OpenCV4_CUDA12.6_CUDNN8.9.md
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 20.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 20.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@neerajkanhere
neerajkanhere / yolov4.py
Created February 25, 2022 16:02 — forked from YashasSamaga/yolov4.py
YOLOv4 on OpenCV DNN
import cv2
import time
CONFIDENCE_THRESHOLD = 0.2
NMS_THRESHOLD = 0.4
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)]
class_names = []
with open("classes.txt", "r") as f:
class_names = [cname.strip() for cname in f.readlines()]
@neerajkanhere
neerajkanhere / session.py
Created December 6, 2021 13:50 — forked from viyatb/session.py
Session Handling in Tornado thanks to @milan Cermak
# -*- coding: utf-8 -*-
"""
Sessions module for the Tornado framework.
Milan Cermak <[email protected]>
This module implements sessions for Tornado. It can store
session data in files or MySQL databse, Memcached, Redis
and MongoDB.
@neerajkanhere
neerajkanhere / sshd.go
Created November 18, 2021 16:40 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client: