Skip to content

Instantly share code, notes, and snippets.

View ketankr9's full-sized avatar

Utsav Krishnan ketankr9

  • Google
  • Indian Institute of Technology (BHU), Varanasi,India
View GitHub Profile
@ketankr9
ketankr9 / LeetcodeTimer.ketankr9.js
Last active May 19, 2020 06:50
Use this UserScript in any browser to see the time elapsed while solving a problem at leetcode.com . HowToInstall https://greasyfork.org/en/help/installing-user-scripts
// ==UserScript==
// @name Leetcode Timer
// @version 1.2
// @grant none
// @include *://*leetcode.com/problems/*
// @author ketankr9
// @namespace https://greasyfork.org/users/564674
// @description Start a timer whenever a user loads a problem at Leetcode.com
// ==/UserScript==
@ketankr9
ketankr9 / netusage.sh
Created December 24, 2019 14:28
output the value of any scripy in ubuntu unity panel
#!/bin/bash
echo $(($(cat /proc/net/dev | awk '{print $2}' | tail -n1) + $(cat /proc/net/dev | awk '{print $2}' | tail -n2 | head -n1)))
@ketankr9
ketankr9 / contest_bot.py
Last active July 23, 2019 07:00
Telegram bot which sends the schedule of programming contests held at various hosts.
TOKEN='****DECLARE YOUR TOKEN HERE****'
import time
import random
import telepot
from telepot.loop import MessageLoop
import requests
from datetime import datetime, timezone, date
import pytz
"""
@ketankr9
ketankr9 / iitbhulogin.service
Created June 7, 2019 05:08
hotspot login script at boot when the network is ready
#sudo systemctl edit --force --full iitlogin.service
#enter the below script and make sure ```sudo chmod u+x /usr/local/bin/forti```
----------------------------------------------------
[Unit]
Description=IIT Lan Login
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
@ketankr9
ketankr9 / dovecot_dovecot.conf
Created February 1, 2019 10:05
mailserver postfix configuration and dovecot imap/pop3 setup
#$$$ cat /etc/dovecot/dovecot.conf
## Dovecot configuration file
# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration
# "doveconf -n" command gives a clean output of the changed settings. Use it
# instead of copy&pasting files when posting to the Dovecot mailing list.
# '#' character and everything after it is treated as comments. Extra spaces
# and tabs are ignored. If you want to use either of these explicitly, put the
#!/usr/bin/env bash
USED=$(ssh pratik@172.16.16.19 nvidia-smi | head -n9 | tail -n1 | awk {'print $9'})
echo "GPU:$USED"
echo "---"
echo "$USED/12195MiB"
#SCRIPT_STATE=$(ssh pratik@172.16.16.19 'pgrep -fa "python\sNeuralStyleTransfer"')
#if [ -z "$SCRIPT_STATE" ]; then
# echo "Exit"
#else
@ketankr9
ketankr9 / SimpleTCPClient.java
Created September 16, 2018 20:10
Java Socket implementation of Client.
import java.io.*;
import java.net.*;
import java.util.ArrayList;
import java.util.List;
class SimpleTCPClient
{
private static Socket socket;
private static InputStream input;
import requests
from bs4 import BeautifulSoup as bs
import re
import csv
TAGS=["python"]
MAX_PAGES_PER_TAGS = 20 #int
FILENAME_PREFIX = "Dataset_"
# def writeToCSV(fileName):
@ketankr9
ketankr9 / ca.crt
Last active June 13, 2018 12:06
Details
-----BEGIN CERTIFICATE-----
MIIDxDCCAqygAwIBAgIJAPzAhlECYUXxMA0GCSqGSIb3DQEBCwUAMHcxCzAJBgNV
BAYTAklOMQswCQYDVQQIDAJVUDEOMAwGA1UEBwwFTm9pZGExEDAOBgNVBAoMB1Nh
bXN1bmcxDDAKBgNVBAsMA0lNUzEMMAoGA1UEAwwDd3M0MR0wGwYJKoZIhvcNAQkB
Fg50ZXN0QGdtYWlsLmNvbTAeFw0xODA2MDUxNzI1MjNaFw0yMzA2MDUxNzI1MjNa
MHcxCzAJBgNVBAYTAklOMQswCQYDVQQIDAJVUDEOMAwGA1UEBwwFTm9pZGExEDAO
BgNVBAoMB1NhbXN1bmcxDDAKBgNVBAsMA0lNUzEMMAoGA1UEAwwDd3M0MR0wGwYJ
KoZIhvcNAQkBFg50ZXN0QGdtYWlsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAND0QRodc1yM8Vu9BImDdCqpeBe0OFC9alZDx9fSLmAA0fndXO4Z
4iSdbKbbDUnlikNvVwydy/UY/xyZ5zSczJBPuZwCKiaMqEFsi4t/ybJN4UDYaJqX
@ketankr9
ketankr9 / kali_wifi_crack.sh
Created May 18, 2018 08:25
Automated Wifi Password Crack Using airmon-ng
#!/bin/bash
# start in monitor mode
airmon-ng start wlan0
# dump all traffic data
airodump-ng wlan0mon
# start capturing packets, looking for deauth