How to Create VirtualHost in Tomcat 8

Hi folks,

Today I will discuss how to create a VirtualHost on Tomcat 8. For those who don’t know, Tomcat is a very popular open-source web server for hosting Java web applicationsm. Tomcat implements a bunch of Java EE specifications like Java Servlet, JavaServer Pages (JSP), Websocket and Java EL [1].

Let’s assume you installed Tomcat 8 in /usr/local/apache-tomcat-8.0.30. you want to add a virtual host sweetapp.com. Assume the project folder is at /usr/local/apache-tomcat-8.0.30/webapps/myapp

Open the file /usr/local/apache-tomcat-8.0.30/conf/server.xml
Then add the following lines:

 <Host name="sweetapp.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
 <Alias>www.mydomain.org</Alias>
 
 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
 prefix="sweetapp_access_log" suffix=".txt"
 pattern="%h %l %u %t "%r" %s %b" />
 
 <Context path="" docBase="/usr/local/apache-tomcat-8.0.30/webapps/myapp"
 debug="0" reloadable="true"/>
</Host>

Save and close the file.

Then restart tomcat using the commands:

   /usr/local/apache-tomcat-8.0.30/bin/shutdown.sh
   /usr/local/apache-tomcat-8.0.30/bin/startup.sh 

Sources

Apache Tomcat – Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Apache_Tomcat

How to search for text programmatically in MS Word

Hi folks,

In this article I discuss a quick way to programmatically search for simple text in an MS Word document. It’s really easy, just use grep!

grep <string to search> /path/to/file

It turns out that even though there are a bunch of non-intelligible characters in the file, ordinary text is stored as it is for the most part. Now if you have some special formatting on your text, I can’t guarantee this technique will work. But it’s worth a shot.

How to Mount External Hard Drives on Boot on Ubuntu

Sometimes you want your computer to load external hard drives automatically on boot, e.g. if it gets rebooted accidentally, recovers from power failure, etc. Here’s how to do that on Ubuntu 14.04.

First, create a desired directory for your mount point using a command like:

 mkdir /your/mount/point

Then, while the external hard drive is connected and the computer is on, find the drive’s UUID by running the command

blkid

This will list all block devices, including your external hard drive. Note the UUID and the type of the drive.

Then, open /etc/fstab and add a line like

UUID=<your uuid> /your/mount/point  <your mount point> users,defaults 0 0

Save and close the file, then test it by rebooting and perhaps logging in from another machine via SSH. Your drive should mount automatically!

How to delete multiple bars in MuseScore

When composing sheet music with MuseScore 2, you may discover you have a bunch of unwanted bars, e.g. several empty bars at the bottom of the sheet. Here’s how to delete them.

First, hold Shift key, then drag the cursor across the bars you want to delete. A blue bar should appear as you drag. Once done the bars should be come selected.

Next, on a Mac, press Cmd + Backspace.

On a PC, according to the MuseScore forum [1] you may want to try Ctrl + Delete.

That’s it!

References

1. Deleting Blank Bars | MuseScore. https://musescore.org/en/node/18880 [15/01/2017].

How to create text outline in GIMP

In this article I will discuss how to create text in one colour outlined by text in another colour. This can be useful when adding text to images as it makes the text more readable. I will use GIMP 2.8 for this tutorial.

First, change to the text tool by pressing T and write the text you want to outline.

Then, with Text still selected, highlight the text to outline.

Right-click the text and click Path from Text. This will create a selection from the text’s outline.

Next, create a new layer by clicking the new layer icon in the Layers dialog and give it a suitable name like Text Outline.

Next, click Select > Grow. A Grow dialog will appear. Choose a reasonable scale, e.g. 4 – 5 px or any amount that looks good.

Pick a colour you will like to use for the outline.

Select the bucket tool and fill the selection with the outline colour.

De-select the selection by clicking Select > None or pressing Ctrl + Shift + A.

Finally move the new layer down below the text layer.

Source
==

HOWTO outline text in GIMP – LinuxReviews. http://en.linuxreviews.org/HOWTO_outline_text_in_GIMP

Jazz Rap

Recently I was just exploring various types of music on Youtube. I had heard the name “A Tribe Called Quest” on Kanye West’s track Last Call from College Dropout many years ago. So I decided to listen to some of their music. For those who don’t know, A Tribe Called Quest is an American hip hop group that was formed in 1985, composing MC/producer Q-Tip, MC Phife Dawg aka Phife Diddy (Malik Taylor) and DJ/producer Ali Shaheed Muhammad [1]. Jarobi White, a fourth member, left the group after their first album in 1991. While searching I stumbled on the album Low End Theory and was amazed at what I heard: smooth rap coupled with jazz instrumentals. On browsing similar songs, I came across the name De La Soul. I had also heard this name in the lyrics of a notable rapper but didn’t know who they were. So I did a little research. De La Soul is an American hip hop trio formed in 1987 on Long Island, New York, comprising Posdnuos, Dave and Maseo [2]. Out of curiosity I checked out De La Soul’s album Bulhloone Mindstate and was also thrilled with how it fused rap with rich jazzy instrumentals. It was while researching De La Soul that I came across the subject of this post: Jazz rap.

Jazz rap is a fusion subgenre of hip hop music and jazz, developed in the late 1980s and early 1990s [3]. The lyrics are often based on political consciousness, Afrocentrism and general positivism. It turned out that the music I had been so thrilled about was Jazz rap and coincidentally both A Tribe Called Quest and De La Soul are among the pioneers of the genre together with Digable Planets. Usually jazz rap users hip hop rhythms and then adds repetitive phrases of jazz instrumentation: trumpet, double bass, piano, etc. over it. Since the 1990s, musical jazz references have become less obvious and lyrical references to jazz are less common, however jazz had been added to the palette of hip hop producers. Even up till today you can find that some hip hop musicians add elements of jazz to their music, for example, Kendrick Lamar’s album: To Pimp a Butterfly incorporates jazz, funk and spoken word. I have a feeling I’ll be listening to jazz rap for a while as both jazz and hip hop are two of my favourite genres. It’s amazing to find a subgenre fusing both together. Talk about enjoying the best of both worlds.

Sources

1. A Tribe Called Quest – Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/A_Tribe_Called_Quest.

2. De La Soul – Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/De_La_Soul

3. Jazz rap – Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Jazz_rap