Skip to content

Instantly share code, notes, and snippets.

@vladak
Last active December 6, 2021 10:07
Show Gist options
  • Save vladak/2f98b9499ea5faa21144b4763e6d4e21 to your computer and use it in GitHub Desktop.
Save vladak/2f98b9499ea5faa21144b4763e6d4e21 to your computer and use it in GitHub Desktop.
Ubuntu notes

Service management

  • temporary: sudo service stop mydesktop
  • permanent: sudo systemctl disable mydesktop

DNS servers debugging

  • get local DNS server address: cat /etc/resolv.conf
  • get list of DNS servers: netplan get all
  • show who is listening on port 53 netstat -peanut (without lsof)
    • usually this is systemd-resolve
  • service systemd-resolved status

Suspend

systemctl suspend

Adding swap space

Needed that to run YourKit Java heap analyzer on a 34 GB heap dump.

from https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-18-04/

sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show

This is temporary, otherwise an entry should go into /etc/fstab.

VPN

sudo apt-get install network-manager-openconnect-gnome

then go to System settings (restart if they are already running), Network, VPN, setup AnyConnect

Install latest git

from https://itsfoss.com/install-git-ubuntu/

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git

Disable IPv6

Handy for misconfigured IPv6 networks (turning off IPv6 via Network UI e.g. for WiFi does not work on Ubuntu 19.10):

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

ip a

Note: this has to be applied whenever interface (such as WiFi) changes/reconnects. To disable it permanently, it has to be put into config file under /etc/sysctl.d/.

Logitech mouse

sudo apt-get install solaar-gnome3 and then launch from applications. Icon will show up in the toolbar.

javadoc

Asked on https://askubuntu.com/questions/834856/how-to-install-only-javadoc?newreg=62db87f72f4846549a894778bbab3357 , answer on https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04 :

sudo apt-get install default-jdk

apt-get proxy

cat << EOF > /etc/apt/apt.conf.d/00proxy
Acquire::http::proxy "http://www-proxy.example.com:80/";
Acquire::ftp::proxy "http://www-proxy.example.com:80/";
Acquire::https::proxy "http://www-proxy.example.com:80/";
EOF

Mount exfat

Needed to get microSD card from Android to mount:

sudo apt-get install exfat-fuse exfat-utils

Change window focus on mouse over

sudo apt-get install unity-tweak-tool

Workspace settings -> Additional -> Focus mode: mouse

LaTeX

sudo apt-get install texlive-full

texlive-latex-base is not enough because it does not contain seminar.sty

Development man pages

per https://www.cyberciti.biz/faq/how-to-add-install-man-pages-on-ubuntu-linux/

For Pthread APIs:

apt-cache search manpages | egrep 'manpages-(dev|posix)'
apt-get install manpages-posix-dev

Packaging

which package delivers given file:

dpkg -S /bin/ls

what files are delivered by (installed) package:

dpkg-query -L <pkg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment