Posts with the tag linux:

Linux Laptop Boot Battery Optimizations

Boot Optimization use sudo systemd-analyze critical-chain to get the most time consuming services. If you don’t need those services just disable them by this command sudo systemctl disable service-name.service and replace the service-name with the name of the service you want to disable. BIOS Optimization Just disable any feature you do not use such as fingerprint scanner. To reboot into your BIOS settings, use this command sudo systemctl reboot --firmware-setup. Battery Optimization Use tlp to manage your battery, and use powertop to get the power consumption statistics. Install tlp and powertop using this command sudo apt install tlp powertop. To enable tlp to manage your laptop battery, run this command in terminal sudo systemctl enable tlp.

How to Create Bash Function ?

First step: create a utilities.sh file to add all your bash functions in it. 2nd step: add your bash function/s like this. ## utilities.sh convertMP4toMP3(){ echo -n "Enter source mp4 file : " read sourceFile echo -n "Enter destination mp3 file : " read destFile avconv -i $sourceFile -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 $destFile } I created a bash function to convert mp4 video file to mp3 audio file from command line. 3rd step: source the utilities.sh Bash file source utilities.sh Finally, you can call the function from the command line (terminal) and use it like this.

Convert Mp4 to Mp3 in Linux Terminal

First things first, install the required software packages. sudo apt-get install ffmpeg && sudo apt-get install libavcodec-extra-53 Then use it. For FFmpeg with Constant Bitrate Encoding (CBR) ffmpeg -i video.mp4 -vn \ -acodec libmp3lame -ac 2 -ab 160k -ar 48000 \ audio.mp3 or if you want to use Variable Bitrate Encoding (VBR) ffmpeg -i video.mp4 -vn \ -acodec libmp3lame -ac 2 -qscale:a 4 -ar 48000 \ audio.mp3 If it says ffmpeg is depricated use this command instead. avconv -i video.mp4 -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 audio.mp3 The meaning of arguments argv meaning -i input file name -vn disable video recording -acodec force audio codec to libmp3lame -ac set the number of audio channels -ar set the audio sampling frequency I hope this helps.

Fix Login Loop Ubuntu Linux

If you stuck in the login screen and can’t load the Ubuntu desktop, follow those steps. when you on the login screen, press ctrl + shift + alt + f1. A black screen appeared? No? Just the login page? So try ctrl + shift + alt + f2. Still the login screen? try ctrl + shift + alt + f3. If the login screen still showing? Try to use another external keyboard. a black screen appeared? ok, type your username then ENTER and type your password then ENTER. type ping 8.8.8.8 then ENTER to ensure you have a good Internet connection.

How to Use Systemd to Keep Programs Running ?

Systemd manages these services in unit files like this. [Unit] Description=Some Really Important Service [Service] Type=simple WorkingDirectory=/root ExecStart=/root/my_program.sh [Install] WantedBy=multi-user.target The program that will start is. #!/usr/bin/env bash while true; do echo 'service is working' sleep 3 done If you don’t want to use this line #!/usr/bin/env bash, then you should make sure to specify what is the program is dedicated to execute the script like this. ExecStart=/bin/bash /root/my_program.sh If you want to execute this service, you should store it in /etc/systemd/system/. You can copy the unit file to that directory, or symlink it. Now you can start or stop or enable or disable the service.

Things To Do After Installing elementary OS Hera (5.1)

Enable PPA sudo apt update sudo apt install software-properties-common Install apt-fast sudo add-apt-repository -y ppa:apt-fast/stable sudo apt -y install apt-fast echo "alias apt='apt-fast'" >> ~/.bashrc source ~/.bashrc Update OS apt update && apt upgrade Install git apt install git Uninstall Apps If you do not like epiphany browser - like me, just run this command. apt purge epiphany-browser epiphany-browser-data If you don’t use the pantheon mail app - like me, just run this command to uninstall it. apt purge pantheon-mail Again, if you don’t use the music app shipped with elementary OS which is called noise, just uninstall it like that.

How to Install Gnome Shell Extensions from ZIP File using command line

First check your gnome version: $ gnome-shell --version GNOME shell 3.36.4 Then go to location where your downloaded ZIP file, for me its Downloads directory. cd ~/Downloads/ Get the extension UUID from metadata.json by this command. $ unzip -c dash-to-dock-micxgx.gmail.com.v68.shell-extension.zip metadata.json | grep uuid | cut -d \" -f4 dash-to-dock@micxgx.gmail.com Or simply open metadata.json file and copy the UUID value. For me it is dash-to-dock@micxgx.gmail.com. Create destination directory for the gnome extension. $ mkdir -p ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com Unzip gnome extension file into the directory we made in the previous step, using this command. $ unzip -q dash-to-dock-micxgx.gmail.com.v68.shell-extension.zip -d ~/.