It’s quite easy, what you want to do is edit the file /etc/issue and use the special command \4 for the IPv4 address and \6 for the IPv6 address.
If you want you can also specify a specific NIC by using it like \4{enp0s3} for example.
Now everytime you boot, logout from the console etc it will shop the IP address of the server.
Kategoriarkiv: English
Fix ”mosh” locale
When logging in with mobile shell (mosh) sometimes in Ubuntu the locales will mismatch. This is easily fixed by using the following two commands:
# locale-gen "en_US.UTF-8"
# update-locale LC_ALL="en_US.UTF-8"
Substitute the locale for the one you wish to use in both places and then run this. For Swedish locale use sv_SE.UTF-8 as an example.
After cloning a Ubuntu 22.04 server
Many things have changed from the oh so abundant 18.04 server and there are a few surprises that one needs to be aware of. One thing that has changed is that changing the MAC address no longer changes the ID when the server requests a new IP from a DHCP server.
This means that cloning a server into a new server they will start competing for the same IP address if they are on the same network so there are a few things you need to do before you deploy the new close.
Fix the IP address of the clone
- First release the DHCP address the machine has by issuing the command ”dhcpd -r” which should take care of this.
- Change the mac address, if you are using bridged network in particular there should not be two network interfaces on the same segment with the same MAC address. This is done in the virtual machine software.
- Change the machine-id of the clone. This is done by deleting the file /etc/machine-id and then running the script systemd-machine-id-setup which will create a new one.
- Optional: If you would like the system to change the network ID when you change mac address on the NIC then you need to change the following file(s) /etc/netplan/*.yaml and edit this to insert under each of the network interfaces you want to use MAC address as their ID ”dhcp-identifier: mac” then run sudo netplan apply.
Now shutdown the host, change the networking to whatever is needed (bridged most usually) and then restart the system and it should now be assigned a new IP address.
Fix the SSH keys of the clone
Next step is of course to change the cloes SSH keys which is done by deleting the keys in /etc/ssh by issuing the command ”rm /etc/ssh/ssh_host_*” which would delete all of them.
Then regenerate new keys from using the command ”dpkg-reconfigure openssh-server” which will generate all needed keys as if it was fresly installed.
Bevingade ord
The longer this pandemic drags on, the better the technology decisions companies make. This is entirely due to the lack of executive exposure to enterprise software ads in airports.
— Corey Quinn (@QuinnyPig) April 15, 2020
Bind caps lock to something useful
Making the stupid caps lock into something useful is simple. Bind the COMPOSE function to it and have great time writing special characters.
Edit the file /etc/default/keyboard
Find the line for XKBOPTIONS and edit that to read
XKBOPTIONS="compose:caps"
Reboot your system and be happy.
Sleep resume in Ubuntu screws up mouse pad
I found that my Lenovo laptops did not always get the mousepad right when coming out of sleep or hibernate. After a bit of research I found that a modprobe remove and insert of the psmouse kernel module did the trick.
To automatize this you can insert a file in the systemd control structure to fix the problem yourself (if you are experiencing it). Below is a block of code. Save this to a file in /lib/systemd/system-sleep/touchpad
#!/bin/bash # 2019 Täpp-Anders Sikvall # Reinsert kernel module for mouse pad on lenovo after waking up # from a sleep or a suspend so that things like gestures work # properly # bugs to anders@sikvall.se case "$1" in pre) exit 0 # Do nothing just return ;; post) sleep 3 # Wait for system to stabilize modprobe -r psmouse # Remove psmouse from kernel modprobe psmouse # Reinsert psmouse to kernel exit 0 # Return no error ;; *) exit 1 # Normally we should not be here ;; # but if we are, return error esac
The Cat ”Pixel”

Commodore PET transporteras till Hannovermässan

Ubuntu Linux kernel 4.0.15-29 diasbles keyboard on Lenovo T420s
Recent update to one of my laptops made the keyboard completely stop working. While rebooting to the previous kernels made it work again.
The kernel that’s the culprit is the generic kernel 4.0.15-29 which does not even work in recovery mode. I have disabled this kernel on my system but could not find information out there about others with similar symptoms so I am writing this here in order to quickly get something out.
Getting Teamviewer to work on Ubuntu 16.10
Teamviwer relies on a bunch of 32 bit dependencies you need to enable for it to install. This procedure should work:
sudo dpkg --add-architecture i386 sudo apt-get update wget http://download.teamviewer.com/download/teamviewer_i386.deb sudo dpkg -i --force-depends teamviewer_i386.deb sudo apt-get install -f sudo teamviewer --daemon start
I always suggest you take a snapshot before if your file system supports this just in case.