My Own VPN Server in Japan

I’m from Japan and I want to watch movies and TV programs in Japan from time to time. I subscribe to Amazon Prime in Japan but the IP address here in US prevents me from watching movies on it. In my opinion, that kind of service really kills advantage of the Internet but there must be business reasons why they want to filter the traffic by the source IP address.

To get around it, you could use a VPN connection. You can connect to a server in Japan and watch contents there pretending that you are in Japan. Yeah, there are VPN services out there and you can easily get decent service relatively reasonably but as an engineer, I thought why don’t I create a VPN host in Japan.

I provisioned a host in Japan on OCI. It is a ARM64 Ubuntu host. After Googling some, I was able to find a nice article that let me walk through steps to configure a VPN server. After like 20 to 30 mins, I was able to use the VPN server. It was a breeze.

As far as I see, the ARM64 Ubuntu host in Japan is free so far, so as long as you are willing to go through some steps your self, you get a free VPN server in the country you want.

Migrated Yet Again

I didn’t feel right that I had to clone the boot volume and recreated the blog instance out of it to recover my SSH key, so I created an ARM instance from scratch again.

It was very easy to install and configure the Docker containers this time because I already had an Ansible project to automate it.

If you are seeing this article, you are seeing it on a yet another ARM host with Dockerized WordPress.

Recovering SSH Key

I stupidly reinstalled Ubuntu on my desktop on which I had Linux Mint just because I wanted to try it but I ended up with going back to Linux Mint again. I’m writing this blog from my Linux Mint. I casually formatted the hard drive and did a little distro hopping. When I tried to SSH into my blog host on OCI, I realized that I lost the SSH key and no other host can access the blog host. Crap!

However, I was able to recover it relatively quickly. Here is the list of what I did.

  1. Cloned the existing boot volume.
  2. Created an instance out of the cloned boot volume. When I created the instance, I had a chance to enter public key.
  3. Since it was a cloned volume, everything was already on it. Since it’s got a different public IP, I just changed the DNS A Record to point to the new instance.

It’s all back up and I am able to SSH into the host again.

Experiment with Azure

I remember doing some experiment with Ansible on Azure sometime in January for about 2 weeks. I just got charged $12.16. Azure charges come to my as surprise… Hmm I didn’t think it was costing that much, kind of surprise. I should have monitored the cost as I was using it but I provisioned just one small VM, so I didn’t think it was going to be $12.

I went head and did some analysis. Here is the details of the cost.

  • VM License: $7.43
  • Storage: $2.50
  • VM: $0.77

Oh, I was paying to a VM license… I wondered what I provisioned… If I remember correctly, it was Oracle Linux. When you use Oracle Linux on Azure, it costs about $0.019/h. I had it a little more than 2 weeks so it makes sense. However, as far as I know, Oracle does not charge anything for its license if you provision Oracle Linux on Oracle Cloud Infrastructure (OCI), so if you want to use Oracle Linux, OCI is a good choice.

I see people posting question like “Which distro is good other than CentOS?”. I’d say Oracle Linux is a very good choice. It is 100% compatible with RedHat Linux and it’s free. As far as I know, Oracle Linux is very well maintained by Oracle very often and as long as Oracle is in business, it will continue to be distributed for free. RedHat dropped the ball on CentOS because it didn’t make business sense to RedHat but Oracle uses Oracle Linux for their production a lot so I don’t see them dropping the ball anytime soon.

Migrated to Oracle Linux 8

I just migrated my blog to Oracle Linux 8 on Oracle Cloud Infrastructure. Here is the spec.

  • VM Shape: VM.Standard.A1.Flex
  • OS: Oracle Linux 8
  • CPU: AMPERE Arm64 1 CPU
  • Memory: 6GB
  • Boot Volume: 100GB
  • Docker Containers: WordPress, MariaDB, NGINX and phpMyAdmin

I will probably keep this machine running for the foreseeable future. Configuring a new VM was a breeze because of the Ansible project I worked on.

Oracle Cloud Infrastructure Free Tier

I wasn’t too sure about OCI’s free tier in what’s really available to us but now I have the list of it.

  • 2 AMD hosts.
  • 4 Arm A1 hosts (this blog site is hosted on Oracle Linux 7 on Arm64 and it’s quite fast)

You can follow this link to get your own account with OCI. Ask questions in the comment section if you have any.

Ansible WordPress Repo

I guess I finished my personal project of provisioning WordPress site with Ansible. I was able to run it and get a WordPress site to show up in just about 10 mins. I’m sure there are some loose end I could tighten but it generally works. Here is the GitHub repo I worked on.

ansible-wordpress repo on GitHub

Setting up a free OCI account (ARM64 Oracle Linux 8 is always free eligible) and getting a domain name through dnsimple.com are two things you may need to do but if you pay like $60 for dnsimple.com (DNS service) annually, you get to have your own full blown WordPress site with your own domain name.

One thing to be careful about this approach is that you have the full control over the site, meaning if there is any issue, you are on your own to analyze and resolve the issue. You have to update your SSL cert yourself as well. If you are not so good with Linux or have no willingness to dig into it, it wouldn’t be for you.

If you are a CS student wanting your own site or you are learning how websites work, you may want to dig into it. After all, just $60 per year to have your own WordPress site with your own domain name is really reasonable.

Blog is My Home

This blog is no popular but I feel so home here. There is no one who tells me what to do with it and no one tells me how should write certain code. I get that from work, which is fine but I feel a total freedom in this blog. And I realize that I love what I do. That is why I spend my own time in the evening to dig into what I’m interested in. No rush, no deadline, no politics… It’s just me wandering in the software world.

At the same time, I often come to this site while I am working for reference. I sometime hit a hurdle but I remember I have done it before in my blog, so I come here and search. This blog is my external memory. I cannot remember everything for sure. I also hope that parts of this blog site will help some people out there. Though this is not a popular site nor I don’t get many comments, that’s what makes writing blog fun.

Full WordPress Site within 10 Mins

I pretty much finished writing the Ansible code to configure an Oracle Linux 8 machine from scratch to the point where it runs a full WordPress site on ARM64 processor. It took just about 10 mins. This is a milestone for me. It used to take at least a few hours for me to set it up when I didn’t have Ansible automation while I search for the information I blogged here.

I will probably polish the code to the point where I can share with the community sometime this week or next week.

How to Clear DNS Cache on Linux Mint

The names you type in your browser or whatever you do to hit another machine by name and the corresponding IP addresses are cached locally. When you change your DNS, you want the cache to be cleared. Here is the command you can use on Linux Mint to clear the cache.

sudo systemd-resolve --flush-caches

Once that’s done, it goes out to your ISP to get the names resolved again.