Skip to content

Instantly share code, notes, and snippets.

@narfel
narfel / ip-address
Created February 13, 2020 20:38
get ipv4 address cli ubuntu server
local:
hostname -I optional with | awk '{print $1}'
ip addr show (ip a)
ifconfig -a
ip route get 1.2.3.4 | awk '{print $7}'
nmcli -p device show
remote:
curl or wget -qO- <host>
hosts:
@narfel
narfel / unattended_updates
Created February 13, 2020 19:11
status of unattended upgrades in ubuntu server
check the timestamp files for the various apt components:
---------------------------------------------------------
ls -l /var/lib/apt/periodic/
check the unattended-upgrades logfile:
--------------------------------------
tail -f /var/log/unattended-upgrades/unattended-upgrades.log
source: https://askubuntu.com/questions/934807/unattended-upgrades-status
@narfel
narfel / apt packages sensor
Created January 26, 2020 07:37
Home Assistant: apt packages sensor
sensor.yaml:
------------
- platform: command_line
name: "Apt Sensor"
command: "ssh -o StrictHostKeyChecking=no <user>@<host> -p 22 -i /config/sshkey/id_rsa /path/to/get_apt.sh"
scan_interval: 43200 #check every 12h
command_timeout: 60
get_apt.sh:
-----------
@narfel
narfel / Get rid of "Call from <number>" context menu entry
Last active January 26, 2020 07:33
Google Chrome: Get rid of the "Call from <number>" context menu entry
disable "Enable click to call feature on desktop when a phone number is selected"
>chrome://flags/#click-to-call-context-menu-selected-text
disable "Enable click to call feature signals to be handled on desktop"
>chrome://flags/#click-to-call-ui
sudo dpkg-reconfigure tzdata
sudo dpkg-reconfigure console-data
sudo dpkg-reconfigure locales -plow
>sudo su
>echo 'datasource_list: [ None ]' | sudo -s tee /etc/cloud/cloud.cfg.d/90_dpkg.cfg
>apt-get purge cloud-init
>rm -rf /etc/cloud/; sudo rm -rf /var/lib/cloud/
>reboot
on systemd system:
hostnamectl set-hostname <new hostname>
logout/reboot
>nano ~/.bashrc
uncomment #force_color_prompt=yes
>source ~/.bashrc
It's been a while since this gist was written. In the meantime the package homeassistant-supervised apt
package was introduced for debian based systems. If you used that way the first thing you should do use
the normal package uninstaller with something like: (sudo) apt remove homeassistant-supervised
If for some reason that doesn't work proceed with the below instructions for a manual cleanup.
1) stop services:
sudo systemctl stop hassio-supervisor.service
sudo systemctl stop hassio-apparmor.service
2) disable services: