Skip to content

Instantly share code, notes, and snippets.

View duke79's full-sized avatar

duke79 duke79

View GitHub Profile
@duke79
duke79 / Merge Sort
Last active November 12, 2016 04:12
C++
void Swap(int &A,int &B)
{
int temp = A;
A = B;
B = temp;
}
void MergeSort(int *A, int N)
{
if (N > 1)
@duke79
duke79 / 1300 Words
Last active November 27, 2016 04:52
GRE
introspection philanthropist antidote strive ambidextrous retrospective precursors introvert gerontocracy ambiguous braggart aggravate entice alleviate adorn equilibrium abhor connote endeavor agile renovate curriculum malevolent amalgamate xenophile (zen-uh-fahyl) drowsiness stray disrobe acumen suffocate sporadic scent sequence audacious affinity animosity heterogeneous fragile legacy massacre appease submerge adulteration combustion premature shunned anguish apt conceal grumble indigenous offhand loll correlate somersault abscond edible extinguish inquest surcharge accolade conjoin timid opaqueness disallow abide impermeable console warrant acclaimed extinct reminiscent catalyst embezzle shallow clientele brittle negligent affable salvage moribund relapse dangle ascend asterisk yarn arrogance divergence allegiance vigorous dwarf livid rejuvenation fragrant judicious hospitable odor scribble ameliorate poseur sawdust narcissism dullard succumb sluggard flop ingest reiterate derivative defer eloquence clot
@duke79
duke79 / CodeChef.py
Created May 13, 2018 09:44
CodeChef - Python
def mainFile():
f = open("CodeChefInput.txt", "r")
f.readline()
def nextLine():
line = f.readline()
elems = line.split()
if len(elems) < 2:
return int(line)
else:
for idx in range(len(elems)):
@duke79
duke79 / packages.txt
Created August 29, 2018 16:02
Kubuntu Config
apt-get install git
add-apt-repository ppa:nathan-renniewaldock/flux
apt-get install git
sudo apt-get install python-pip
git clone "https://github.com/xflux-gui/fluxgui.git"
@duke79
duke79 / IntelIJTrialReset.bat
Created January 15, 2019 05:23
How to Reset InteIIiJ IDEA Evaluation Key in Windows
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\options.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
:: Trial Period and Evaluate the IDE for some more Time
// ==UserScript==
// @name Emby - local path
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://localhost:8096/*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==
@duke79
duke79 / retirement_plan.py
Last active May 10, 2019 15:53
Calculators
class Portfolio:
AGE=29 # Starting year
CTC=1000000 # Total CTC, it's assumed that only 75% comes in hand
HIKE=100000 # Assuming 1 lakh hike every year
RETURNS_PER_ANNUM = 1.10 # Assuming investment returns are 10% per annum
EXPENSES_PER_MONTH = 40000 # Assuming monthly expenses are 40k, inflation taken into account while calculating though
INFLATION=1.07 # Assuming 7% inflation
ASSETS=0 # Assuming there's no investment so far
DURATION=50 # Assuming death after 50 years
@duke79
duke79 / dep.bat
Created June 19, 2019 09:46
python dependencies
@echo off
set PYTHONPATH=%~dp0..\..
python %~dp0..\py\dependencies.py %*
REM cli dep %*
@duke79
duke79 / bot.py
Created December 12, 2019 11:33
Slack Bot
# ref : https://github.com/slackapi/python-slackclient
import sys
import uuid
import slack
from lib.py.core.config import Config
slack_token = Config()["slackbot"]["user_token"]
authorized_users = Config()["slackbot"]["authorized_user_ids"]
client = slack.WebClient(slack_token)
@duke79
duke79 / msfinstall
Created December 15, 2019 09:33
metasploit
#!/bin/sh
print_pgp_key() {
cat <<-EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFDAy/0BEAC8I5bw5gLQqHKx5JCacYcXFL6AZowl3qIOTxo5yfBl8CepNpWY
OOERvIUJb17WehhhbWOo9WjpBalDXBRtI1NvfArewOT8fLm7BdhYe8U45moBfkYi
xFtNrPw3pdIltHQISrB8PufhliN8obQuq0rcxYV8NblvYo4gIGNjBfO1QGvBNmp7
kBtjlAuZguScZmUTdPOwfv8fqN52X9tCv1ahQk1hg8XG9YwW0vXb5z93jkLXBb5b