Dual-booting Windows 10/Ubuntu 18

It’s 2019 and dual-booting Windows/Linux is still not an easy feast! Ever since I moved to Apple ecosystem few years ago, I used Mac exclusively for desktops and Linux exclusively for servers and therefore don’t ever feel the need to touch a Windows machine. However recently I found myself occasionally need to have access to a Windows machine to upgrade firmwares, play games and stuffs. So with my Intel NUC, the obvious choice would be to dual-boot between Windows and Linux. My choices are Windows 10 (because I can use it indefinitely without activation) and Ubuntu 18 LTS. But man, dual-booting comes with so many problem. Clock time is off in dual-boot I am on EST timezone. Every time I boot in to Linux the time is correct, but every time I boot into Windows the clock is 5 hours off. Turns out OSes store and retrieve time in hardware clock. However the way they store time is different. Linux uses UTC while Windows use local time. The solution is to switch Linux to use local time, or Windows to use UTC. Full instructions here. Bluetooth keyboard needs to pair again every time When you pair a bluetooth device, the information about the device is stored on the OS, and information about the OS is also stored on the device. When you switch between OSes and pair again, the pairing key on the device is overwritten by the OS. The solution is to use the same pairing key on both systems. It’s not possible to manually change pairing key on Windows, but we can do that on Linux. Full instructions is here, but the basic steps are: Pair all devices on Linux Pair all devices on Windows From Windows, extract pairing keys using Registry Turn off all bluetooth devices, then

DigitalOcean credit expiration policy changed

Yesterday I received a strange email from DigitalOcean: Honestly, I don’t think it’s a good idea at all. Basically they want to change the expiration policy of ALL new and issued credits. You will have a month to use all your remaining credits, or it will be expired. It would be much better if they only add expiration for newly issued credits. As in, older credits will be kept intact. By the way, after a small complain, DigitalOcean gave me $20 credits. That was much better than I could hope for.

Healthy Competition for Bitcoin

I’ve been following the Bitcoin block size debate since Gavin’s 20mb block proposal. If you’re not familiar with the block size debate, this wiki article is a good start. During the debate, I’ve lost respect for quite a few of famous people. But let’s put it aside. Let’s talk about a healthy competition for Bitcoin. There should be more than one teams working on different implementation of Bitcoin Yes, both the software and the protocol. If there is only one implementation, who will have the authority to decide which features to include/exclude in Bitcoin software? Who should decide which rules applied/not applied to Bitcoin protocol? In the ideal world, there should be more than one implementations. Teams are freely to include/exclude whatever features they want. Users and miners will decide which softwares they want to run based on features set each implementation provides. And since teams are freely to code, companies can “lobby” (for example paying developers) for their desired features to be included into the software, if these features are not what everybody want. But, miners and users need to be well-informed in order to make decisions Yes, that’s why it is important to keep users/miners informed. Users/miners should be able to understand pros and cons of each features, and why they are included in each implementation. Therefore, it also important to have healthy discussion forums. Attack the implementation, not the people Remember, every developer/user/miner, regardless of their views are, is a person. We should assume they want Bitcoin to success. Respect every person even though (s)he does not share your view. If you don’t like a feature being included into the software, simply don’t run it. Let others know your view. Have a healthy discussion. Run what’s the best for you, or create a new one if you can’t find any

Goodbye Dropbox. Hello Google Drive!

Yep, that’s right. I finally made the switch from Dropbox to Google Drive. Dropbox is great. They have awesome and intuitive UI, and still the best UI among competitors so far. Their file sync process is simple but admirable. Instead of syncing the whole changed file, they only sync the difference. Reduce lots of network bandwidth and syncing time. So why the switch? Storage is the biggest issue. Even with edu accounts and lots of extra storage for completing Dropquests, my Dropbox limit is still far less than I need. 27GB is far less than 2PB (yes, 2PB) Google Drive offered. Dropbox used to have edge advantages. Now, not so much. Five years ago, Dropbox is the only choice. Fast and intuitive UI and also the syncing process. Now, Google Drive has almost everything. Camera Upload? Yes. Selective Sync? Yes. Revision? Yes. Sharing? Of course Yes. The only thing that Google Drive does not have is Fast sync. Google Drive still upload the whole modified file instead of only the difference. But my need has changed since five years ago. I used to use Dropbox for my thesis because they have revisions. Whenever I made something wrong, I can easily go to Dropbox and select the right revision to restore. Now I only used cloud storage for “storage”. I no longer need to keep revisions. Therefore, the switch is inevitable. The pace of Dropbox’s innovation. They acquired Mailbox, and killed it. They used to have a great Photo app called Carousel, but also killed it. They introduced a syncing platform for app a few years ago, but it does not directly add any value to end user experience.

What I’ve learned this week: Dropbox, Spark and more

1. Dropbox Dropbox is shutting down its two apps: Mailbox and Carousel. I’ve been using both apps heavily recently. The most important feature of Mailbox is auto-swipe. Other competitors also have similar features, but they require much more effort to setup, while Mailbox only requires tap and hold. Easy like a piece of cake. Auto-swipe saves me from going through 14k+ emails so far. Carousel saved me lots of iPhone space by uploading my photos to Dropbox. I heard that they will integrate important features of Carousel into Dropbox, so I will not miss Carousel too much, compare to Mailbox. Without Mailbox around, I will have to manually setup my filters in a bunch of mailboxes. 2. Spark The different between Spark submission tool and Hadoop is that, by default Hadoop uses all available machines (cores) for a single job, provide that input is big enough to be distributed into all machines. Spark, on the other hand, only use 2 cores for executors and 1 core for driver. In order to run Spark with all available cores, you first need to figure out how many executors there are on your cluster. I wonder what leads to the decision in Spark submission tool design. 3. Miscellaneous It is very hard for me to think about what I’ve leaned by the end of a week. I’d better write and update a draft right after I learned something, when the memory still fresh. Oh yes, I still need to write two meeting summaries for this week, so I’d better get going. Hence the short blog post.

Du học: Ở hay về? (Ném đá ao bèo)

Quan điểm của mình là: Nếu không bị vướng bận về mặt tài chính (đi theo học bổng của nhà nước hay một công ty nào đấy và trong điều khoản có ghi rõ là sau khi học xong phải về) thì du học sinh muốn ở đâu thì ở. Khoan nói đến chuyện lòng yêu nước, cống hiến cho đất nước, bla bla bla, khi mà bạn còn chưa nuôi nổi chính bản thân mình (hoặc gia đình nhỏ của mình) thì cống hiến cái nỗi gì. Con người ai cũng có quyền mưu cầu hạnh phúc (không phải là quyền hạnh phúc — hạnh phúc phải mưu cầu và phấn đấu thì mới có), còn phấn đấu ở chỗ nào, trong nước hay ngoài nước thì không liên quan lắm. Yêu nước có nhiều cách. Không phải cứ về nước, làm một việc gì đó, cuối tháng nhận lương, đóng thuế đầy đủ mới là yêu nước. Xét về mặt vật chất thì có khi ở nước ngoài làm việc rồi gửi tiền về có khi còn đóng góp được nhiều hơn. Xét về mặt tinh thần thì đúng là về nước làm việc có vẻ như là yêu nước hơn ở lại nước ngoài. Thế nhưng về nước làm việc cho tập đoàn nước ngoài thì về bản chất cũng không khác ở lại nước ngoài làm việc là mấy. Còn làm việc ở các tổ chức “hành chính” nhà nước thì không cần nói ai cũng hiểu. Túm cái váy lại là nếu bạn tự bỏ tiền đi học, hoặc đi học bằng tiền của giáo sư / nước bạn đi học, thì sau đó bạn muốn mưu cầu hạnh phúc ở đâu thì tuỳ. Về nước thì về mà ở lại thì ở, nếu bạn

What I’ve learned this week: Let’s Encrypt, Python’s lambda and more

It’s never too late to start a tradition. I haven’t been writing blogs lately. 1. Let’s Encrypt In the ideal world, everyone should be able to do anything without the fear of eavesdropping. 10 years ago, it would be very hard to do this. Personal Computers were not very strong and Internet was slow, therefore HTTPS is reasonably slower than HTTP. Things have been changed. Computers are faster now. Internet speed has been increased exponentially. The only thing that hold HTTPS back is the cost to obtain a server SSL certificate. In my opinion, it should be free because once you have an intermediate certificate that is signed by a root certificate, generating a server certificate is just a piece of cake. Honestly it costs money to obtain an intermediate certificate and maintain supporting infrastructure, and companies usually offset the cost to customers who want to purchase a server certificate. Actually server certificates have been issued for free for over two years by StartSSL, but the process is not simple. You need to sign up an account, verify your email address, verify your domain, generate a certificate signing part on your server, create a request with StartSSL and wait for your certificate to be signed. The whole process could take up to a day, YMMV. And once it’s expired, you need to go over the whole thing again, except maybe verify your email address. With the introduction of Let’s Encrypt, things are getting much better. With a simple git clone command, and another command to run the letsencrypt-auto toolkit, once can easily obtain a server certificate in a blink of an eye (no, actually it takes about a minute). And renewing a certificate could be done using the same procedures. Simple and sweet. Instruction to obtain a certificate. 2. Change

Kepler-452b và Lược sử thời gian

Hôm qua NASA công bố tìm ra một hành tinh gần giống với trái đất, chỉ tiếc là cách trái đất những 1400 năm ánh sáng. Nhân lúc tôi đang đọc cuốn Lược sử thời gian (A Brief History of Time) của Stephen Hawking, dưới đây là một số nhận xét và tính toán của tôi. 1. Làm thế nào NASA tìm thấy Kepler-452b? Câu trả lời đơn giản là nhìn lên trời. Nếu nhìn đủ lâu và nhìn đúng chỗ thì kiểu gì chúng ta cũng tìm ra. Tất nhiên là không phải nhìn bằng mắt thường rồi. Kepler-452b được phát hiện bởi kính thiên văn Kepler, được phóng lên quỹ đạo trái đất vào năm 2009. Tại sao không sử dụng kính thiên văn dưới mặt đất? Có nhiều lý do, nhưng đơn giản nhất là khí quyển của trái đất và sự tự quay quanh chính nó có thể làm sai lệch các kết quả đo đạc. Kính thiên văn Kepler quay xung quanh mặt trời chứ không phải là trái đất. Ánh sáng từ Kepler-452b mất 1400 năm mới đến được trái đất, nghĩa là ánh sáng mà chúng ta nhận được là hình ảnh của Kepler-452b của 1400 năm trước. Nói hình ảnh cho nó oai chứ thực ra cũng chỉ là một chùm sáng. Nhờ phân tích quang phổ của chùm sáng này mà các nhà thiên văn học có thể tính toán được khối lượng, kích thước, nhiệt độ và có thể là thành phần hoá học nữa. 2. Làm thế nào NASA phân biệt được các ngôi sao với nhau? Trái đất quay xung quanh mặt trời. Mặt trời cũng chuyển động trong ngân hà Milky Way. Tuy nhiên với những ngôi sao ở rất xa thì vị trí tương đối của chúng đối với nhau không