Saturday, July 1, 2023

Using python 3 on mac

 Read more here https://opensource.com/article/19/5/python-3-default-mac

Tuesday, June 27, 2023

SSH returns: no matching host key type found. Their offer: ssh-dss

 Fix is

ssh -oHostKeyAlgorithms=+ssh-dss root@192.168.8.109
Read more here https://askubuntu.com/questions/836048/ssh-returns-no-matching-host-key-type-found-their-offer-ssh-dss 

Wednesday, May 12, 2021

Free up space in ubuntu server

 Clean old kernels

  • Check for kernet is use : uname –r
  • Check for old kernels : dpkg --get-selections | grep linux-image
  • Remove unused kernels : dpkg --get-selections | grep linux-image
Clean APT (Pulled from https://askubuntu.com/questions/5980/how-do-i-free-up-disk-space)
  • To delete downloaded packages (.deb) already installed (and no longer needed)
    • sudo apt-get clean
  • To remove all stored archives in your cache for packages that can not be downloaded anymore (thus packages that are no longer in the repository or that have a newer version in the repository).
    • sudo apt-get autoclean
  • To remove unnecessary packages (After uninstalling an app there could be packages you don't need anymore)
    • sudo apt-get autoremove
Finally, Check Disk Space
  • df -h /

Thursday, August 6, 2020

view largest installed debian packages on unix

More details on this link https://www.commandlinefu.com/commands/view/3842/list-your-largest-installed-packages-on-debianubuntu

dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 10

Tuesday, March 24, 2020

pull multiple files from android via adb

Got answer from https://stackoverflow.com/questions/11074671/adb-pull-multiple-files

adb shell 'ls /sdcard/DCIM/Camera/20200327*.mp4' | tr -d '\r' | xargs -n1 adb pull

Monday, November 20, 2017

get the size of folder contents

du -sh 

Output

15M big_folder
0 dead.letter
4.0K some_file
4.0K some_other_file