Posts for: #Ubuntu

Format USB drive after installing Debian from it

If you have used an USB drive to write iso images to before installing Debian or recent versions of Ubuntu, here are the steps to reclaim it after installation is over.

  1. Open a terminal and list the available device names using the following command:
    lsblk

    which should show you an output like the one below:

  2. Identify the device name of your USB drive. Extreme caution should be taken while at it because wrong device names can potentially wipe your entire hard disk. In this case, the USB drive that we want to format is sdb.
  3. Writing the iso image to the USB drive has made it a read-only device. To change it back, the partition table needs to broken. Issue the below command after replacing sdb with the device name identified in the previous step:
    sudo dd if=/dev/zero of=/dev/sdb bs=1M && sync

    This step might take some time to complete depending upon the size of the USB drive. So be patient. When it is over, you should see an output like the below:

[Read more]

VLC Player not playing nice with Radeon?

If you are on Ubuntu 16.04 using radeon open source driver for your graphics card and having issues with playing mp4 or mkv files with VLC media player then read on. If you are not sure what graphics driver is in use in your system, paste the below line in Terminal.

lspci -v -s lspci | awk '/VGA/{print $1}'

And check for the below line in the output:

Kernel driver in use: radeon<br />

The issue occurs as soon as you open a media file of type mkv or mp4 with VLC media player. Immediately after opening, it crashes silently. But if you check the /var/log/syslog, you should be able to see segmentation fault messages.

[Read more]

Accessing Mysql database installed in an LXD container

This is my second post on LXD containers. Sometimes, using a container is a cleaner way to install and use applications for a number of reasons:

  • You can install packages from any version of any distribution. That means, even if you are using an LTS release of Ubuntu like me, you don't necessarily have to stick to an older version of a package. Or if some package is only supported on rpm based distributions, you don't need to worry about it.
  • You can go ahead and completely uninstall/reinstall it at any time without worrying about residual files or configurations.
  • You can roll back to a previous state in no time if something goes wrong unexpectedly (lxd snapshots!)
  • And then there is the security perspective also (lxd containers are secure by nature).

Last weekend I tried running mysql database from a local container and connect to it from my local system. Here's how:

[Read more]

LXD Containers - First Experience

Lately I have been playing around with LXD containers and I must say that I am quite impressed with it. LXD is the virtualization technology that can be used to run a Linux container on a Linux host using the same kernel as the host.

Well, it's a little difficult to grab the idea at first. Unless of course you interacted with it before. You can think of it as a virtual machine that you run using VirtualBox or VMWare on your Linux or Windows host machine but the difference is that when you run a virtual machine, you are running a separate kernel inside the virtual machine but in this case, you are fooling the guest OS running inside the LXD container into thinking that it's running its own kernel whereas it's just using the same kernel running on the host OS. And the result is that you get an isolated container with a much smaller memory footprint and little overhead compared to a full blown virtual machine.

[Read more]

Automated Package Installation and Configuration Script for Ubuntu

In my last post, I discussed about how I created my first Amazon EC2 instance and ran our Java web server on it. One of the most important things that I have realized over the years is that if you work with a small group of developers, you ought to think about automating certain jobs like testing, deployment, setting up server etc. So that you can concentrate on the real work rather than spending valuable time in doing repetitive tasks. The benefit against spending extra time in writing scripts may not be prominent at first, but over time you will realize the gain in terms of person hours and headaches saved because of the automated scripts.

[Read more]