Saturday, May 28, 2011

Installing Windows Fonts on Ubuntu Linux

There are three (3) ways to install Windows fonts on Ubuntu Linux. I have tested the following procedure under Ubuntu 10.10 Linux distribution but my guess is it should also work on other Linux distributions as well.

Way No. 1

(1) Access the Linux terminal by accessing the menu, Applications->Accessories->Terminal
(2) On the terminal, you have to be user "root" to install the package. To become "root", issue the command:

$ sudo su

This will prompt you for your password. Type in your password. If you are "root", the prompt should change from $ to #.

(3) To download and install the Windows fonts, type the command:

# apt-get install ttf-mscorefonts-installer

(4) To load the fonts, type the command:

# fc-cache -f -v


I am assuming that your computer is connected to the Internet and therefore by issuing the above-mentioned commands, installation of the fonts becomes trivial. As far as I know, you can also use the "Ubuntu Software Center" (click Applications->Ubuntu Software Center) and look for the MS True Type Fonts package.

If you are curious as to where the fonts are located, Ubuntu Linux copies the fonts to the directory "/usr/share/fonts". This directory is only accessible to the "root" user.


Way No. 2

In way 2, we will be installing fonts by manually copying the Windows fonts files and pasting it in the Ubuntu Linux directory.

(1) Copy the Windows fonts in your computer and place it in a transferable media such as a USB stick or CD.
(2) On the Ubuntu Linux computer, access the default home directory by going to "Places->Home Folder". On the home folder, check the "Show Hidden Files" on the "View" menu.
(3) Create the folder ".fonts". Yes, the folder got a dot before the word fonts. On Linux, folders with beginning dots means hidden folders.
(4) Copy the Windows fonts to the ".fonts" folder.
(5) Load the fonts by issuing the command:

$ fc-cache -f -v

As you can see, you don't need to be a "root" user to do this procedure. The fonts however will only be applied to the current user but not system wide unlike Way 1 procedure.


Way No. 3

In way 3, the procedure involves making the fonts available system-wide.

(1) On the terminal, become "root" by issuing the command:

$ sudo su

(2) Access the file manager in root mode by issuing the command:

# nautilus&

The file manager is called nautilus. The & makes the program independent of the terminal where it is run.

(3) Since you are already on the graphical file manager as "root", copy the Windows fonts to the Ubuntu Linux directory "/usr/share/fonts". I suggest creating a separate folder under this like "msttcorefonts".

(4) Load the fonts by issuing the command in the terminal:

# fc-cache -f -v


Other fonts can also be installed on Linux by following way 2 and 3 procedure above.

By the way, if you are concerned about licensing, the Microsoft Core fonts I have mentioned above can be redistributed freely as depicted in its license terms.

Thursday, August 12, 2010

Formula for the Intercept and Slope

Given a two (2) variable equation of a straight line, the formula for the slope is:

Slope (b) = S xy / S x^2

where:
S = summation
x = X minus the Mean of X
y = Y minus the Mean of Y


The formula for the intercept at its point of origin is:

Intercept (a) = M Y - b (M X)

where:
M = arithmetic mean
M Y = Mean of Y
b = Slope
M X = Mean of X

Monday, June 14, 2010

Getting the Square Root and Cube Root

The OpenOffice Calc spreadsheet formula for square root is:

= sqrt ( A )

Where A = data

This can also be reformulated as:

= A^(1/2)

This reformulation is versatile as it can be extended to handle cube roots as follows:

= A^(1/3)

Harmonic Mean

The Harmonic Mean formula is:

HM = 1.5 / (0.5/A + 0.5/B + 0.5/C )

Where: A, B, and C = sample data
0.5 is the assigned weight for each sample
1.5 is the total assigned weight for all samples

Given only two samples, the formula becomes:

HM = 1 / ( 0.5/A + 0.5/B )

The manual calculation of Harmonic Mean becomes tedious as the number of samples increases.

OpenOffice Calc spreadsheet uses the following formula in calculating for the Harmonic Mean:

= harmean ( range of cells of the sample data )

Geometric Mean Formula

The geometric mean formula is:

GM = ( A * B * C ) ^ (1 / n )

Where: A, B, and C = sample data
n = is the number of samples, in this case 3

If there are only 2 sample data, the formula becomes:

GM = ( A * B ) ^ (1/2)

The calculation of the Geometric Mean becomes tedious as soon as the number of samples increases. Fortunately, modern spreadsheets can easily calculate this measure of central tendency. The OpenOffice formula for the Geometric Mean is:

=geomean( range of cells of the sample data )

Friday, October 2, 2009

What is omserv running on port 764?

There is not much information on omserv running on port 764. By doing trial and error and using the lsof command, I found that omserv is actually nfslock. If you want to turn off this service (I surely do, since I don't know and use this service), issue the command:

chkconfig --levels 2345 nfslock off

This will remove the autoexecute of the nfslock. Afterwards, issue the command to stop the process:

/etc/rc.d/init.d/nfslock stop

To verify if you have stopped the service, type the command:

nmap localhost

Monday, August 3, 2009

Installing Squid as a Service

To install the Squid Proxy Cache Server as a service under Windows, issue the command:

c:\squid\sbin\>squid.exe -f c:\squid\etc\squid.conf -i -n Squid

The name of the service is "Squid". To verify, type the command "services.msc" and look up the name of "Squid" under the name services column.