In theory it is easy to detect when the user plugs in a USB device to a Linux computer and notify him what was detected. In practice it's still easy as long as you know how to do it. First thing to do is add a file to[bash]/etc/udev/rules.d[/bash] The file name should follow the convention … Continue reading Write the name of a newly connected USB device to the console in Linux
Category: Linux
Create a large file filled with zeros on Linux
Sometimes you need a large file for testing purposes or just to take up space that should not be available on the file system. There are several options on how to generate such a file on Linux: The traditional method is using dd, setting if (in file) to either /dev/null or to /dev/random. A more … Continue reading Create a large file filled with zeros on Linux
etckeeper – version your /etc directory
Keeping track of changes in the Linux configuration can be a chore but sometimes it is vital to know what was changed. As a software developer I am used to using version control systems for source code, so why not use one for configuration files? Enter etckeeper a tool that does exactly that: It tracks … Continue reading etckeeper – version your /etc directory
Deleting old backups
Let's say you have a directory of backups looking like this: .\ \-> user1\ \-> [date1]_[time1] \-> [date2]_[time2] \-> some more sub directories with date and time in the name \-> user2\ \-> [date3]_[time3] \-> [date4]_[time4] \-> some more sub directories with date and time in the name \-> some more user sub directories Where … Continue reading Deleting old backups
Web Proxy Autoconfiguration
Since the last time I looked up how to configure the Web Proxy, apparently somebody came up with WPAD - the Web Proxy Auto-Discovery Protocol (Or maybe I simply missed it). The idea is quite neat: In the dhcp server, add an entry where the browser can request an url which in turn returns the … Continue reading Web Proxy Autoconfiguration
how resolvconf generates /etc/resolv.conf
In olden times, we would add entries for name resolution to /etc/resolv.conf and be done with it. Nowadays, with these newfangled scripts that change the configuration all the time, this file simply gets overwritten by a tool/library called resolvconf, so if we want to add something permanently to it, we must do it somewhere else. … Continue reading how resolvconf generates /etc/resolv.conf
Switching a XenServer VM from HVM to PVM
(Disclaimer: I am by no means an expert with XenServer. So please don’t take anything you read here for granted. It’s my own experience and what I found in documentation and online.) Switching a XenServer Linux VM from hardware assisted virtualization to paravirtualization nowadays is quite simple, since most Linux distributions already come with a … Continue reading Switching a XenServer VM from HVM to PVM
Clone a Linux system without imaging it
When I want to clone a Linux system (or the boot partition/drive of any operating system), I usually use Clonezilla and make a image of the boot disk or boot partition. Unfortunately those image files can become quite large and it is a pain in the lower back to restore them on a smaller hard … Continue reading Clone a Linux system without imaging it
Installing Webmin on Ubuntu 16.04 LTS (Xenial Xerus)
The instructions how to install Webmin on Debian (and thereby also Ubuntu) seem a bit outdated because edits to the file /etc/apt/sources.list should be replaced by adding a file to the directory /etc/apt/sources.list.d/. So, instead of adding deb https://download.webmin.com/download/repository sarge contrib to the file /etc/apt/sources.list create a new file /etc/apt/sources.list.d/webmin.list with that content and possibly … Continue reading Installing Webmin on Ubuntu 16.04 LTS (Xenial Xerus)
Switching a XenServer VM from PVM back to HVM
(Disclaimer: I am by no means an expert with XenServer. So please don’t take anything you read here for granted. It’s my own experience and what I found in documentation and online.) If switching a XenServer Linux VM to paravirtualization fails, you usually end up with a non booting VM which is quite annoying. Switching … Continue reading Switching a XenServer VM from PVM back to HVM