Browsed by
Category: Admin

Installing LXC with Libvirt and Dnsmasq in Debian

Installing LXC with Libvirt and Dnsmasq in Debian

  1. Configure a domain mapping for your new container in dnsmasq (/etc/dnsmasq.d/<vmname>.conf)
    local=/<domain>/
    address=/<domain>/192.168.122.2
  2. Install lxc and libvirt
    apt-get update
    apt-get install lxc libvirt-bin
  3. Create a container
    lxc-create -n vm1 -t debian — -r jessie
    # note the password given to the new root user
  4. Start the virtual machine
    lxc-start -n vm1
  5. At the login promt login as root and enter the password of the new root user
  6. Change the root password
  7. Create a user and install sudo
    apt-get install sudo
    adduser <you-user> sudo
    # remember the password you gave here
  8. Edit the networking section in /var/lib/lxc/vm1/config to look like this:
    lxc.network.type = veth
    lxc.network.flags = up
    lxc.network.link = virbr0
    lxc.network.hwaddr = 00:FF:AA:00:00:01
    lxc.network.ipv4 = 192.168.122.2/24
    # You might need to change the IP.
  9. Start the libvirt network:
    virsh net-start default
  10. SSH to the VM:
    ssh <your-user>@<domain>
  11. Have fun…
  12. For shutdown try:
    halt; poweroff
Shell Script To Create Self Signed SSL-Certificates In Various Formats

Shell Script To Create Self Signed SSL-Certificates In Various Formats

Shell Menues

Shell Menues

Here is a python class to create such shell menues:

shell-menues

Use it like that:

The output and thus the returned values will be something like:

Github page

Find Files Changed Within The Last X Days, Recursive

Find Files Changed Within The Last X Days, Recursive

You can find files that have been changed within the last X days like this:

Just replace the X with the number of days.

To pack these files right here do a:

This is especially useful if you’ve reset the timestamps before beginning to change something like this: