Skip to content

Instantly share code, notes, and snippets.

View meta-ks's full-sized avatar
🍏

k0s meta-ks

🍏
View GitHub Profile
@meta-ks
meta-ks / GoogleDorking.md
Created May 3, 2024 03:36 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@meta-ks
meta-ks / NSE_Reports_link.txt
Created March 3, 2024 04:36 — forked from bugcy013/NSE_Reports_link.txt
NSE Reports link
@meta-ks
meta-ks / ts_interp.py
Created November 30, 2023 09:47
Interpolate timestamp in pandas
def interpolate_timestamps(df, col):
# Convert the timestamp column to numeric values (in us since Unix epoch)
numeric_ts = pd.to_numeric(df[col])
# Replace any numeric values that are less than 0 with NaN
# This step is crucial because pd.to_numeric() can convert NaT (Not-a-Time) values
# to large negative numbers. By replacing these with NaN, we ensure they are
# correctly identified as missing values for interpolation.
numeric_ts[numeric_ts < 0] = np.nan
@meta-ks
meta-ks / thread_priority_hack.py
Created September 21, 2023 11:08
This script demonstrates the adjustment of thread priorities
import threading
import os
import signal
import time
"""
This script demonstrates the adjustment of thread priorities and handling Ctrl+C to gracefully stop threads.
Thread Priority Mechanism:
@meta-ks
meta-ks / booster.js
Created July 27, 2023 09:01
audio booster for youtube and all
// Function to adjust the volume of a video element
function adjustVideoVolume(videoElement, volume) {
// Create an audio context
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
// Create a media element source from the video element
const source = audioCtx.createMediaElementSource(videoElement);
// Create a gain node to control the volume
const gainNode = audioCtx.createGain();
@meta-ks
meta-ks / ordered_str_enum.py
Created July 24, 2023 03:59
Ordered String Enum. The comparison has been overloaded with .index_value instead of existing .value
from enum import Enum
#Inspired by: https://bobbyhadz.com/blog/python-compare-string-with-enum
# and https://stackoverflow.com/questions/76236985/how-to-compare-string-enums-in-python
class OrderedStrEnum(str, Enum):
def __ge__(self, other):
if self.__class__ is other.__class__:
return self._index() >= other._index()
@meta-ks
meta-ks / NSE_utils.py
Created July 22, 2023 08:19
NSE utilities. Download data from NSE usign jtrader
import os
import time
import io
import requests
nse_urls = {
'N50':'',
'N100':'',
'N200':'',
@meta-ks
meta-ks / FileLogger.py
Created May 17, 2023 03:35
The `FileLogger` class is a custom logging class for Python that extends the functionality of the built-in `logging.Logger` class. It provides the ability to log messages ONLY to a file and optionally to the console, with customizable file name, mode, log level, and formatter.
import logging
# Create a custom logger class
class FileLogger(logging.Logger):
def __init__(self, name, filename, mode='a', level=logging.INFO, fformatter=None, log_to_console=False, sformatter=None):
super().__init__(name, level)
# Create a custom file handler
self.file_handler = logging.FileHandler(filename=filename, mode=mode)
#include <iostream>
#include <chrono>
#include <random>
#define DOUBLE_PRECISION 10000
#define LAMBDA 5
using namespace std;
struct packet {
@meta-ks
meta-ks / fr-set-down.py
Created February 6, 2019 15:57 — forked from zmwangx/fr-set-down.py
Python script to download entire photosets (original quality) on Flickr. #flickr
#!/usr/bin/env python
import subprocess
import sys
# pip install flickrapi
# project home: http://stuvel.eu/flickrapi
import flickrapi
api_key = '00000000000000000000000000000000' # obtain your api key at http://www.flickr.com/services