Zhixian's Tech Blog

2015-10-30

Installing Ruby

Filed under: Uncategorized — Zhixian @ 23:06:10 pm

Installation

$ sudo apt-get install ruby-full

This will install Ruby 1.9.3 as of this writing.

I want to do Ruby on Rails, I need to install Rails.
Rails however require “make” which is not installed out of the box.
So we need to install that first.

$ sudo apt-get install make

Apparently, it also require zlib development libraries.
You need to install it by running the following command:

$ sudo apt-get install zlib1g-dev

Before installing Rails, you may want to install the “rdoc” package.
If not, you may encounter the error message “file ‘lib’ not found”.

$ sudo gem install rdoc

After installation of “rdoc” package, you can install Rails using:

$ sudo gem install -V rails

Note: The “-V” parameter in the above command makes the installation process more verbose and may be omitted. If omitted, it may appear as if the process is hanged as there is not visible feedback on the installation process. The download and installation process itself takes quite a while.

Alternatively, you may want to run the following command to install Rails instead. This command will not install documentation for Rails which can take some time to generate (and hence misled you to think that the process has hanged).

$ gem install rails --no-ri --no-rdoc

Reference

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

Advertisements

Installing FTP server

Filed under: Uncategorized — Zhixian @ 23:05:10 pm

Installation

$ sudo apt-get install vsftpd

Configuration

Edit the configuration file /etc/vsftpd.conf

Uncomment this line to allow users to be able to upload files:

write_enable=YES

Uncomment this line to limited to their home directories:

chroot_local_user=YES

Add the following line to counter the message:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()

allow_writeable_chroot=YES

Restart server

$ sudo restart vsftpd

Reference

https://help.ubuntu.com/lts/serverguide/ftp-server.html

https://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/#comment-2051

Installing Git

Filed under: Uncategorized — Zhixian @ 23:00:10 pm

Installation

$ sudo apt-get install git

Basic Setup

$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

Reference(s)

https://help.ubuntu.com/lts/serverguide/git.html

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-10-15

Connecting to OpenSSH server using MobaXterm

Filed under: computing, ubuntu — Tags: , , , , , — Zhixian @ 14:19:10 pm

This blog post covers connecting to the openssh server installed on Ubuntu server using MobaXterm.

Testing OpenSSH

I want to connect to the openssh server.
For this purpose, I use MobaXterm from Mobatek (http://mobaxterm.mobatek.net/).
This is a terminal application with a few other tools built-in.
It has a professional edition which cost money and a home edition that is free.
For our local development purpose, the free edition is fine.

Alternatively, there’s the putty-series (http://www.putty.org/) of applications.

The remainder of this session assumes you are using MobaXterm.

After you start up MobaXterm, you may see a window like the below.
Click on the Session button on the menu.
This will open the Session Settings dialog.

image

On the Session Settings dialog, click on the SSH button on the top menu.

image

Under the Basic SSH settings tab, enter the name of the remote host.
Click the OK button to connect to the server.

image

After you clicked OK, MobaXterm will start your session on a new tab.
You should see your usual login prompt.
You should be able to login to your account as usual.

image

File transfer using SFTP

You can transfer files from your Windows machine to your Ubuntu machine using SFTP (Secure-FTP).
One the tools built-in the MobaXterm client is a SFTP client.
Click on the SFTP tab to display the directory and files in the directory.

image

To transfer files, simple drag and drop the files that you want to transfer in the area showing files in specified directory.

Ubuntu Server Initial Setup

Filed under: computing, ubuntu — Tags: , , , , , — Zhixian @ 13:29:10 pm

After you have installed your Ubuntu server, you may want to do some initial setup.
Specifically, you may want to add a another account.

Adding user account

Adding users can be done using the command adduser. In the below command-line, I am creating a developer account call ‘developer’.

$ sudo adduser developer

image

After you have create the user account, it might be useful to add the account to the ‘sudo’ group so that the account can make use of the ‘sudo’ command. To do so,

$ sudo addgroup developer sudo

image

You can check which groups an account belongs to using the ‘groups’ command:

$ groups developer

image

2015-10-11

Setting up Ubuntu 14.04 Server on VirtualBox

Filed under: computing, ubuntu — Tags: , , , , — Zhixian @ 17:15:10 pm

This is a blog post that describes my setup of Ubuntu Server 14.04 (Trusty Tahr) on VirtualBox.
I intended to use this server for local software development.

Selected Software Package Description
OpenSSH server Needed for remote secure shell sessions
LAMP Linux Apache MySql PHP development stack
PostgreSQL database Best open-source database
Samba file server File sharing
Skipped Software Packages Description
DNS server Don’t really think I need it
Mail server I will describe this in a later blog post
Print server Don’t really think I need it
Tomcat Java Server Not sure if I want to use this;

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

 

image

2015-02-09

done function not called in jQuery AJAX call

Filed under: development, web application development — Tags: , , — Zhixian @ 23:40:02 pm

In jQuery, you can write an AJAX call that is chained to a done function.
Sometimes this function does not get called.

One of things to examine is the response that you are receiving from the server.
If the response is malformed, the done function will not get triggered.

An example of a malformed response:

{ "result" : OK }

Correct reponse (note the presence of quotation marks around OK:

{ "result" : "OK" }

2015-01-10

Can not load type MembershipPasswordAttribute using ASP.NET (Mono)

Filed under: web application development — Tags: , , , — Zhixian @ 08:33:01 am

Note: This blog post does not provide a solution.

Background

Recently, I was trying to build a ASP.NET MVC project using Mono on my Ubuntu machine.
It did not end well.

While building the login page, I got this error message.

Could not load type ‘System.Web.Security.MembershipPasswordAttribute’ from assembly ‘System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

Error 500 - Google Chrome_201

The offending code is:

test.mvc.web - Views-Home-Index.cshtml - MonoDevelop_202

As it turns PasswordFor is not the only helper extension that will trigger this error.
TextBoxFor have the same issue as well.

Why this happens

As it turns out, the Mono 4.5 that I am using at this time of writing does not have this implemented yet.

You can view here (http://go-mono.com/status/status.aspx?reference=4.5&profile=4.5&assembly=System.Web).

Mono System.Web in 4.5 vs MS.NET 4.5 - Google Chrome_203

Solution

No good solution to this issue currently.

One possible workaround is not to use the HTML Helper extensions.

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.

« Newer PostsOlder Posts »

Create a free website or blog at WordPress.com.