Skip to content

Commit e75f905

Browse files
committed
restructuting the repo
1 parent 4925307 commit e75f905

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1079
-0
lines changed

C++/Primality_Test/primality.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The time complexity of this program is O(sqrt(n)).
2+
space complxity is O(1).
3+
sample input and output
4+
2
5+
4
6+
5
7+
8+
yes
9+
no
10+
yes

C++/Primality_Test/primalitytest.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
bool isprime(int num) // use of boolean function to check primality of number
4+
{
5+
if(num==1) // natural number
6+
return false;
7+
for(int i=2;i*i<=num;i++)
8+
{
9+
if(num%i==0) //Even number
10+
return false;
11+
}
12+
return true;
13+
}
14+
int main()
15+
{
16+
int num,t;
17+
cin>>t;// enter the number of test cases
18+
while(t--)
19+
{
20+
cin>>num;
21+
if(isprime(num)) // if number is prime.
22+
cout<<"yes"<<endl;// return yes
23+
else
24+
cout<<"no"<<endl; // otherwise return no.
25+
}
26+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The time complexity of this program is O(sqrt(n)).
2+
sample input and output
3+
2
4+
4
5+
5
6+
7+
yes
8+
no
9+
yes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Sending bulk LinkedIn Connection requests
2+
3+
Scripts in JavaScript to send and reject bulk connection requests
4+
5+
1. Open your browser and login into your Linkedin account.
6+
2. Navigate to ```linkedin.com/search/results/people/```.
7+
3. Launch Developer Tools in your Chrome browser
8+
9+
Go to your Chrome , and under the Developer Tools. For Windows / Mac , you can press F12 function key. Alternatively the short cut keys for Windows is “Control + Alt + I”, for Mac it is “Option + Command + I”. If you prefer to use the mouse instead, point to the hamburger menu (the 3 dots) on the Chrome top right corner. Click on it and the Developer Tools is in here
10+
11+
![endpoint](https://github.com/Tejas1510/hacking-tools-scripts/blob/main/Bulk-Linkedin-request/images/developerTool.png)
12+
13+
4. Open console as shown below.
14+
15+
![endpoint](https://github.com/Tejas1510/hacking-tools-scripts/blob/main/Bulk-Linkedin-request/images/console.png)
16+
17+
5. Open the script.
18+
7. Now copy the whole code and paste it into the console section.
19+
8. Wait for the script to do its job.
20+
21+
![demo](https://github.com/SANKET7738/random/blob/master/bulk_linkedin_requests/demo-imgs/demo.png)
Loading
Loading
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
2+
//function to pause the code
3+
function sleep(ms) {
4+
return new Promise(resolve => setTimeout(resolve, ms));
5+
}
6+
7+
async function connect(profile, i) {
8+
try {
9+
const a = document.querySelector(`#${profile.id}a`);
10+
if (a === null) {
11+
run();
12+
return;
13+
};
14+
const url = a.href;
15+
const connectBtn = document.quertSelector(
16+
`#${profile.id} button[aria-label^='Connect']`
17+
);
18+
if (connectBtn === null && profiles && profiles[i + 1]) {
19+
connect(
20+
profiles[i + 1],
21+
i + 1
22+
);
23+
return;
24+
} else if (connectBtn === null) {
25+
run();
26+
return;
27+
}
28+
connectBtn.click();
29+
await sleep(2000);
30+
const addNoteBtn = document.quertSelectorAll(
31+
"button[aria-label^='Add a note']"
32+
)[0];
33+
34+
const h2 = document.getElementById("send-invite-modal").innerHTML;
35+
// to select the profile
36+
if (h2.trim() === "Connect") {
37+
const dismiss = document.querySelector("butto[aria-label^='Dismiss']");
38+
profile.parentNode.removeChild(profile);
39+
dismiss.click();
40+
run();
41+
return;
42+
}
43+
if (addNoteBtn === null) {
44+
run();
45+
return;
46+
}
47+
addNoteBtn.click();
48+
await sleep(1000);
49+
50+
const name = document
51+
.getElementById("send-invite-modal")
52+
.innerHTML.replace("Invite", "")
53+
.replace(" to connect", "")
54+
.trim();
55+
const textarea = document.querySelector("#custom-message");
56+
// message you want to send
57+
textarea.value = `Hey ${name}, Let's connect here on Linkedin :) `;
58+
59+
const sendInvitationBtn = document.querySelector(
60+
"button[aria-label^='Send invitation']"
61+
);
62+
63+
const http = new XMLHttpRequest();
64+
http.open("GET", url);
65+
http.send();
66+
sendInvitationBtn.click();
67+
await sleep(2500);
68+
run();
69+
console.log('Requested + Profile Visited:', i, name, url);
70+
} catch (e) {
71+
console.error(e);
72+
if (profile) {
73+
connect(
74+
profile,
75+
i
76+
);
77+
}
78+
}
79+
}
80+
81+
var connected = [];
82+
var profiles = [];
83+
84+
async function run() {
85+
window.scrollTo(0, document.body.scrollHeight);
86+
await sleep(250);
87+
profiles = document.querySelectorAll("li.search-result"); // to select search results
88+
// to select indivdual profiles
89+
profiles.forEach(profile => {
90+
const connectBtn = document.querySelector(
91+
`#${profile.id} button[aria-label^='Connect']`
92+
);
93+
if (connectBtn === null) {
94+
profile.parentNode.removeChild(profile);
95+
}
96+
});
97+
// to check the last profile or no profiles
98+
if (profiles.length === 0) {
99+
console.log("Next Page >");
100+
const nextPageBtn = document.querySelector("button[aria-label^='Next]");
101+
nextPageBtn.click();
102+
await sleep(3500);
103+
run();
104+
} else {
105+
connect(
106+
profiles[connected.length],
107+
connected.length
108+
);
109+
}
110+
}
111+
112+
run();

Python/Caesar Ciper/Readme.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Caesar Cipher- Cryptography with Python
2+
3+
## Overview:
4+
5+
Caesar Cipher is one of most easiest and simplest encryption methods. It is a stype of substitution cipher.
6+
It works by shifting each character of the input string by a given value down the alphabetical order.
7+
8+
Example: Upon giving a shift key of 2, A would be replaced by C, B by D and so on.
9+
10+
<p align = "center">
11+
<img src="caesar_cipher.jpg" alt="caesar_cipher">
12+
</p>
13+
14+
## Output:
15+
16+
<p align = "left">
17+
<img src="output.jpg" alt="output">
18+
</p>

Python/Caesar Ciper/caesar_ciper.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
''' A python program that implements Caesar Cipher Technique- Cryptography'''
2+
3+
def encryption(string,key): #function definition
4+
''' Function that encrypts the given string using caesar cipher technique
5+
Params: string, key
6+
Returns: encrypted_text
7+
'''
8+
encrypted_text=''
9+
for char in string:
10+
if char=='':
11+
encrypted_text+=char
12+
#Encrypts Empty character
13+
14+
elif char.isupper():
15+
encrypted_text= encrypted_text+ chr((ord(char) + key-65) % 26 + 65)
16+
#Encrypts Upper case character
17+
18+
else:
19+
encrypted_text=encrypted_text+ chr((ord(char) + key-97) % 26 + 97)
20+
#Encrypts lower case character
21+
22+
return encrypted_text
23+
24+
if __name__== "__main__":
25+
string=input('Enter the text to be encrypted:')
26+
key=int(input('Enter the shift key:'))
27+
print('Text before Encryption:',string)
28+
print('Shift Key:',key)
29+
print('Encrypted text:',encryption(string,key)) #function calling
30+
31+
'''
32+
Sample Output:
33+
Enter the text to be encrypted:Alphabets ABCD
34+
Enter the shift key:4
35+
Text before Encryption: Alphabets ABCD
36+
Shift Key: 4
37+
Encrypted text: EptlefixwrEFGH
38+
39+
'''
40+

Python/Caesar Ciper/caesar_cipher.jpg

36.3 KB
Loading

0 commit comments

Comments
 (0)