Cleanup Docker Trash

Over time, docker images and residual unneeded files pile up and take a lot of space.

We need to cleanup the following:

  • stopped containers
  • networks not used by at least one container
  • dangling images
  • build cache

To do that, just run:

docker system prune

It might take some time.

Enjoy a clean environment!

Sample:

WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all build cache
Are you sure you want to continue? [y/N] y
Deleted Containers:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Deleted Images:
untagged: xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx
deleted: sha256:xxxxxxxxxxx

Total reclaimed space: 17.89GB

Source:

https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes

Posted in docker, Linux | Tagged , , , | Leave a comment

Flush the DNS cache on Ubuntu 18.04

sudo systemd-resolve --flush-caches

Source:

https://askubuntu.com/questions/906476/how-can-i-flush-the-dns-on-ubuntu-17-04

Posted in Linux | Tagged , , , , | Leave a comment

How to check packages support status for Ubuntu 18.04

To know which packages are supported and which are not, for how long and whether the community or canonical are the ones who support it, just run:

ubuntu-support-status

It will give you this sample output:

Support status summary of '$HOSTNAME':

You have 211 packages (15.4%) supported until April 2021 (Community - 3y)
You have 1431 packages (74.0%) supported until April 2023 (Canonical - 5y)
You have 2 packages (0.1%) supported until April 2021 (Canonical - 3y)
You have 2 packages (0.1%) supported until January 2019 (Community - 9m)

You have 24 packages (0.9%) that can not/no-longer be downloaded
You have 254 packages (9.5%) that are unsupported


Run with --show-unsupported, --show-supported or --show-all to see more details

To get more detailed info, add –show-unsupported, –show-supported or –show-all. You could of course use grep to help in filtering.

Posted in Linux | Tagged , , , , | Leave a comment

Create SSH profiles for your frequent connections on Ubuntu 18.04 using ssh_config

This is very useful if you connect to tons of servers via ssh and you need to keep record of them as profiles.

  • Edit/Create a file .ssh/config
  • Add entries in this manner:
Host blabla
User blablabla # or domain\blablabla if it's a domain user
HostName x.x.x.x

Host blabla2
User blablabla2
HostName x2.x2.x2.x2
  • Then all you need to do to connect to any of these specific connections using these specific users is to:
ssh blabla #To connect to server blabla with user blablabla

or

ssh blabla2 #To connect to server blabla2 with user blablabla2

For more info like advanced customization and features like using ssh keys, you can get help from the manual:

man ssh_config

Source:

https://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/

Posted in Linux | Tagged , , , , , | Leave a comment

Start Slack Minimized on Ubuntu 18.04

It might seem silly, but I just hate having to see the Slack Connection window every time I start my computer. I just wanted it to start minimized, no big deal!

To start it minimized, just append -u to the command, e.g.

slack -u

screenshot

Enjoy!

Posted in Linux, Ubuntu | Tagged , , | Leave a comment

Add a custom resolution to your display using xrandr on Ubuntu 18.04

Just in case your monitor’s supported resolution is not properly detected or if you want a custom resolution to be used:

In this example, we will try to add 1368×768, with a refresh rate of 60

Run cvt to get the parameters of that resolution on your monitor (if it is supported):

cvt 1368 768 60

It gives you an output like the following

# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
Modeline "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync

Copy the text starting from the double quotes till the end of the full output and add it to the xrandr command to create a new mode, as follows:

xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync 
+vsync

Finally we add that mode to the existing list, using the line in double quotes in the previous output:

xrandr --addmode eDP-1 "1368x768_60.00"

To apply that resolution via command line:

xrandr --output HDMI-1 --mode 1366x768 --rate 60

Where HDMI-1 is the screen output you want to apply on. To know the names you have available and connected, just run the command:

xrandr --query

In my situation, I have the following ones connected DP-1, eDP-1 while HDMI-1, HDMI-2 and DP-2 as disconnected (not hooked to a screen).

To make that persistent, please follow the first link in the sources section.

Enjoy!

Sources:

Posted in Linux | Tagged , , , , | Leave a comment

Force remove an entry from Ubuntu Online Accounts

I was trying to delete an entry in my online accounts (since I restored Ubuntu 18.04 files over 17.10), and it wasn’t getting deleted.

The solution is to edit the following file:

~/.config/goa-1.0/accounts.conf

Then simply remove the entry you wish to delete.

Open Online Accounts again, and it’s gone!

Enjoy!

Source:

https://bugs.launchpad.net/ubuntu/+source/gcr/+bug/1044549/comments/14

Posted in Linux | Tagged , , | Leave a comment