Restarting ALSA Audio


Follow these steps:

sudo /etc/init.d/alsa-utils stop
sudo alsa force-reload
sudo /etc/init.d/alsa-utils start

When I was running openSUSE  11.1 in previous decade, sometimes the ALSA sound diver throws an error while playing some video with VLC media player. The solution was, just to restart the ALSA sound driver by running the following command as super-user:

/etc/init.d/alsasound restart
Advertisements

Virtual Box boot from USB


You may want to do this for a number of reasons, you may have a bootable USB thumb-drive / USB flash drive / USB stick (whatever you call it) containing Live CD, installation image etc. before you actually use it on your computer, or may be you don’t want to use that bootable USB on your computer, whatever that case might be.

Linux

Following are the 3 different methods you could use.

Method # 1: Create a pointer to your USB

I am using Ubuntu 18.04 LTS, but it could be any Linux OS/distro/flavor. If you have a bootable USB that you want to boot your VM from, go ahead and insert it.

First you need to find the logical device for your removable USB flash drive. One way to do it is to use lshw command (ls for hardware, get it?) It is recommended that you run this command as a super-user (sudo) otherwise “your output may be incomplete or inaccurate, you should run this program as super-user” warning would be displayed, which makes sense. If you need more information on lshw, including installation and basic usage, see this project website or this article.

Here is the raw command which shots of how KDE used to look like back in the day, in openSUSE 11.1 – this was the first ever Linux distro which got me hooked with Linux. To put things in perspective, openSUSE’s current version is 15.0 😉 will output EVERYTHING:

# "sudo lshw" shows everything
$ sudo lshw -class volume -disable TEST -notime

And look for the entry associated with your hard drive’s label. Alternatively, following commands much more concise if you know what you are looking for:

$ sudo lshw -businfo -disable TEST | grep volume

In my case, from the first command above, it was /dev/sdb1.

Next, Continue reading “Virtual Box boot from USB”

Best VS Code ext & themes


Extensions:

Themes:

I am generally High Contrast kind of guy, who prefers the same for OS theme as well (just me) … but I might be a little bit inclined towards dark themes:

After high contrast, I prefer Phœnix Dark in particular for dark theme and GitHub Plus Theme for light theme. Themes like Popping and Locking Theme, Dracula Official overwhelm me with their colors.

[4/4] Docker: Front-end development w/ Java, SpringBoot MVC & RESTful Web API


Today we are going to talk about adding front end user interface to our application, from scratch. We can add the front end to our application using something called view resolvers. Our options are Apache Tiles, JavaServer Pages (JSP), etc. there are many other options, as well. Spring Boot supports FreeMarker templates, Groovy Templates and Themyleaf via “AutoConfiguration”, as the first class citizens. As the name suggests, we should not need to do a whole lot to get going with one of these. In this video we would be looking at Thymeleaf. I find it easy to use and feature rich at the same time. Thymeleaf is mostly HTML. Finally, we will talk about Web JARs & How to add Branding to our web application, using responsive web design. Continue reading “[4/4] Docker: Front-end development w/ Java, SpringBoot MVC & RESTful Web API”

SpringBoot: Debug faster


Tired of rebuilding your Spring Boot web application every time you change your HTML markup or Java class? Thanks to IntelliJ IDEA and SpringBoot DevTools, you can easily code and debug faster without wasting time rebuilding your application over and over again. The solution discussed here would run your project as soon as your code change, and it would refresh your Thymeleaf HTML templates for the front end without even having to rebuild the project.

The actual work required to configure your project is not much. All, in all, you need to Continue reading “SpringBoot: Debug faster”

AngularJS Tools


According to a sendesignz.com post

[3/4] Docker: SpringBoot, Hibernate & Web API


In previous episodes (Part1, Part2) we saw how to create Java Maven project from scratch using SpringBoot – followed by how to deploy the application to docker and then I also demonstrated how can you set up MySQL database server, with automated initialization of a fresh database instance.

Now, let’s see how to set up RESTful Web API to display data from database using Hibernate ORM. We’ll also see how to set up a local development environment and docker deployment environment to quickly switch between the two, and establish an efficient work-flow for your project. Next, we’d set up our project to perform CRUD operations using Hibernate. And finally, we will create our Web API endpoints which can serve the requests made from the browser, in JSON format.

Let’s Continue reading “[3/4] Docker: SpringBoot, Hibernate & Web API”

[2/4] Docker: Setting up MySQL


Previously, in this series we talked about getting started with docker and performing some elementary operations. In this episode, we’d dive deeper into docker, and then we’d swing by some of the commands you could use to follow along, and perform some common tasks in a terminal window.

Docker command line: Getting started

If you were to run a following command, you can see all containers, including the ones which are stopped, using the following command:

$ docker container ls -a

With following command, you can see all docker images:

$ docker image ls -a

As you can probably tell, this command is almost identical to the command to list (ls) all (-a).
Following are the equivalent commands to the two commands we saw above, respectively:

$ docker ps -a $ docker images -a

Let’s say you want to, download (pull) a docker image, say MySQL, in advance. It is just like cloning a repository from GitHub:

$ docker pull mysql

If no tag is specified, then :latest tag is assumed by default. Now to run this newly downloaded image, you can possibly run the following command:

Running the container:

$ docker run \
  -d
  -e MYSQL_ROOT_PASSWORD=p4$$W0rd \
  -e MYSQL_DATABASE=epidemics \
  -e MYSQL_USER=epidemics \
  -e MYSQL_PASSWORD=epidemics \
  -p 3306:3306 \
  --name mysql \
  --mount type=bind,source=/abs_path/,target=/docker-entrypoint-initdb.d \
 mysql

Continue reading “[2/4] Docker: Setting up MySQL”