Zhixian's Tech Blog

2015-10-23

Setup Ubuntu (Trusty Tahr) for development

Filed under: development, ubuntu — Tags: , , , , — Zhixian @ 11:18:10 am

This blog post is on my setting up another Ubuntu Server VM.
This time I want a VM that has the common software development applications pre-installed.
As such most of the steps are similar to what I did in a previous blog post.
So on this blog post, I will start from the screen where I can select pre-packaged software.

image

Although, I was not really sure I really need the DNS server and print server, I thought “Ah well. Might as well.”
So they are included.

Setup MySql

First thing to setup is to assign a password for MySql server “root” account.
Note: You may have notice that background color have changed from purple to blue.
This was because I typed the wrong confirmation password when setting the password.

image

 

image

Setup E-mail

 

image

 

image

 

image

 

image

2015-01-05

Install nunit on Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 23:34:01 pm

To install nunit on Ubuntu, start a terminal session and execute the following command:

sudo apt-get install nunit nunit-console nunit-gui

zhixian@SARA: ~_200

After installation has complete, you can run nunit by executing the following command in the terminal session:

nunit-gui

for the user-friendly graphical interface or alternatively,

nunit-console

for the nunit console.

2015-01-04

How to install xsp4 onto Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 09:14:01 am

I just realise that the mono-complete does not include the xsp4 package.
This package is needed if you intend to debug web applications using MonoDevelop.

sudo apt-get install mono-xsp4

zhixian@SARA: ~_196

After the installation process has complete, you may see a message stating that you have an incomplete debian.webapp.

zhixian@SARA: ~_199

To remedy this, install asp.net-examples by running the below command:

sudo apt-get install asp.net-examples

zhixian@SARA: ~_198

2015-01-03

Installing Postgresql using installer from EnterpriseDB on Ubuntu

Filed under: computing — Tags: , , , , , , , — Zhixian @ 17:23:01 pm

This blog post describes installing Postgresql 9.4 and pgAdmin III 1.20.0 using the installer provided by EnterpriseDB.

Background (Or lessons learnt)

I recently installed a copy of Postgresql on Ubuntu based on instructions from the official web site (http://www.postgresql.org/download/linux/ubuntu/).
Unfortunately, the copy of pgAdmin III (a graphical UI to manage Postgresql databases) is outdated.
The version of Postgresql installed was 9.4 but the version of pgAdmin installed was 1.18.1 which has warnings issued when I connect to the database.

pgAdmin III_168

So I decide to do the next best thing mentioned in the page – use the installer from EnterpriseDB in hopes that they have packaged the latest copy of pgAdmin III.

PostgreSQL: Linux downloads (Ubuntu) - Google Chrome_171

Assumptions

I assumed you know how to start a terminal session and execute commands in it.

Summary of Steps

  1. Download Installer
  2. Making Installer executable
  3. Execute the Installer

Download Installer

Clicking the download link in the previous screen shot will bring me to the EnterpriseDB’s Postgresql install download page (http://www.enterprisedb.com/products-services-training/pgdownload).

Because I’m running the 64-bit version of Ubuntu, I clicked on the “Linux x86-64” button to download the installer.

Download PostgreSQL | EnterpriseDB - Google Chrome_172

After you clicked the button, you will be brought to a thank-you page.
Wait for the download to complete.

Thank you for downloading PostgreSQL! | EnterpriseDB - Google Chrome_173

After the download has complete, your download folder should look like the below.

Downloads_174

Making Installer executable

By default, the downloaded file is not executable by double-clicking it.
Attempts to do so, will result in the below dialog:

Untitled window_175

Click on the No button to close the dialog.

To make the downloaded file executable:

1. Start a terminal session and navigate to folder where you saved the downloaded installer.

zhixian@SARA: ~-Downloads_176

2. Run the following command. Replace the text in bold if necessary if you are not using Ubuntu 64-bit.

chmod +x ./postgresql-9.4.0-1-linux-x64.run

zhixian@SARA: ~-Downloads_177

Execute the installer

Now you can execute the installer. From the terminal session, run the following command start the installation wizard:

sudo ./postgresql-9.4.0-1-linux-x64.run

zhixian@SARA: ~-Downloads_180

You will see the welcome screen of the installation wizard.
Click on Next button to proceed to the next step of the installation wizard.

Setup (as superuser)_181

The installation wizard should prompt you for the location to install Postgresql.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_182

The installation wizard will now prompt you for the directory to store data for Postgresql.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_183

The installation wizard will now prompt you for a password to the postgres account.
This account is use for starting Postgresql.
Enter your desired password for this account.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_184

The installation process will then prompt you for a port number that Postgresql will use to host the database server.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Note The default port that Postgresql use is 5432. However, this port is all in used by the first instance of Postgresql that I installed previously the installation wizard picked the next available port 5433. I accepted the defaults in the screen shot below planning to uninstall the first instance of Postgres and then reconfigure this instance of Postgresql to use port 5432.

Setup (as superuser)_185

The installation wizard will now prompt you for the locale that your database will use.
Click on Next button to accept the default and proceed to the next step of the installation wizard.

Setup (as superuser)_186

The installation will now declare that it has all the information need to install Postgresql.
Click on Next button to accept the default and proceed with installing Postgresql.

Setup (as superuser)_187

The installation wizard will start to install Postgresql.
Wait for the installation process to complete.

Setup (as superuser)_188

After the installation process has complete, you will see the below screen.
Click on Finish button to exit the installer.

Note If you not need to download and install additional software, uncheck the option to start Stack Builder at exit.

Setup (as superuser)_189

After you exit the installation wizard, you should be able to see the Postgresql that you just installed from the desktop menu.

Workspace 1_195

Note If you do not see the menu item, you may need to re-login or restart your system.

The pgadmin installed should be version 1.20 and should work fine with Postgresql 9.4.

2014-12-31

How to Install Postgresql onto Ubuntu (Trusty Tahr)

Filed under: computing — Tags: , , , , , — Zhixian @ 00:08:12 am

This blog post describes how I install Postgresql 9.4 onto Ubuntu.

You may want to following this blog post, Installing Postgresql using installer from EnterpriseDB on Ubuntu instead.
The below blog post will install latest version of Postgresql at this time of writing (version 9.4).
Unfortunately, the graphical interface tool installed pgAdmin III that is installed with this set of instructions uses an older version of pgAdmin III (version 1.18.1 at this time of writing).
This version does not support Postgresql 9.4.

Summary

  1. Create Repository List File
  2. Import Signing Key
  3. Update apt-get
  4. Install Postgresql
  5. Install Additional Modules

Create Repository List File

Create the repository list file using the following command:

echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list

zhixian@SARA: ~_161

Import Signing Key

Import signing key for Postgresql by running the following command:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

zhixian@SARA: ~_162

Update apt-get

Run the following command to update your apt-get.

sudo apt-get update

zhixian@SARA: ~_163

Install Postgresql

Run the following command:

sudo apt-get install postgresql-9.4

zhixian@SARA: ~_164

Install Additional Modules

The installation above is quite bare-bones. It does not provide a graphical tool or development libraries.
To add them, run the following command:

sudo apt-get install postgresql-contrib-9.4 pgadmin3 libpq-dev postgresql-server-dev-9.4

postgresql-contrib-9.4 – additional supplied modules
libpq-dev – libraries and headers for C language frontend development
postgresql-server-dev-9.4 – libraries and headers for C language backend development
pgadmin3 – pgAdmin III graphical administration utility

zhixian@SARA: ~_165

After installation have complete, you can find the graphical tool under Applications > Programming > pgAdmin III from the desktop menu.

Workspace 1_166

Reference

Linux downloads (Ubuntu) (http://www.postgresql.org/download/linux/ubuntu/)

2014-12-30

How to install MonoDevelop on Ubuntu

Filed under: computing — Tags: , , — Zhixian @ 23:33:12 pm

This blog post describes how I install MonoDevelop onto Ubuntu.

Summary

  1. Add Mono Project Signing Key
  2. Add Package Repository
  3. Install MonoDevelop
  4. Reference

Add Mono Project Signing Key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

zhixian@SARA: ~_156

Add Package Repository

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

zhixian@SARA: ~_157

Install MonoDevelop

sudo apt-get install monodevelop

zhixian@SARA: ~_158

After installation have complete, you should be able to find MonoDevelop under Applications > Programming > MonoDevelop from the desktop menu.

Workspace 1_160

Reference

Install MonoDevelop on Linux (http://www.monodevelop.com/download/linux/)

2014-12-28

How to install Mono on Ubuntu

Filed under: web application development — Tags: , , , , , — Zhixian @ 01:29:12 am

This blog post describes my installation steps to get Mono running on my Ubuntu.

I will write another blog post on testing this installation.

Assumptions

  1. You have Apache HTTP Server installed
  2. You know how to start a terminal session and run commands there.

Summary

  1. Add Mono Project GPG signing key
  2. Add Mono Package Repository
  3. Add mod_mono Repository
  4. Update package cache
  5. Install Mono
  6. Install mod_mono
  7. Enable mod_mono
  8. Reference

Mono Project GPG signing key

This step adds the GPG signing key to your key-ring.
This signing key is used to make sure the installed files are valid.
To add the key to your key ring, start a terminal session and run the following command:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

zhixian@SARA: ~_120

Add Mono Package Repository

This step add the Mono package repository into apt-get list of available package repositories.
Enter the following command at the command-line of the terminal session:

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

zhixian@SARA: ~_121

Add mod_mono Repository

This step adds the repository for mod_mono to apt-get list of available package repositories.
mod_mono is use by Apache HTTP server to interpret .NET web pages.
To add the repository, run the following command at the command-line:

echo “deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main” | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

zhixian@SARA: ~_124

Update package cache

To update the apt-get package cache to use the repositories that you just added, run the following command at the command-line:

apt-get update

zhixian@SARA: ~_125

Install Mono

To install the complete Mono package enter the following at the command-line:

sudo apt-get install mono-complete

zhixian@SARA: ~_126

After the initial listing of the packages that will be installed, you will be given a prompt asking if you would like to proceed install Mono. Enter “Y” to proceed with the installation process.

zhixian@SARA: ~_127

zhixian@SARA: ~_128

Install mod_mono

Run the following command to add mod_mono:

sudo apt-get install libapache2-mod-mono

zhixian@SARA: ~_129

You might see an error exit status at the end of the installation process.
This is due to some configuration issue in the installation process.
I’m not too sure what exactly is the issue but it seems fine to ignore it.

zhixian@SARA: ~_131

Enable mod_mono

mod_mono is enabled by running the following command:

sudo a2enmod mod_mono

zhixian@SARA: ~_133

Reference

http://www.mono-project.com/docs/getting-started/install/linux/

https://help.ubuntu.com/community/ModMono

2014-12-17

How to install Microsoft TrueType Core Fonts for the Web in Ubuntu

Microsoft had release some fonts for use with Internet web pages.
These fonts are generally designed to be legible on screen and hence theoretically suitable for anything viewed on screen.

Summary

  1. Installation
  2. Verify

Installation

These fonts can be installed via Ubuntu Software Center (search term: ttf-ms).

After you entered the search term, click on the item labeled Installer for Microsoft TyueType core fonts.
Click on the Install button to initiate the installation process.

Ubuntu Software Center_064

After you clicked on the Install button, an EULA (End User License Agreement) dialog will appear shortly.
Checked the check box to agree with the terms and click on the Forward button to proceed the installation process.

Debconf on SARA_066

After a short while, the fonts would have been installed.

Ubuntu Software Center_067

Verify

This fonts installation page will add the following fonts into your system:

  1. Andale Mono
  2. Arial
  3. Arial Black
  4. Comic Sans MS
  5. Courier New
  6. Georgia
  7. Impact
  8. Times New Roman
  9. Trebuchet MS
  10. Verdana
  11. Webdings

To check the fonts installed on your system, you can use the Font Viewer that comes with Ubuntu.
The Font Viewer can be accessed via Applications > Accessories > Font Viewer from the desktop menu.

Workspace 1_068

Note that in some cases, you may see a repeated entry as with the Andale Mono font shown below.

Font Viewer_069

This is normal.
The cause of this duplication is because in the installation folder (/usr/share/fonts/truetype/msttcorefonts by default) contains links that back point to the font file.
When using font viewer to view fonts, it read the link as a separate font. Hence the double count.

zhixian@SARA: -usr-share-fonts-truetype-msttcorefonts_070

2014-12-16

How to install and setup Yandex Disk on Ubuntu

This blog post is about installing and configuring Yandex.Disk, a cloud storage service.

Summary

  1. Assumptions
  2. Installation
  3. Configuration
  4. Launch on startup

Assumptions

This application is priced at $0.
As such, installation requires the use of an Ubuntu One account.
It is assumed that you have such an account.

It is also assumed that you have a Yandex account to use this service.
At this time of writing, the service remains free.

Installation

Yandex.Disk can be installed via Ubuntu Software Center (search term: yandex).
Click on the More Info button to view details.

Ubuntu Software Center_052

In the software description page, click on the Buy button.
At this time of writing, its priced at $0.

Ubuntu Software Center_053

After you pressed Buy, there will be a Terms of Use dialog.
Click on the Accept button to accept the terms of use.

Terms of Use_054

After you clicked on the Accept button, you need to log in to your Ubuntu One account.

Ubuntu Software Center_055

After you entered your credentials and log in to your Ubuntu One account, the installation for the application should proceed accordingly.
After the installation has complete, you should be able to access it from the desktop menu:
Applications > Internet > Yandex Disk

Workspace 1_058

After you click on the menu item, it will start a console session describing the usage of Yandex Disk command, yandex-disk.

zhixian@SARA: ~_059

Configuration

To setup your Yandex Disk, type the following command in the Yandex Disk console session:

yandex-disk setup

The setup process will prompt you for:

  1. Your proxy server information
    (I entered “N” as I do not use a proxy server)
  2. Credentials to your Yandex account
  3. Path to a folder on your local disk to store your Yandex Disk files.
    (I left this field as blank to use the default proposed path)
  4. Whether to start Yandex Disk on startup
    (I entered “Y” to start Yandex Disk on startup)

zhixian@SARA: ~_062

After setup is done, the background (daemon) process will begin to synchonize files from your Yandex Disk in the cloud to the path that you defined above in point 3 (/home/zhixian/Yandex.Disk).

When you examine the folder after a short while, you should see files in your Yandex Disk appearing in the folder.

Yandex.Disk_063

Launch on startup

When doing the setup, you might have indicated that you would like Yandex Disk to launch on startup.
As of this writing, this may not be working correctly.
To remedy this:

Go to the System > Control Center on the desktop menu.

Workspace 1_074

In the Control Center window, click on Startup Applications. to open the Startup Applications Preferences dialog.

Control Center_076

In the dialog, click Yandex.Disk in the lists of additional startup programs.
Then click on Edit button to open the Edit Startup Program dialog.

Startup Applications Preferences_082

In the Edit Startup Program dialog, change the command from:

yandex-disk start

to

/opt/yandex-disk/yandex-disk start

Edit Startup Program_081

After you click Save to close the dialog, Yandex Disk should launch on startup correctly now.

2014-12-02

How to install PHP to Apache HTTP Server in Ubuntu 14.04 (Trusty Tahr)

Filed under: php, web application development — Tags: , , , , , , — Zhixian @ 10:36:12 am

This blog post describes how I install PHP to Apache HTTP Server and test the installation on my Ubuntu installation.

Steps

  1. Installation
  2. Verifying PHP5 Modules in Apache2 HTTP Folder
  3. Testing installation

Installation

The quick and simple way is to use Ubuntu Software Center (search term: php5).
This will install the latest version of PHP5 available in the Ubuntu Software Center.

Ubuntu Software Center_010

Verifying PHP5 Modules in Apache2 HTTP Folder

After the installation is complete, you should see Apache HTTP modules for PHP in the mods-enabled folder.
By default (if you installed Apache HTTP server via Ubuntu Software Center), the installation folder is located at:

/etc/apache2

In the installation folder, there should be a folder labeled mods-enabled.
In this folder, you should see a php5.conf (that holds your configuration settings for PHP5) and php5.load (the actual Apache2 module for PHP5) file.

zhixian@SARA: -etc-apache2-mods-enabled_011

Testing installation

After you confirmed that PHP module is enabled in PHP, you can test your installation.
To do so, create a test.php file in Apache’s document root folder.
By default, the document root folder is located in /var/www/html.
However, the owner and group access for this folder belongs to the root user.

html Properties_013

This means you need to access the /var/www/html folder as a superuser in order to make changes to the folder.
One way would be start a terminal session and enter the following commands:

gksudo caja /var/www/html &

zhixian@SARA: ~_015

If you are not using Mate desktop, replace “caja” with “nautilus” as in:

gksudo nautilus /var/www/html &

This command can be explained as follows:

gksudo – run command as superuser. This is similar to the sudo command. But because we are running the command in the background (see & below), the prompt to allow us to enter administrator’s credentials will be in the background as well. By using gksudo, we will get a prompt like the below, that allows us to enter administrator’s password.

Workspace 1_016

caja (or nautilus) – command to activate your file manager

/var/www/html – parameter used by file manager. File manager use this parameter and open this folder when it start.

& – The ampersand indicates that this command is to run in the background. If this is missing, the terminal session will be dedicated to run the file manager until the file manager application terminated.

After you run the command, you should see:

html (as superuser)_017

In this folder, create a file call test.php with the following contents:

<html>
<head>
<title>PHP Test Page</title>
</head>
<body>
<h2>A PHP test page</h2>
<?php echo “hello world”; ?>
</body>
</html>

test.php (-var-www-html) - gedit (as superuser)_018

Now, your /var/www/html folder should look something like this:

html (as superuser)_020

Go to your browser and navigate to:

http://localhost/test.php

You should see a result like the below:

PHP Test Page - Google Chrome_021

Older Posts »

Blog at WordPress.com.