// shall I write some keywords here to boost search engine ranking?

Showing posts with label guide. Show all posts
Showing posts with label guide. Show all posts

Friday, August 16, 2019

Get 30GB of Samba Storage on Cloud

OK, it is less than 30GB to be exact, as the OS took some space too.

The whole idea started from the offer from Google Cloud with an "always free" plan which include 1 f1-micro instance with 30GB standard persistent storage. (Anyway, you might still get charge for egress too)

So if you already have some running VPS or cloud instance, you may just use that too.

However, as you might experienced, most cloud provider have strong focus on network security. And the steps to define firewall rules, etc are different among providers.

Fortunately, ZeroTier come into rescue. We can use ZeroTier to link our home PC with the cloud instance just like there are in the same LAN (or Global Area Network, as advertise by ZeroTier).

So here go the list of guide that I had followed, hope you enjoy it:


Additional Ideas:

  • If you are have Windows 10 Pro at home, you may also consider to use NFS too.
  • You may experiment on mount object storage to the VM via FUSE for additional storage. (Do share with me the result and experience)

Sunday, April 19, 2009

Passwordless SSH login via Public Key Authentication

SSH login with password authentication is often a problem for shell script that run without human interaction. One of the option by simulating user input via some Expect script. While another option is to setup certification based authentication.

Below is the steps:

1. SSH to client host (said with username 'myuser')
2. Generate keys at client host, press 'Enter' while it prompt for key location and passphrase.:


$ ssh-keygen -t rsa

3. Upload the public key generated (~/.ssh/id_rsa.pub) to remote host home directory (said username 'remoteuser')
3. SSH to the remote host with same username ('remoteuser'), create the .ssh folder if not exist

$ cd ~
$ mkdir .ssh
$ chmod 700 .ssh

4. Import public key into authorized_keys

$ cat id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/*


Now when the 'myuser' at client host SSH to remote host with username 'remoteuser', it will not prompt for password anymore.

Tuesday, September 25, 2007

Simple JSP Internationalization with JSTL

Many MVC framework come with Internalization (i18n) support. But what I have is a pure JSP, Model 1 webapp, so those framework is not my choice.

I had Google on i18n for JSP. The examples found are more complicated than my expectation, and very likely will make the JSP code I have currently become more messy.

Then taglib come into my mind, I do some google on i18n by taglib, and found JSTL format (fmt) tags is i18n capable. After some copy and paste from a few webpages, I had compile a simple guide:

By the way, i18n simply means internalization. The 18 refer to number of characters between 'i' and 'n' in the word 'internasionalization'.

Tuesday, August 23, 2005

Access Linux partition from Windows

After my PC become a dual boot OS machine, It is good to have the access to harddisk partition of another OS. So I use this to access my Linux partition from Windows:

Ext2 IFS For Windows

Although the name state 'Ext2' but it work on Ext3 as well. And as u might expect, symbolic link is not supported.

Monday, August 22, 2005

Setup LAMP

Finally I had setup LAMP (Linux + Apache + MySQL + PHP) on my work station. Below is my short note. Hope you will find it useful.

Linux
Since my workstation already installed MS Windows 2000, I had create a Logical partition of 9 GB in my harddisk for Linux with Partition Magic 7.0.

Then I boot from Fedora Core 3 (FC3) Disc 1 to start my installation. I take 512MB of my 9 GB as swap partition. I choose not to select the Apache HTTPD and MySQL bundle with FC3 because I would like to take the chance to install them by myself.

Installation of FC3 is smooth with it wizard-like GUI and I get a Linux box after 15 minutes.

Apache + MySQL + PHP
The sequence to install them does matter. Apache and MySQL must installed before PHP. I have face some difificulties in integrating PHP and MySQL if MySQL is install via RPM.

Installing Apache, PHP and MySQL on a Linux/Unix server


So I install MySQL 4.1 by source. The steps in details can be found link above. I have make a mistake in the installation, I use root user to install MySQL. This cause MySQL failed to start with command mysqld_safe. To solve this, I had change the owner of mysql/var/ folder to 'mysql'.

Install of Apache is relatively simple. just followed the steps in page above will do. After both Apache and MySQL is installed. Installed PHP 5 as teach in page above.

Make Everything Autostart on Boot
For production server, manually startup MySQL and Apache is really do not make sense. To auto start MySQL, I followed the steps in MySQL Uer Manual.

To autostart Apache, I use the script in here and add it as service with similar steps as how I did with MySQL. It initially do not work and prompt "apache does not support for chkconfig" message. Then I fixed it by adding some details into the script as teach here. Then it works.