master
Kar op1 2024-04-08 21:50:34 +05:30
commit bcef4c193b
4 changed files with 466649 additions and 0 deletions

29
md5_adder_numbers.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# Define database connection variables
db_host="192.168.0.114"
db_user="u2"
db_pass="pass"
db_name="u2_md5"
db_table="md5_numbers"
# Function to calculate MD5 hash
calculate_md5() {
echo -n "$1" | md5sum | awk '{print $1}'
}
# Function to insert values into the database
insert_into_database() {
local number=$1
local md5=$(calculate_md5 "$number")
mysql -h "$db_host" -u "$db_user" -p"$db_pass" "$db_name" -e "INSERT INTO $db_table (value, md5) VALUES ($number, '$md5');"
}
# Loop from 1 to 10000000 and insert values into the database
for (( i=13337; i<=10000000; i++ )); do
insert_into_database "$i"
# echo "Inserted value $i into database."
done
echo "All values inserted into database."

32
md5_adder_word.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# Define database connection variables
db_host="your_db_host"
db_user="your_db_user"
db_pass="your_db_password"
db_name="your_db_name"
db_table="your_db_table"
# Define path to dictionary file
dictionary_file="path_to_your_dictionary_file"
# Check if dictionary file exists
if [ ! -f "$dictionary_file" ]; then
echo "Dictionary file not found."
exit 1
fi
# Function to insert word into the database
insert_into_database() {
local word="$1"
mysql -h "$db_host" -u "$db_user" -p"$db_pass" "$db_name" -e "INSERT INTO $db_table (word) VALUES ('$word');"
}
# Loop through each word in the dictionary and insert it into the database
while read -r word; do
insert_into_database "$word"
echo "Inserted word $word into database."
done < "$dictionary_file"
echo "All words inserted into database."

38
md5_adder_word_combination.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
# Define database connection variables
db_host="your_db_host"
db_user="your_db_user"
db_pass="your_db_password"
db_name="your_db_name"
db_table="your_db_table"
# Define path to dictionary file
dictionary_file="path_to_your_dictionary_file"
# Check if dictionary file exists
if [ ! -f "$dictionary_file" ]; then
echo "Dictionary file not found."
exit 1
fi
# Function to insert combination into the database
insert_into_database() {
local combined_word="$1"
mysql -h "$db_host" -u "$db_user" -p"$db_pass" "$db_name" -e "INSERT INTO $db_table (combined_word) VALUES ('$combined_word');"
}
# Loop through each word in the dictionary
while read -r word1; do
while read -r word2; do
# Concatenate the two words
combined_word="$word1$word2"
# Insert the combined word into the database
insert_into_database "$combined_word"
echo "Inserted combination $combined_word into database."
done < "$dictionary_file"
done < "$dictionary_file"
echo "All combinations inserted into database."

466550
words.txt Normal file

File diff suppressed because it is too large Load Diff