<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Albert Liang on Medium]]></title>
        <description><![CDATA[Stories by Albert Liang on Medium]]></description>
        <link>https://medium.com/@akliang?source=rss-ab51cb02cfe3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VuPpy91T742hmQALpker6w.jpeg</url>
            <title>Stories by Albert Liang on Medium</title>
            <link>https://medium.com/@akliang?source=rss-ab51cb02cfe3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 16:18:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akliang/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Docker compose and entropy]]></title>
            <link>https://akliang.medium.com/docker-compose-and-entropy-5b3f00561b88?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b3f00561b88</guid>
            <category><![CDATA[haveged]]></category>
            <category><![CDATA[entropy]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Mon, 04 Oct 2021 03:50:47 GMT</pubDate>
            <atom:updated>2021-10-04T03:50:47.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LhsMGY8uxJAhu7Km" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Ran into a seemingly commonplace problem (my docker-compose was hanging randomly) with an extremely unexpected answer (my system was running out of entropy)!</p><p><strong>TL;DR: install </strong><strong>haveged on your system</strong></p><p>What is entropy? It’s basically the “randomness” on your machine from your interactions with it (keyboard, mouse, hard drive activity, web activity). Entropy is used in security applications such as SSH, PGP, SSL/TLS and random number generators.</p><p>So how does this affect docker-compose? According to <a href="https://github.com/docker/compose/issues/6678#issuecomment-494394417">this thread</a>, one of the docker-compose dependencies makes a call out to /dev/random and a machine that doesn’t have enough entropy will block docker-compose. After a fixed amount of time, that docker-compose dependency gives up waiting for /dev/random and polls /dev/urandom instead which is less secure (less random, but also non-blocking).</p><p>Generally if you’re on a bare metal, entropy won’t be a problem. But in a VPS environment where there are no keyboard/mouse interactions and the hard drives are virtualized (less random), entropy can get low.</p><p>You can check the entropy of your system by using:</p><pre>cat /proc/sys/kernel/random/entropy_avail</pre><p>Generally, the larger the better, and anything over 1000 is “good enough”.</p><p>If your entropy is too low, you can install haveged :</p><pre>apt-get install haveged</pre><p>What is haveged and how does it work? To the best of my understanding, it is similar to how /dev/random generate entropy bits, but adds in more sources of information, such as CPU clock cycle timing and cache misses. A very interesting read on this can be found <a href="https://security.stackexchange.com/a/34552">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b3f00561b88" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to rsync directly into a Windows 10 machine (using OpenSSH not cygwin or WSL)]]></title>
            <link>https://akliang.medium.com/how-to-rsync-directly-into-a-windows-10-machine-using-openssh-not-cygwin-or-wsl-cbbadff95712?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbbadff95712</guid>
            <category><![CDATA[rsync]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[windows-10]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 18:28:12 GMT</pubDate>
            <atom:updated>2021-08-10T18:28:12.606Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bj31A3JBbGQPwXWYZtgrcA.jpeg" /></figure><p>Windows 10 is getting closer and closer to the Linux world every day, and it’s hecking exciting.</p><p>One thing I needed to do recently was to send some files from an Ubuntu machine over to a Windows 10 machine. In the past, I would either install <a href="https://www.cygwin.com/">Cygwin </a>or install an Ubuntu instance using <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">WSL</a>. This time, I wanted to see how “native” I could go, and boy, was it a lightweight experience!</p><p>The steps here are nothing profound, but I wanted to share how I did it. I pieced the solution together by Googling multiple things, so hopefully this saves someone some time.</p><ol><li>The first thing you need to do is <a href="https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse">install OpenSSH server </a>on your Windows 10 machine. The basic gist is:</li></ol><ul><li>Open Settings →Apps →Apps &amp; Features →Optional Features</li><li>Install OpenSSH server (if it’s not already installed)</li><li>Open Powershell (in adminstrator mode)</li><li>Start the service:</li></ul><pre>Start-Service sshd</pre><pre># Optionally, set it to turn on automatically every time:<br>Set-Service -Name sshd -StartupType &#39;Automatic&#39;</pre><p><em>Troubleshooting tips:</em></p><ul><li>If you install the optional feature but it doesn’t show up in Powershell (i.e., can’t Start-Service sshd), then you might need to apply some Windows system updates. Update all the way to the latest patch and try installing the optional feature again.</li></ul><p>2. Go to your Linux box and test the connection</p><ul><li>You’ll need to know your Windows 10 username, so open up Powershell and type this:</li></ul><pre>[System.Security.Principal.WindowsIdentity]::GetCurrent().Name<br># example output: BOBCAT\tomcat</pre><ul><li>The command will return: &lt;machine_name&gt;\&lt;username&gt;. The part that you want is the “username” part (ignore the machine_name).</li><li>The password will be the same one that you use to login to your computer with. It’s either your Microsoft (Outlook) account password or your local computer username password, depending on your sign-in method. You could <a href="https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement">set up key files </a>instead, if you’d like.</li></ul><pre>ssh &lt;username&gt;@&lt;host_ip&gt;<br># eg: ssh tomcat@192.168.1.121</pre><p>3. Rsync time!</p><ul><li>The command to rsync <strong>from </strong>an Linux box <strong>to</strong> a Windows machine is:</li></ul><pre>rsync -avP --rsync-path=&#39;wsl rsync&#39; &lt;file_to_send&gt; &lt;username&gt;@&lt;host_ip&gt;:&lt;path&gt;</pre><p>OK, let’s break that down…</p><ul><li>The “-a” option is archive-mode, which tries to preserve time stamps, “-v” is verbose, and “-P” is progress indicators.</li><li>The “rsync-path” option is where the magic sauce happens. It tells the Windows 10 machine where to find its own rsync application. Without this option, the Windows 10 receiver machine will complain that it can’t find rsync.</li><li>The one last tricky bit is the “path” at the end. I haven’t fully tested this, but in my experience, the back-slashes that Windows uses (e.g., C:\User\username) does NOT work. For example, when I tried to rsync to &lt;username&gt;@&lt;host_ip&gt;:Desktop\subfolder, it ended up creating a folder named “Desktopsubfolder” in my user directory. Perhaps forward-slashes will work, or maybe some combination of double back-slashes (e.g., “Desktop\\subfolder”) so that the first back-slash is escaping the second back-slash.</li></ul><p>That’s it! I hope it’s helpful to someone out there. And also to future-me, because I know I’ll forget the next time I need to do this again…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbbadff95712" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django and Google OAuth — limiting to certain users]]></title>
            <link>https://akliang.medium.com/django-and-google-oauth-limiting-to-certain-users-1eb8709a42a5?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eb8709a42a5</guid>
            <category><![CDATA[google-oauth]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Thu, 20 May 2021 03:39:20 GMT</pubDate>
            <atom:updated>2021-05-20T03:39:20.780Z</atom:updated>
            <content:encoded><![CDATA[<h3>Django and Google OAuth — limiting to certain users</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39277u8uJE7_OUw3nRIymA.jpeg" /></figure><p>I recently started a Django project that used django-allauth to perform authentication based on Google accounts. One problem I encountered was how to limit <em>who</em> can actually log into the site. I didn’t want anyone with a Google account to be able to log in!</p><p>Google’s API does have provisions to limit only certain users from passing the authentication, but it only works during the testing phase of your API. The feature wasn’t meant for production, and is limited to 100 users. On top of that, I wanted my Google API to be a set-and-forget experience. I didn’t want the inconvenience of having to log into my Google API console just to allow a new user — there had to be a way to do it on the Django side.</p><p>The solution wasn’t that complicated at all, and I wanted to share it here in case it helps anyone else.</p><p>In your settings.py, add a line for ALLOWED_EMAILS:</p><pre># ... all your other settings.py stuff</pre><pre>ALLOWED_EMAILS=[<br>  &#39;none@none.com&#39;,<br>  &#39;example@example.com&#39;,<br>  &#39;me@me.com&#39;,<br>]</pre><p>Basically, all you want to do is check the request.user.email against this list.</p><p>How I chose to implement it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebaf46b66909d0ec20a7b8ffd61d02bb/href">https://medium.com/media/ebaf46b66909d0ec20a7b8ffd61d02bb/href</a></iframe><p>It’s probably easier to digest from bottom-to-top. The @user_passes_test(email_check) decorator will only allow users whose emails match ALLOWED_EMAILS to view the index view. Otherwise, it kicks the user back to the login view (more on that in a second).</p><p>The email_check function basically returns true is the email is found in the list, and returns false otherwise. The split up false statements was just to make it more readable for myself. If the user is anonymous, then they won’t have user.email and so I’m trying to catch that case before a “field does not exist” error is thrown. There are probably more Pythonic ways to do it — feel free to tell me yours in the comments!</p><p>Finally, the login() view has to catch the user if they got bounced by another view (such as index). If the user got bounced back to the login view by the @user_passes_test(email_check) decorator, then they <em>are</em> “authenticated” (as far as Google OAuth and Django session cookies are concerned), but they are not <em>allowed</em> based on their email — so we generate a messages.error() to let them know. In any case (authenticated-but-bounced, or not authenticated at all), we render the login.html page with a “Login with Google” button.</p><p>I hope this helps somebody! Feel free to share any improvements or corrections in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eb8709a42a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three Microsoft Word creature comforts that we take for granted]]></title>
            <link>https://medium.com/tech-sketches/three-microsoft-word-creature-comforts-that-we-take-for-granted-b5bf4224796a?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5bf4224796a</guid>
            <category><![CDATA[copy-editing]]></category>
            <category><![CDATA[adobe]]></category>
            <category><![CDATA[word-processing]]></category>
            <category><![CDATA[typography]]></category>
            <category><![CDATA[microsoft-office]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Mon, 14 May 2018 15:05:23 GMT</pubDate>
            <atom:updated>2018-05-14T15:08:12.165Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cL0XN8Pd1IzrDCrCLtgPAQ.jpeg" /></figure><p><em>Microsoft Word has tons of little built-in helper functions that we take for granted every day (other than the obvious spelling auto-correct): smart quotes, em/en dashes, and widow fixes.</em></p><p>As much as people like to hate on Microsoft products, life would be much uglier if it weren’t for them. Microsoft Word, in particular, has many subtle “beautification” functions that are constantly making adjustments to your document. We’ve gotten so used to seeing the end result of those tweaks that they’re completely invisible to us now.</p><p>Spelling auto-correct is an easy one to recognize and I believe people actively appreciate the value of that function. Today, I want to talk about three other “auto-corrects” that you may or may not have noticed!</p><p><strong>Smart close-quotes</strong></p><p>When you type a quote (“) in Word, the first instance is actually an open quote (manually created by typing alt-0147) and the second instance is a close quote (alt-0148). The same applies to single quotes (alt-0146 and alt-0147). Imaging having to keep track of and type that manually!</p><p><strong>Em dash and en dash</strong></p><p>The em dash is a long dash ( — ) is a punctuation mark similar to a comma. It offsets part of a long sentence — allowing you to write more complex sentences. To create an em dash in Word, you type two hyphens in a row without spaces (and also without spaces on either side of the two hyphens).</p><p>The en dash is a dash between two numbers — for example, when writing “70–80%”. The en dash is slightly longer than a regular hyphen and slightly shorter than an em dash. To create an en dash in Word, type two hyphens <em>with</em> spaces on either side (70&lt;space&gt;&lt;hyphen&gt;&lt;hyphen&gt;&lt;space&gt;80%).</p><p>Technically, neither of these would really be missed if Word didn’t auto-correct them, but it’s a nice touch to make a document look more elegant.</p><p><strong>Widow control</strong></p><p>An widow (in typographic terms) is a short word or short line at the top of a page. Microsoft Word fixes this by moving the last line of the previous page to the next page — resulting in a two-line beginning to the new page. If you ever wonder why you text “jumps” when you change one little word… it’s probably widow control at work.</p><p><strong>Things Microsoft Word <em>doesn’t</em> do</strong></p><p>Two things Microsoft Word <em>does not</em> do is orphan control and rag fixes. Orphans are single words on a single line, and rags are excessively jagged-looking text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfsdhkXsS52hGCa1ZuW-Bw.png" /><figcaption>A single hyphen fixes the rag!</figcaption></figure><p>This is the main difference between Microsoft Word and a more professional typesetting program like Adobe InDesign. Microsoft Word’s dictionary only contains “whole words”, whereas Adobe InDesign’s also contains a hyphenation dictionary, allowing it to insert hyphens to fix rags (like the example above).</p><p>Furthermore, everyone knows that text layout in Microsoft Word is a pain in the butt — both tables and columns have bugs that make them unreliable. Adobe InDesign allows you to set precise, rigid columns and is more intelligent about flowing text into those columns (and also flows text around inserted images better).</p><p><strong>LaTex — a possible alternative?</strong></p><p>If layout control is what you’re looking for, <a href="https://en.wikipedia.org/wiki/LaTeX">LaTex</a> may be worth a look. LaTex lets you “program” your document (similar to HTML) so you can precisely control where text appears and how it appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ru47fw02e_sZupSUKGpIQ.png" /><figcaption>Example from ShareLaTex</figcaption></figure><p>However, what you gain in absolute layout control, you lose in all the other “creature comforts” that both Microsoft Word and Adobe InDesign offer — smart quotes, em/en dashes, and orphan/widow/rag control. LaTex is a much simpler program that gives a user <em>full</em> control of the document.</p><p>To use LaTex, I personally recommend using an online program like <a href="https://www.sharelatex.com/">ShareLaTex</a>.</p><p><strong>Conclusions</strong></p><p>There’s a reason Microsoft Word is so popular — it covers most people’s use cases. But, if you need to take your document creation to the next level, you’ll find the extra typographical features of Adobe InDesign more useful (but it costs significantly more monetarily). Finally, if you prefer to have absolute control over every aspect of your document, you can check out LaTex. As an added cherry on top, LaTex is the most version-control-friendly of the 3 formats!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5bf4224796a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/three-microsoft-word-creature-comforts-that-we-take-for-granted-b5bf4224796a">Three Microsoft Word creature comforts that we take for granted</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Happy .APP day!]]></title>
            <link>https://medium.com/tech-sketches/happy-app-day-a17259354c3e?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a17259354c3e</guid>
            <category><![CDATA[domain-names]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[godaddy]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Wed, 09 May 2018 15:27:06 GMT</pubDate>
            <atom:updated>2018-05-09T17:44:49.058Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odebJY30nq8yalf8_7KiEQ.jpeg" /></figure><p>On May 8, 2018, a new top-level domain (TLD) .app joins the Internet. I put in bids to get 4 of them.. and managed to score one of them!</p><p><strong><em>Edit:</em></strong><em> I had planned to post this on May 8, but GoDaddy was so slow to put my last domain name through the auction that I didn’t get the results until this morning (May 9), so this post is a day late!</em></p><p><strong><em>Edit 2:</em></strong><em> Apparently I </em><strong><em>did</em></strong><em> manage to snag </em><em>purr.app! See the end of this article for the update.</em></p><p>Google bought the rights to the .app TLD back in 2015 for <a href="https://www.pcmag.com/article2/0,2817,2477594,00.asp">$25 million dollars</a>. (.com, .net, and .org are other common TLDs you may recognize.) Starting on May 1, 2018, you could register a .app domain name through a number of domain name registrars (such as GoDaddy and Gandi), except there was a catch.</p><p>The period from May 1 to May 7 was a “pre-registration” period. You can pay an “Early Access” fee (~$140) to register your domain name before anyone else gets it first. After that, on May 8, the general public can register a .app domain name regularly (for about ~$20).</p><p>You can register a .app domain before May 8 and not pay the Early Access fee, but your registration will just be queued until May 8. So, since I’m cheap and didn’t want to pay the Early Access fee, I decided to try my luck and register 4 domain names early to see what I could get on May 8:</p><pre>meow.app</pre><pre>purr.app</pre><pre>woof.app</pre><pre>meo.app</pre><p>bark.app was already gone and meo.app was a typo, but it was available so why not! Registering the domains was the fun and easy part, but then the negative news started rolling in.</p><p>First, I lost meo.app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*IkE1K7eKZkYcILAn5Jx9cQ.png" /></figure><p>Apparently trademark holders get first-pick on new domain names. (No, I do not know who/what the heck “Meo” is.)</p><p>Next, I lost meow.app: (darn, I’m actually kind of sad about this one)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*4wlMJIAEFKefhsQVSukxpg.png" /></figure><p>And then I lost woof.app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*gnYNdLcboVNjQWq4U_jKrg.png" /></figure><p>On May 8, I anxiously checked GoDaddy throughout the day to see if the last domain name (purr.app) would actually go through. After seeing no results, I eventually hopped on support chat, and they told me that GoDaddy hadn’t processed the domain names yet.</p><p>On May 9, I got an email from GoDaddy saying I got purr.app!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*811IEOCT0WQ4vLHPlDNpFw.png" /></figure><p>So… the question is, what to do with my shiny new domain name?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN8wxZsHBoVwNXa5neMoNg.jpeg" /><figcaption>Purrrrrrr…..</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a17259354c3e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/happy-app-day-a17259354c3e">Happy .APP day!</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Amazon Prime still worth it?]]></title>
            <link>https://medium.com/tech-sketches/is-amazon-prime-still-worth-it-c00b45ddc3b9?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c00b45ddc3b9</guid>
            <category><![CDATA[amazon-prime]]></category>
            <category><![CDATA[free-shipping]]></category>
            <category><![CDATA[online-shopping]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[budgeting]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Mon, 07 May 2018 14:01:01 GMT</pubDate>
            <atom:updated>2018-05-07T14:01:01.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3J5kRuw3GHQMMQiTqkVdA.jpeg" /></figure><p>Amazon’s raising the cost of Prime by 20%… am I even getting $120 worth of value from it? (TL;DR — No, I’m not, but I’m keeping Prime anyway.)</p><p>With the recent news that Amazon is upping their Prime membership fee from $99 to $119, several tech articles have come out discussing whether Prime is still worth it.</p><p>I decided to take analyze my own personal purchases to help me decide.</p><p>In the year 2017, I made 32 Amazon purchases. I categorized them into “standard”, “fluffy” (excessively voluptuous), and “heavy” (excessively overweight) shipments and calculated how much shipping would have cost if I didn’t use Prime:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f643811143ae92959d0fc2827e3aa25e/href">https://medium.com/media/f643811143ae92959d0fc2827e3aa25e/href</a></iframe><p>Using a non-Prime account, I checked the shipping prices if I didn’t hit the $25 minimum:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e81e946d89f96fa97b3c5ff29c93650b/href">https://medium.com/media/e81e946d89f96fa97b3c5ff29c93650b/href</a></iframe><p>Of the 32 orders I made in 2017, only 6 of them were under $25 and I would have been forced to pay for shipping. Luckily, all of them were “standard” orders. At the very minimum, I would’ve paid $40.45 in shipping. If I wanted them at the same speed as my current Prime orders, I would’ve paid $74.04.</p><p>Neither of these numbers came close to the $99 Prime membership fee I was originally paying, which makes the new $20 price hike an even worse deal.</p><p>Compounding on top of all of that, having an Amazon Prime membership <a href="http://bgr.com/2017/10/18/how-much-do-amazon-prime-members-spend/">double the amount of purchases you make</a>, meaning I would’ve only paid for half that much in shipping on average.</p><p>But, ultimately, I will be keeping my Amazon Prime membership. Here’s a laundry list of secondary benefits I enjoy through my Prime membership:</p><ul><li>full-resolution photo backups to <a href="https://www.amazon.com/Cloud-Drive-Storage/b?ie=UTF8&amp;node=13234696011">Amazon Prime Photos</a></li><li>the occasional show or movie that I watch on Amazon Prime Video</li><li>the <a href="https://www.amazon.com/Amazon-Rewards-Visa-Signature-Card/dp/B007URFTYI">extra 2% cashback</a> I get on my Amazon Rewards Visa credit card</li><li>and, a free <a href="https://www.amazon.com/Amazon-com-Gift-Card-Holiday-Teddy/dp/B0763M48Q8">Gund stuffed bear</a> every year via their Christmas “buy an Amazon gift card” promo</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HezI7afHoWeHTyV_1JE4g.jpeg" /></figure><p>Finally, because I share my Prime membership with multiple people (I was grandfathered in when they used to let you share with up to 5 people), the net benefit from everyone on the account probably exceeds the $99 (or $119) that I pay each year.</p><p><strong>Extra bonus:</strong> Did you know there are Prime-exclusive items on Amazon? I did not know this until I was trying to find shipping costs for non-Prime members…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*-71IKT7MyEFhRVQYetlFVg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c00b45ddc3b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/is-amazon-prime-still-worth-it-c00b45ddc3b9">Is Amazon Prime still worth it?</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Typing Chinese faster: QWERTY vs T9 keyboards]]></title>
            <link>https://medium.com/tech-sketches/typing-chinese-faster-qwerty-vs-t9-keyboards-542a60c978d6?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/542a60c978d6</guid>
            <category><![CDATA[typing]]></category>
            <category><![CDATA[t9]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[touchscreen]]></category>
            <category><![CDATA[chinese]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Mon, 30 Apr 2018 14:01:02 GMT</pubDate>
            <atom:updated>2018-04-30T14:01:02.389Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzyH1QswyMXXY9PQMqDbYQ.jpeg" /></figure><p>Unlike English, smartphone keyboards are not well-optimized for Chinese input. “Swiping” was a new invention that made writing English words bearable, but for Chinese, it’s less than ideal.</p><p>For starters, Chinese “words” are too short and too similar for swiping to accurately decode. Try swiping “the cow intently squints at your rice” in Chinese (母牛努力瞇你米 — muniu nuli mi nimi).</p><p>Furthermore, the frequency of letters used in Chinese is very different than English. The above example contains a disproportionate number of “i” and “u” letters compared to “a”, “e”, and “o”.</p><p>Of course, my little example above is a little extreme. To make a fairer comparison, let’s look at the <a href="https://www.patrick-wied.at/projects/heatmap-keyboard/">heatmap</a> of “<a href="http://generator.lorem-ipsum.info/_chinese">Lorem Ipsum</a>” in both English and Chinese.</p><pre>Lorem ipsum dolor sit amet, impedit sadipscing consectetuer ei est. Doctus argumentum in sit, nostro signiferumque ad nam. Per et veniam invenire, qui tantas vocent nominavi an. Per nisl prodesset ei, ex per omnium molestiae. Nec solet periculis voluptatum ad, et causae hendrerit efficiendi eam.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*UQwShHGLSJ0pibpN9NNelA.png" /><figcaption>English Lorem Ipsum heatmap</figcaption></figure><pre>他向商対話料無巡議効情際長。抜拭携鉱写極協発給茶一質済展。写中調差無俳車舞学京宣宮条通。<br>ta xiang shang duihua liao wu xun yi xiao qing ji change ba shi xie kuang xie ji xie fagei cha yi zhi ji zhan xie zhong tiao cha wu pai che wu xie jing xuan gong tiao tong</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*h2RvXG8JMkGDSc7cuW9ocg.png" /><figcaption>Chinese Lorem Ipsum heatmap</figcaption></figure><p>Both English and Chinese have extreme emphasis on some letters (“e” in the English example and “i” in the Chinese example), but the Chinese example has much less purple in general. Chinese input on QWERTY does not distribute the letter frequency across the keyboard as well as English.</p><p>Now, if we switch to a T9 keyboard layout, the Chinese Lorem Ipsum example looks a little bit more uniformly distributed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*omxOU1SZq4IUQS5HpRgdPA.png" /><figcaption>Chinese Lorem Ipsum heatmap on T9 keyboard</figcaption></figure><p>Yes, there’s still a heavy emphasis on the “4” key, but the color distribution is much better — which should, in theory, mean you can type more efficiently since touchscreen input only uses 2 fingers. In the QWERTY case, one of your fingers is eternally trapped near the letter “i” and you’re basically typing with 1 finger.</p><p>Another advantage of T9 is that the layout is more compact, allowing you to type with just one hand (irrespective of English or Chinese).</p><p>I loved T9 dearly in the early pager and cell phone day, and I’m happy to see it still has a place in this modern era of smartphones and touch screens. If you type Chinese on your smartphone, I encourage you to give T9 a try! There’s a small learning curve, but the long-term payoff is worth it!</p><p>For those curious, here’s English Lorem Ipsum on T9:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*SUQ6xLeom_PpdhnSfjTxYQ.png" /><figcaption>English Lorem Ipsum heatmap on T9 keyboard</figcaption></figure><p>The key frequency is nearly evenly distributed over 6 of the 8 keys. (The “1” key does not count.) If it weren’t for swiping, perhaps English touchscreen input should go back to T9 as well!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=542a60c978d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/typing-chinese-faster-qwerty-vs-t9-keyboards-542a60c978d6">Typing Chinese faster: QWERTY vs T9 keyboards</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password “hacking”: a server-side perspective]]></title>
            <link>https://medium.com/tech-sketches/password-hacking-a-server-side-perspective-58d425ab9758?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/58d425ab9758</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[password-management]]></category>
            <category><![CDATA[password-security]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[it-security]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Mon, 23 Apr 2018 19:40:10 GMT</pubDate>
            <atom:updated>2018-04-23T19:45:00.372Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxwl0_gdFfhnpXeh8RozCA.jpeg" /></figure><p>What happens when a server gets hacked? How do servers store username/password combinations?</p><p>All too frequently these days, we read a news article or receive an email saying <a href="http://money.cnn.com/2017/10/03/technology/business/yahoo-breach-3-billion-accounts/index.html">so</a>-<a href="http://money.cnn.com/2017/11/22/technology/uber-hack-consequences-cover-up/index.html">and</a>-<a href="https://www.wired.com/story/under-armour-myfitnesspal-hack-password-hashing/">so</a> has been hacked and X amount of user/passwords have been stolen (among other things like birthdays, security questions, and even <a href="https://www.theverge.com/2017/9/22/16345580/equifax-data-breach-credit-identity-theft-updates">social security numbers</a>…).</p><p>So what exactly do hackers get when they steal a bunch of data from servers? Well, hopefully they didn’t get your passwords in plain text (looking at you, <a href="https://arstechnica.com/tech-policy/2011/06/sony-hacked-yet-again-plaintext-passwords-posted/">Sony</a>). What they usually get is something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/886fa897c9779d680ddfed839940f668/href">https://medium.com/media/886fa897c9779d680ddfed839940f668/href</a></iframe><p>That second column of incomprehensible text is called a hash. (For this example, Bob’s password was “hello” and the first 6 characters from the MD5 hash was saved. Sally’s password was “goodbye”.)</p><p>A hash function is a one-way function — meaning you can <em>create</em> a hash from a password, but cannot “undo” the hash to figure out the actual password. This is the reason most websites send you “password reset” links instead of emailing your actual password.</p><p>To log in, you type in your password and the server runs it through the hash function, then checks if the hash of what you just typed matches the hash in their database for your username.</p><p>So, unless the website is <em>extremely stupid </em>(<strong>*cough*</strong> Sony <strong>*cough*</strong>), when a hacker steals millions of user accounts, they will only get a bunch of hash values. Now, they have to randomly guess until they figure out what your original password was.</p><p>However, <strong>multiple passwords can map to the same hash</strong>. In the above example, Bob’s password can be cracked in 2 minutes and 10 seconds using a simple Python script:¹</p><pre>Hash is &#39;5d4140&#39;.<br>Password cracked using &#39;14xdof5a&#39;.<br>It took 18650129 tries.</pre><pre>Time: 2m10.066s</pre><p>If the hacker types “14xdof5a” into the password field, they will also successfully log in as Bob.</p><p>So what does this mean for the everyday user? Well, for starters, when your credentials have been stolen during a hack, you’re not <em>immediately</em> in danger. It’ll take time to crack the password before they can use it.</p><p>However, you <em>are</em> in danger if:</p><ul><li>The company that got hacked doesn’t discover the hack right away</li><li>Or, they fail to report it to the public right away</li><li>Or, you use the same username/password combination on multiple websites</li></ul><p>The last point is really the only thing in your control. While a password manager (such as <a href="https://keepassxc.org/">KeepassXC</a>) is the best way to go, it’s might feel too cumbersome to use. If you use the same password for everything, then one simple way to mix things up is to append a word to the beginning or end of your password. For example, “bankmelissa1988” and “gmailmelissa1988” are technically two very different passwords, but as the password-owner, it’s abundantly clear which password to use where.</p><p>If you <em>really</em> want to mix things up, I would recommend taking a look at my <a href="https://blog.albertliang.me/multi-cultural-passwords-an-evolution-of-correct-horse-battery-staple-407372a4b30">multicultural passwords</a> post, which is also a fairly easy way to increase password strength.</p><p>That’s all for this week! I hope it was helpful!</p><p>¹ I ran this on a Macbook Pro using a single core. A desktop computer and/or multiple cores would crack the password much faster.</p><pre># Simple password hacking script<br># Written in a hurry by Albert Liang</pre><pre>import hashlib, random, string<br><br>match=&#39;5d4140&#39;<br>print(&quot;Hash is &#39;%s&#39;.&quot; % match)<br><br>count=0<br>xhash=&#39;&#39;<br><br>while xhash != match:<br>  x=&#39;&#39;.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8))<br>  xhash=hashlib.md5(x).hexdigest()[:6]<br>  count += 1<br><br>print(&quot;Password cracked using &#39;%s&#39;.&quot; % x)<br>print(&quot;It took %d tries.&quot; % (count))</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58d425ab9758" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/password-hacking-a-server-side-perspective-58d425ab9758">Password “hacking”: a server-side perspective</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-cultural passwords: an evolution of “correct horse battery staple”]]></title>
            <link>https://medium.com/tech-sketches/multi-cultural-passwords-an-evolution-of-correct-horse-battery-staple-407372a4b30?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/407372a4b30</guid>
            <category><![CDATA[lifehacks]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[password-security]]></category>
            <category><![CDATA[second-language]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 15:56:18 GMT</pubDate>
            <atom:updated>2018-04-19T15:56:18.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*7v6djGHv-AC6Jeg9I5Eamg.png" /><figcaption><a href="https://xkcd.com/936/">https://xkcd.com/936/</a></figcaption></figure><p>Ah, the stressful art of creating a password… something “secure” but “easy to remember”.</p><p>XKCD did a pretty good job presenting a good, user-friendly method. I more or less follow that pattern now, but with a slight twist. While correcthorsebatterystaple <em>is</em> a very long password, it’s technically only composed of 4 dictionary words. Dictionary attacks are slightly more cumbersome than straight-up brute forcing, but not <em>as difficult </em>as one would assume. There are 26 letters in the English alphabet, and there are probably only ~10,000 common words, so while the number of possible options has increased, you’ve also decreased the number of distinct objects from ~10 (for a 10-letter password) to 4.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a59a86c098f3a0336e7e7efe196bcf17/href">https://medium.com/media/a59a86c098f3a0336e7e7efe196bcf17/href</a></iframe><p>Using a setup that can compute <a href="https://arstechnica.com/information-technology/2012/12/25-gpu-cluster-cracks-every-standard-windows-password-in-6-hours/">350 billion guesses per second</a>, the above two examples will be cracked in <em>a maximum of </em>403 seconds and 7.9 hours, respectively. The password could be cracked much sooner if an earlier guess is correct.</p><p>Another way to test password strength is to use a helpful tool created by Dropbox called <a href="https://github.com/dropbox/zxcvbn">zxcvbn</a>. (It’s the bottom 6 letters of a standard qwerty keyboard.)</p><p>Let’s check correcthorsebatterystaple using zxcvbn:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*YBZysHU08apfIb0Dr4qrAw.png" /><figcaption>Only 8 hours to crack!</figcaption></figure><p>Technically, zxcvbn says it’s already strong, but what if, instead of using standard English words, you incorporate words from a different language? Changing correct to correcto (Spanish):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*7m4KAB29D82vuwQuEFpv9A.png" /><figcaption>Now it takes 29 days!</figcaption></figure><p>The complexity instantly jumps up by orders of magnitude. At 10 billion guesses per second, it increases from 8 hours (for correcthorsebatterystaple) to 29 days (for correctohorsebatterystaple). If Spanish is your second language, this change is trivial for you to remember.</p><p>However, this trick only works because you’re using <em>two or more</em> languages. I would caution against converting your entire password into a different, non-English language. For example, if we try correcthorsebatterystaple in Chinese (對馬電池訂書針), the results looks quite promising, but…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*vT12BhkAiWP0BbMZJRzgqg.png" /><figcaption>Practically impossible to brute-force, but zxcvbn only assumes an English dictionary attack</figcaption></figure><p>… there are only about 10,000 common words in Chinese as well (same as English). This password is about as easy to crack at the original. By combining two languages, we force the dictionary attack to consider 20,000 possible words instead!</p><p>So, with just a small modification (incorporating a second, familiar language or culture) and a little bit of discipline (not changing your <em>entire</em> password to that second language), you can very easily amplify the strength of your passwords.</p><p>Go forth and be safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=407372a4b30" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/multi-cultural-passwords-an-evolution-of-correct-horse-battery-staple-407372a4b30">Multi-cultural passwords: an evolution of “correct horse battery staple”</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Block chain social network (Part 2): Facebook’s history and minimal needs]]></title>
            <link>https://medium.com/tech-sketches/block-chain-social-network-part-2-facebooks-history-and-minimal-needs-fa29682559e3?source=rss-ab51cb02cfe3------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa29682559e3</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[social-network]]></category>
            <category><![CDATA[facebook]]></category>
            <dc:creator><![CDATA[Albert Liang]]></dc:creator>
            <pubDate>Wed, 18 Apr 2018 20:59:37 GMT</pubDate>
            <atom:updated>2018-04-19T04:02:56.100Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ideX3zDPwotOOjS9gc2Ofg.jpeg" /></figure><p><em>This is Part 2 of my “block chain social network” series of posts. Check out the previous post on this topic: </em><a href="https://blog.albertliang.me/an-open-discussion-about-a-facebook-alternative-based-on-blockchain-technology-part-1-26fdecaa4c39"><em>Part 1 — An open discussion about a Facebook alternative based on blockchain technology</em></a></p><p>The hardest part of overcoming the behemoth that is Facebook is having enough features to satisfy the social network needs of the user.</p><p>It’s helpful to look at a general evolution of how Facebook became the platform it is today:</p><ul><li>2004: Facebook begins</li></ul><p>Facebook starts with as a simple idea — be an online phonebook for your peers at school. Early Facebook let you upload your biographical info and photos, and that was about it. There wasn’t even a “wall” for you to write on other people’s pages. You used to be able to poke someone. That was fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*8u_5qS2m640XHTEwiU7ALw.png" /></figure><ul><li>2007: Facebook Platform</li></ul><p>Between 2004 and 2007, Facebook’s main product (the profile page) evolved to be more full-fledged. I don’t have exact details, but features like “writing on someone’s wall”, birthday notifications, tagging photos, etc. were rolled out over time. To me, the next big evolution in Facebook was the introduction of the Facebook Platform — a programmable API that hooked into the neural net of friends and relationships and allowed the formation of companies like Zynga. (No link given, out of personal dislike for this company.)</p><p>Ironically, Facebook Platform is what Cambridge Analytica used to access all that user data.</p><ul><li>2010: Facebook Messenger</li></ul><p>Honestly, the major milestones from here on out are getting insignificant — mostly because Facebook is already quite a mature product by now. I’d say the next big step in Facebook history is the official spin-off of Messenger. Previously, it had resided as a built-in chat function of the main Facebook page, but this official launch represented Facebook’s intent to mature the chat platform into what it is today — with voice and video calling, the ability to send money, etc.</p><ul><li>Present</li></ul><p>I can’t quite catalog what significant changes have happened to Facebook over the last 8 years. They added reactions instead of a simple “Like”, made a much stronger push for business and celebrity Pages, added Live Streaming, and acquired <a href="https://techcrunch.com/2012/04/09/facebook-to-acquire-instagram-for-1-billion/">Instagram</a>, <a href="http://money.cnn.com/2014/02/19/technology/social/facebook-whatsapp/index.html">Whatsapp</a>, and <a href="https://techcrunch.com/2014/07/21/facebooks-acquisition-of-oculus-closes-now-official/">Oculus</a>. They have 2.2 billion users. <a href="http://fortune.com/2018/04/10/facebook-mark-zuckerberg-congressional-grilling/">Zuckerberg “won” his Congressional hearing</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itpAdE6O7ldkLqBqvW2ZTA.jpeg" /></figure><p>So that brings us back to the original question… what’s the minimum set of features that people need in order to replace Facebook? I believe the answer lies in Facebook’s early history.</p><ul><li>Profile information</li><li>Sharing and organization of photos and videos</li><li>The “wall” (some form of short, easy broadcasting platform)</li><li>Timeline (some form of passive news update method)</li></ul><p>Personally, I think that’s it. Who needs chat when half a dozen chat apps fill different niches? Businesses and celebrities might miss Pages, but will the average user? I <strong>definitely</strong> don’t think a new social network needs a programmable API… that’s what got us into this mess to begin with.</p><p>What are your thoughts? Am I missing any other essential features that would make-or-break a competitive social network to Facebook?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa29682559e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-sketches/block-chain-social-network-part-2-facebooks-history-and-minimal-needs-fa29682559e3">Block chain social network (Part 2): Facebook’s history and minimal needs</a> was originally published in <a href="https://medium.com/tech-sketches">Tech Sketches</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>