I have E: drive that I have been using for years to dump my personal files. I just purchased 4TB drive for fear of failing drive, so I want to copy everything on E: to the new drive (F:). I could have drag and drop everything from E: to F: but I wanted a geekier way (well maybe more robust way) to copy files from E: drive too F: drive. Here is how I started the process with rsync.
rsync -avz --progress /mnt/e/* /mnt/f
I have like 1TB of data (that’s it?) and it will take hours for it to finish the copying process.
So for entire March (31 days), it was $1.98. If cost per day is $0.06, it would be $1.86 but it was $1.98. I found out the resource cost to the fraction of cent is $0.064, so it came up to $1.98. That said, a stable and reliable VPN server without noisy neighbor problem at less than $5 is very very reasonable.
One thing I found out is that if you connect multiple devices at the same time, it can get unstable. I have no problem with it because I can’t watch multiple TVs at the same time. If I wanted to have multiple devices connected, I’d provision one or two more VPN servers because one ARM host is at around $2 after all.
When you upload relatively a big file to Object Storage in OCI, it doesn’t have the MD5 hash ready for you. It’s because the big file is split into multi parts and they are uploaded into separate space. Then, when you download the file, the multi parts are downloaded sequentially and they are put into one file on the client side. Object Storage does not calculate the MD5 hash putting the multi parts together on the service side due to its sheer required processing power it may need. When you try to view the information of the file on Object Storage, you don’t see the actual MD5 hash.
Tough opc-multipart-md5 looks promising, that’s just a part of the whole thing. To get my point crossed, when I uploaded a small file, MD5 hash is calculated and available on the service side.
Now, how do we solve this problem? The best way is to calculate the MD5 hash before you upload the file with md5sum and then attach the MD5 hash to metadata when uploading the file to Object Storage.
You can get the data by executing the following command.
oci os object head --auth instance_principal -bn backup --name 2022-03-20.zip
So the process would be to execute oci os object head on the object you are going to download and keep the MD5 hash in a variable. Then once you download the file, have md5sum calculate the MD5 hash on the downloaded file. And then see if the calculated MD5 matches the one from oci os object head.
Here is the bash script I came up with to upload the file with the metadata.
Bash scripting is my weakness as an engineer. I don’t like bash. Here are the reasons I don’t like it.
Bash depends on standard output. If you need to work on a complex scripting, it easily gets ugly dealing with a bunch of string mambo jumbo with regex.
Commands are each independent executable.
You cannot create functions with parameters. You have to use variables always at the global level.
So as a strong alternative, I use Python most of the time. Because I don’t prefer to use Bash script, my skill in bash scripting is limited. I believe bash does have a place to be but I tend to avoid it.
That said, I think I should spend more time on Bash to be at least fluent with it. I don’t consider myself to be fluent yet.
I used this bash script to install and configure openvpn. This is one of the most amazing script I have seen. There is a lot to learn from it.
I provisioned an ARM64 VM in Tokyo last weekend to create a VPN server in Japan. I noticed that I was starting to get charged for it. Here is how much…
So far only $0.09. Looks like only $0.06 per day. That means $0.06 x 30 = $1.8 a month. A full blown VPN server just for myself for $1.8 a month. The boot volume size is what’s costing me, and the size is 47GB. That’s the default size I picked.
I thought up to 4 ARM64 hosts were free but that seems to be only in the home region, which is us-ashburn-1 in my case. But still $1.8 per month for my own VPN server in Japan is very very cheap and I have no problem keeping it running. I have been using the VPN server to watch movies and contents in Japan and I have been very happy with it.
I used to have an VPN server in Japan with Azure and it used to cost me around $20 a month for mostly data transfer but OCI seems to be very generous in the amount of data transferred.
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.
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.
Cloned the existing boot volume.
Created an instance out of the cloned boot volume. When I created the instance, I had a chance to enter public key.
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.