Screen Recording with recordMyDesktop in Ubuntu

One of these days you might need to record your desktop in Ubuntu. Today we are going to record the screen in Ubuntu.

We are going to use recordMyDesktop application. First of all install it using below link.

Click Available of Software Center to install it. You will get below dialog box


Click Launch Application. Then press Install. After finishing install you can run application either using terminal command


or clicking below icon of side pane of Ubuntu


Now we will get the below window window


Before we start Screen recording we need few basic configurations to set. First one is to set where to set the saved screen recorded video. To do that press Save As in the window and browse where you need to save the videos.This is the window you get when you click on save as button on recordmydesktop application

Give appropriate name for your video. This name will use to Recorded videos which comes after unless you change it( name 1, name 2, name 3 …)

Basically Now we are good to go. But before that let me explain about the Select Window button. This is Useful when you want to record part of window, like a dialog box. Generally recordMyDesktop will record the full screen. If you want part of window select Select Window button and select the dialog box you want to record.

Now you are good to go. Just click the Record button. Then do the what you want to record. Now lets check how to generate the recorded video.

If you look top task ban of Ubuntu, you can see there is a Red Square button on left of it.


When you want to stop the recording and get the video press that red square button (Stop Button). Then you will get below window.


Wait till window automatically get close. Then check the place you set to save the video. There you can see your video.


Spring 4 MVC configuring view with controller with java configurations

If you are new to Spring MVC, configuring views with controllers is the first step you have to take into Spring world. There are few ways to configure views, such as xml based, spring boot etc. But today we are going to discuss using java configurations.

As usually we use maven web arch type as our template. ( if you don’t know about maven web arch type template, don’t worry it’s template structure nothing serious.). So if you have installed maven (apt-cache search maven

sudo apt-get install maven)

Then run below command to generate template (FirstDay)

mvn archetype:generate -DgroupId=menuka.hsenid -DartifactId=FirstDay -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Now open project on Intellij ( or your IDE).

Now we have to add dependencies to the project. Since this is just to we just add spring-webmvc to enable Spring MVC (when you add Spring MVC dependency you don’t need to add basic spring dependency like spring-core, spring-context etc. They automatically added to the project ) and javax.servlet-api to handle servlets.



(I hope you know where to put dependencies, if not, in pom.xml file, within < dependencies> tags)

Just one more step before starting development. We have to declare where our source code reside. Create a folder name java inside main folder. Then File -> Project Structure -> Modules  then select the java folder under Sources tab. Now click Sources button under the Sources tab. Then Apply and Ok. 

Now we need to create to packages one for configuration, other one for Controllers.

I use below two packages hsenid.config and hsenid.web

In config package I use Below three classes


package hsenid.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

public class WebConfig extends WebMvcConfigurerAdapter {
public ViewResolver viewResolver(){
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
return resolver;

public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer){

public void addResourceHandlers(final ResourceHandlerRegistry registry) {

There are several things this class do.

One is addResourceHandlers  method set resource path. Because you can’t use paths like you use them in html. Here we use resources folder (which is under webapp folder ) so you can add your images, js, css etc, files under here. (one thin you must remember is when you referring some file in a jsp you must use webapp folder as root folder. )

Other one is resolving jsp page names using viewResolver. Here we declare if we use a url home it is really name is”/WEB-INF/pages/home.jsp”.  Lets create  other two classes


package hsenid.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@Filter(type= FilterType.ANNOTATION, value=EnableWebMvc.class)
public class RootConfig {

Here you must add you base package name for basePackages variable.


package hsenid.config;


public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer{
 protected String[] getServletMappings(){
 return new String[]{"/"};

 protected Class<?>[] getRootConfigClasses(){
 return new Class<?>[]{RootConfig.class};

 protected Class<?>[] getServletConfigClasses(){
 return new Class<?>[]{WebConfig.class};


Now we are configurations are good to go.

Now we have to create view jsp for connect with controllers.

create below jsp pages in the pages folder in the WEB-INF folder (Because this is the path we set in the configurations).


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
This is home


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
This is test

So lets create a controller in hsenid.web folder.


package hsenid.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


public class HomeController {

public String home() {
return "home";

public String test()
return "test";

Now run mvn clean install in terminal (in the location where the pom.xml is) to generate the war file and put the war File in the tomcat webapp folder.

As you can see in the controller, http://localhost:8080/FirstDay/ url is connected with home.jsp and http://localhost:8080/FirstDay/test url is connected with test.jsp.

Well this is simple tutorial to get start with MVC