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 ) 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" 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