Skip to content

Instantly share code, notes, and snippets.

View aashutoshrathi's full-sized avatar
👨‍💻
Baking Code

Aashutosh Rathi aashutoshrathi

👨‍💻
Baking Code
View GitHub Profile

Keybase proof

I hereby claim:

  • I am aashutoshrathi on github.
  • I am aashutoshrathi (https://keybase.io/aashutoshrathi) on keybase.
  • I have a public key whose fingerprint is 96B1 EAB8 9D51 CCBE AA55 67F6 BB1C 30C5 F931 E8FC

To claim this, I am signing this object:

@aashutoshrathi
aashutoshrathi / wd_passport_tools.py
Created June 13, 2019 17:54
WD Passport Tools for Linux
#!/usr/bin/env python
import sys
import os
import struct
import getpass
from hashlib import sha256
from random import randint
import argparse
import subprocess
function binaryAgent(str) {
var newBin = str.split(" ");
var binCode = [];
for (i = 0; i < newBin.length; i++) {
binCode.push(String.fromCharCode(parseInt(newBin[i], 2)));
}
return binCode.join("");
}
Verifying my Blockstack ID is secured with the address 1B3GsdMBxiPtp5E2qDPBZduzX7R12bvAuc https://explorer.blockstack.org/address/1B3GsdMBxiPtp5E2qDPBZduzX7R12bvAuc
@aashutoshrathi
aashutoshrathi / addImage.md
Created December 10, 2018 08:39
Best way to add Image in Telegram message
you must set ParseMode in HTML and set your Image Url in A tag like this:

<a href="' + image + '">&#8205;</a>

&#8205; -> never show in message

Problem -1 (Super Easy)

In how many ways you can arrange numbers 1 through 9 in a 3x3 grid in such a way that the following conditions hold:

  • Every number is greater than the number directly above it and
  • Every number is greater than the number immediately left to it.

Problem - 3 (Medium)

Bharat: "Hey, Amar!"

Amar: "Yes, I know. You want to play 'Guess a Number.' I'll play the two-round version where you submit a list of yes/no questions, then I answer them, and then you guess one number."

Bharat: "Okay! So..."

Amar: "But I will not answer all of your questions. I will leave one question (of my choosing) unanswered."

@aashutoshrathi
aashutoshrathi / problem2.md
Last active December 9, 2018 08:24
1729 Problem 2

Problem - 2 (Easy)


You've come to know that the crypto system of a famous bank is misbehaving lately. While making transactions, the random prime number generator of the bank is frequently producing same prime numbers when the keys are being generated. You want to make the most of it by deciphering the keys and the prime numbers used. Use this knowledge to factor the keys and intercept the transaction so that you can divert the transactional amount to your account. Submit the answer as the last 7 digits of the greatest factor found (in decimal). 

Note: It's a convention that the keys are a product of two large prime numbers

Key 1:
1c7bb1ae67670f7e6769b515c174414278e16c27e95b43a789099a1c7d55c717b2f0a0442a7d49503ee09552588ed9bb6eda4af738a02fb31576d78ff72b2499b347e49fef1028182f158182a0ba504902996ea161311fe62b86e6ccb02a9307d932f7fa94cde410619927677f94c571ea39c7f4105fae00415dd7d
+
+++
++[>+
+++++++
++<-]>+++
+++++
+++++++
++.>+++++
+++++[>++++
++++++<-]>+.+