Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

  • India
View GitHub Profile
@tejastank
tejastank / ipc.example.js
Created February 5, 2021 12:25 — forked from Xaekai/ipc.example.js
Example of Interprocess communication in Node.js through a UNIX domain socket
/*
**
** Example of Interprocess communication in Node.js through a UNIX domain socket
**
** Usage:
** server> MODE=server node ipc.example.js
** client> MODE=client node ipc.example.js
**
*/
@tejastank
tejastank / keylogger.py
Created April 7, 2020 13:29 — forked from smellslikeml/keylogger.py
keylogger
#!/usr/bin/env python
"""
Based on script by Aman Deep
A simple keylogger witten in python for linux platform
All keystrokes are recorded in a log file.
The program terminates when grave key(`) is pressed
grave key is found below Esc key
# Nmap to scan the top 1000 most
# common ports, give us the service
# version information for any open
# ports, write it to an output
# file and use our csv file as a
# list of IPs to scan.
sudo nmap -sSV -oA OUTPUTFILE -T4 -iL IPS.csv
@tejastank
tejastank / cursor_logger.py
Created April 7, 2020 13:29 — forked from smellslikeml/cursor_logger.py
cursor logger - record cursor position
#!/usr/bin/env python
import os
import time
from Xlib import display
old_x = 0
old_y = 0
old_dur = 0
end_time = 0
logfile = os.environ['HOME'] + '/.cursor.log'
#!/bin/bash
# zipcode--Given a ZIP code, identifies the city and state. Use city-data.com,
# which has every ZIP code configured as its own web page.
baseURL="http://www.city-data.com/zips"
/bin/echo -n "ZIP code $1 is in "
curl -s -dump "$baseURL/$1.html" | \
grep -i '<title>' | \
cut -d\( -f2 | cut -d\) -f1
exit 0
@tejastank
tejastank / yt_download.py
Created April 7, 2020 13:25 — forked from smellslikeml/yt_download.py
download youtube videos to .mp4 with command line argument search string
#!/usr/bin/env python
import os
import sys
import requests
from bs4 import BeautifulSoup as bs
from urllib.parse import urlencode
from pytube import YouTube
qstring = sys.argv[1]
out_dir = sys.argv[2]
@tejastank
tejastank / get-data-covid19-germany.py
Created April 5, 2020 20:40 — forked from xaedes/get-data-covid19-germany.py
Python Dataimport of Corona COVID-19 Infected and Dead Counts for Germany from Wikidata
import requests
import pandas as pd
import datetime
url = 'https://query.wikidata.org/sparql'
query_infected = """
SELECT ?infectedDate ?infectedValue
WHERE
{
wd:Q83889294 p:P1603 ?infectedItem.
?infectedItem ps:P1603 ?infectedValue.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from math import cos, sin, pi, sqrt, atan2
d2r = pi/180
class Geometry(object):
def circle_intersection(self, circle1, circle2):
@tejastank
tejastank / .htaccess
Created December 12, 2019 14:36 — forked from jacobovidal/.htaccess
Upgrade Insecure Requests via .htaccess or meta tag to prevent mixed content
<ifModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
@tejastank
tejastank / udp_ipv6_client.py
Created August 31, 2019 16:06 — forked from tuxmartin/udp_ipv6_client.py
Python UDP IPv6 client & server
import socket
UDP_IP = "::1" # localhost
UDP_PORT = 5005
MESSAGE = "Hello, World!"
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", MESSAGE