Install ADB & Fastboot on Ubuntu 21.04
sudo apt install android-tools-adb android-tools-fastboot
adb version
adb devices
References
https://www.linuxbabe.com/ubuntu/how-to-install-adb-fastboot-ubuntu
sudo apt install android-tools-adb android-tools-fastboot
adb version
adb devices
References
https://www.linuxbabe.com/ubuntu/how-to-install-adb-fastboot-ubuntu
sudo nmcli networking off sudo nmcli networking on
References
https://itsfoss.com/restart-network-ubuntu/
Flush all routes
sudo ip route flush table main
ip route show
Empty a routing cache
sudo ip route flush cache
sudo ip route show cache
References
https://linoxide.com/how-to-flush-routing-table-from-cache/
var=$(command-name-here) var=$(command-name-here arg1) var=$(/path/to/command) var=$(/path/to/command arg1 arg2)
OR use backticks based syntax as follows to assign output of a Linux command to a variable:
var=`command-name-here` var=`command-name-here arg1` var=`/path/to/command` var=`/path/to/command arg1 arg2`
Examples
## store date command output to $now ## now=$(date)
## alternate syntax ## now=`date`
To display back result (or output stored in a variable called $now) use the echo or printf command:
echo "$now" printf "%s\n" "$now"
References
https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/
echo 'someletters_12345_moreleters.ext' | cut -d'_' -f 2
output
12345
ip route show | grep default | cut -d' ' -f 3
output
178.134.45.216
References
https://stackoverflow.com/questions/428109/extract-substring-in-bash
sudo nano /etc/redis/redis.conf
# requirepass foobared
Uncomment it by removing the #
, and change foobared
to a secure password.
sudo systemctl restart redis.service
References
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-20-04
sudo mysql
-- for MySQL ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; -- for MariaDB ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('root');
With a single query we are changing the auth_plugin
to mysql_native_password
and setting the root password to root and there isn’t any need to restart mysqld or start it with special privileges.
References
https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost
ffmpeg -i filename.mp4 filename.mp3
fixed bit rate :
ffmpeg -i video.mp4 -b:a 192K -vn music.mp3
variable bit rate :
ffmpeg -i in.mp4 -q:a 0 -map a out.mp3
variable bit rate of 165 with libmp3lame encoder :
ffmpeg -vn -sn -dn -i input.mp4 -codec:a libmp3lame -qscale:a 4 output.mp3
References
https://superuser.com/questions/332347/how-can-i-convert-mp4-video-to-mp3-audio-with-ffmpeg
https://superuser.com/questions/1463710/convert-mp4-to-mp3-with-ffmpeg
grep tom /etc/passwd
ignore word case
grep -i "tom" /etc/passwd
References
https://www.howtoforge.com/tutorial/linux-grep-command/
sudo systemctl disable apparmor
References
https://linuxconfig.org/how-to-disable-apparmor-on-ubuntu-20-04-focal-fossa-linux