From 153809b195850f459be5dc32e462bd1fafd6d806 Mon Sep 17 00:00:00 2001 From: aman vsihwakarma Date: Fri, 15 Mar 2024 01:12:06 +0530 Subject: [PATCH 1/3] added ore color codes --- scripts/color | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/color b/scripts/color index d6a4fe8..28a5327 100755 --- a/scripts/color +++ b/scripts/color @@ -9,6 +9,13 @@ color() { declare -A color_mapping=( # TODO: Add more color values # Refer bash color codes + ['black']=30 + ['red']=31 + ['green']=32 + ['yellow']=33 + ['blue']=34 + ['magenta']=35 + ['cyan']=36 ['magenta']=35 ) From 58fb25ff2ea118ca29d95377603596c3fd8024b7 Mon Sep 17 00:00:00 2001 From: aman vsihwakarma Date: Fri, 15 Mar 2024 01:27:00 +0530 Subject: [PATCH 2/3] added code p4 to mp3 conversion --- scripts/music-extract | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/music-extract b/scripts/music-extract index 9659a0b..c38ab10 100644 --- a/scripts/music-extract +++ b/scripts/music-extract @@ -26,3 +26,20 @@ # └── Songs # ├── Song1.mp3 # └── Song2.mp3 + +convert_video_to_audio() { + local file_path="$1" + local output_dir="Music/${file_path%/*}" + mkdir -p "$output_dir" + local output_path="Music/${file_path%.mp4}.mp3" + ffmpeg -i "$file_path" -vn -ar 44100 -ac 2 -b:a 192k "$output_path" +} + +find_To_Convert_Files_From_Video_To_Audio() { + local dir="$1" + find "$dir" -type f -name '*.mp4' -print0 | while IFS= read -r -d '' file; do + convert_video_to_audio "$file" + done +} + +find_To_Convert_Files_From_Video_To_Audio "videos" From 72565011ec9bf300aea9443e4f0ce04dd00555e3 Mon Sep 17 00:00:00 2001 From: aman vsihwakarma Date: Fri, 15 Mar 2024 02:03:30 +0530 Subject: [PATCH 3/3] added code for password generation --- scripts/password-generator | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/password-generator b/scripts/password-generator index f88bbe7..f10492f 100644 --- a/scripts/password-generator +++ b/scripts/password-generator @@ -3,3 +3,8 @@ # Issue: Implement Password Generation Functions # Description: # Create a function that generates passwords, The password should consist of uppercase letters, lowercase letters, numbers, and special characters. The function should take in a single argument, which is the length of the password to generate. The function should return the generated password. + +generate_password(length) { + local password=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*()' | fold -w "$length" | head -n 1) + echo "$password" +} \ No newline at end of file