Skip to content

Instantly share code, notes, and snippets.

View sauravtom's full-sized avatar
🏠
Working from home

Saurav Kumar sauravtom

🏠
Working from home
View GitHub Profile
/**
*⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⠀⠀⢀⣠⣤⣶⣶⣶⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡔⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢟⣫⣯⣷⣾⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣷⡙⢿⣿⣿⣿⣿⣿⣿⡿⢋⣵⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣙⠿⠿⠿⢟⣫⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⢹⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⠀⠀⠀⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⣿⣿⣿⡏⠉⠙⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⣿⡿⡍⠳⣄⡀⢀⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀
*⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢿⣿⢿⡄⠸⡿⢄⠛⣘⢠⣼⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀
*⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡞⣼⡻⡄⠳⡤⠽⠾⠿⠿⠿⢛⣻⣿⣿⣿⣷⡀⠀⠀⠀
@sauravtom
sauravtom / ddos.py
Last active August 15, 2022 12:39
Analyzing a DDOS attack with python
#!/usr/bin/env python
import sys
import collections
import urllib
def main(date):
log_file = open('/var/log/auth.log', "r")
#creating an array of the ip of all items which contain date and the string "Failed password"
arr = [line.split(" ")[-4] for line in log_file if date in line and "Failed password" in line]
import { IExecuteFunctions } from 'n8n-core';
import {
INodeExecutionData,,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import * as http from 'http'
# Folder where data should be saved
DATA_FOLDER=/root/n8n/
# The top level domain to serve from
DOMAIN_NAME=example.com
# The subdomain to serve from
SUBDOMAIN=n8n
# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from
version: "3"
services:
traefik:
image: "traefik"
command:
- "--api=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
@sauravtom
sauravtom / morningSpreadsheet.py
Last active November 29, 2019 15:35
Program to publish reddit data onto google spreadsheets
import gspread
from newspaper import Article
from bs4 import BeautifulSoup
import requests
import re
import time
import feedparser
# Login with your Google account
gc = gspread.login('megmailaccount', 'mepassword')
@sauravtom
sauravtom / word_count.exs
Last active April 22, 2019 14:29
Alchemist Challenge #2
#https://alchemist.camp/episodes/word-count
#filename = String.trim IO.gets "file to count word's from: "
filename = IO.gets("Select file: ") |> String.trim()
choice = IO.gets "What would you like to count ? [lines, words, characters] \n"
case choice |> String.trim() do
"words" -> IO.puts "you chose words"
#words = (File.read!(filename), ~r{\w}) |> String.split()
@sauravtom
sauravtom / guessing_game.exs
Created April 22, 2019 08:31
Alchemist Challenge #1
defmodule GuessingGame do
# guess between a low number and a high number - > guess the middle
#tell the user the guess
# if user say yes -> game over
# if bigger
# if smaller
# anything else
# elixr allows for multiple definitions of the same functions
def guess(a, b) when a > b do
pragma solidity ^0.4.25;
contract edm {
string public message;
constructor(string initMessage) public {
message = initMessage;
}
function update(string newMessage) public {
message = newMessage;
}

Keybase proof

I hereby claim:

  • I am sauravtom on github.
  • I am saurav (https://keybase.io/saurav) on keybase.
  • I have a public key whose fingerprint is 71E3 6A60 D3C0 3401 7D77 9363 652D 9E81 9FD6 F660

To claim this, I am signing this object: