This repository has been archived on 2022-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
blog.old/output/feeds/notes.atom.xml

100 lines
19 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Ali Murteza Yesil - Notes</title><link href="https://murtezayesil.me/" rel="alternate"></link><link href="https://murtezayesil.me/feeds/notes.atom.xml" rel="self"></link><id>https://murtezayesil.me/</id><updated>2020-12-31T12:00:00+06:00</updated><subtitle>Blog</subtitle><entry><title>Blog in Progress #1</title><link href="https://murtezayesil.me/blog-in-progress-1.html" rel="alternate"></link><published>2020-12-31T12:00:00+06:00</published><updated>2020-12-31T12:00:00+06:00</updated><author><name>Ali Murteza Yesil</name></author><id>tag:murtezayesil.me,2020-12-31:/blog-in-progress-1.html</id><summary type="html">&lt;p&gt;Removed Google Fonts dependency to load the page faster and discovered an issue where MP4 viewer won't load video.&lt;/p&gt;</summary><content type="html">&lt;div style="text-align: center;"&gt;
&lt;img src="images/gifs/construction_progress_bar.gif" alt="Under Construction GIF"&gt;
&lt;/div&gt;
&lt;p&gt;I am redesigning this blog's theme piece by piece. But there is a possibility that you will be reading this article after the new theme is applied. So &lt;a href="images/screenshots/index_full_page_screenshot_w760.webp" title="Old index page"&gt;here is a reference screenshot&lt;/a&gt; before new theme is applied. Theme isn't the only change. I have few more changes in mind to extend blog's features and optimize it even further.&lt;/p&gt;
&lt;p&gt;If you want to know how well does this page performed in GTmetrix with old theme, &lt;a href="extra/gtmetrix_murtezayesil.me_2020_08_16.pdf"&gt;here is the report&lt;/a&gt; in PDF.&lt;/p&gt;
&lt;h1&gt;Removing Google Font dependency&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://www.yanone.de/fonts/kaffeesatz/"&gt;Yanone's Kaffeesatz font&lt;/a&gt; is beautiful, but it takes almost 300ms to load. Even though it is as small as 20KB, it is something that is not needed.&lt;/p&gt;
&lt;p&gt;Another reason I want to remove it is that, it is embedded through Google Fonts which also loads some Google API code. It would be ironic to not respect my readers while I am going through digital cleansing and de-Googling myself.&lt;/p&gt;
&lt;p&gt;Fun Fact: My IndieWeb profile image is 1024 by 1024 PNG and is 174 KB, around 9 times the Yanone's Kaffesatz font from Google Fonts, but still takes a third less time to download. That being said, it isn't displayed anywhere and shouldn't be loaded unless explicitly wanted. 128x128 would be fine too. 1024x1024 is an overkill for an image that isn't displayed 😬️&lt;/p&gt;</content><category term="Notes"></category><category term="100DaysToOffload"></category></entry><entry><title>Deleting Amazon account</title><link href="https://murtezayesil.me/deleting-amazon-account.html" rel="alternate"></link><published>2020-07-26T21:15:00+06:00</published><updated>2020-07-26T21:15:00+06:00</updated><author><name>Ali Murteza Yesil</name></author><id>tag:murtezayesil.me,2020-07-26:/deleting-amazon-account.html</id><summary type="html">&lt;p&gt;Deleting Amazon account has more steps (friction) than I would like. But not impossible.&lt;/p&gt;</summary><content type="html">&lt;p&gt;I call it "deleting account", Amazon calls it "closing account". I used them interchangibly in this post.&lt;/p&gt;
&lt;p&gt;If you set your mind to delete (or close) your account, don't let too many steps discourage you. I understand that some people run their businesses on AWS and deleting their Amazon account will also delete AWS servers connected to that account. Amazon has given me 2 warnings about it and accepted to delete my account anyway. I wasn't invested in Amazon ecosystem and never used AWS anyway.&lt;/p&gt;
&lt;p&gt;According my experience, here are the steps you may need to go through:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click on &lt;a href="https://www.amazon.com/gp/help/customer/display.html" title="Currently this page"&gt;Help&lt;/a&gt; in the page footer and search for "close account".&lt;/li&gt;
&lt;li&gt;You will be presented with an article that warns you about Amazon services you will lose access to. Read and make sure you stopped using those services already.&lt;/li&gt;
&lt;li&gt;There is "&lt;strong&gt;Note:&lt;/strong&gt; To close your account, please &lt;a href="https://www.amazon.com/hz/contact-us/request-data"&gt;Contact Us&lt;/a&gt; to request that your account be closed." at the very end of the help page. Click on "Contact Us" to continue.&lt;/li&gt;
&lt;li&gt;If not yet logged in you will be asked to, login. Choose email for communication. There is also an option to call but I don't know how would that go since I don't live in US or Canada.&lt;/li&gt;
&lt;li&gt;They will send the same help article with a bit more information and links to make sure you stopped using everything such as AWS, Alexa, Kindle Publishing, Prime video, Amazon Music etc. Near the end of email you will see "If you still want to close your Amazon.com account after reviewing the items above, please click this link and state that you want to close your account: &lt;em&gt;Some Link&lt;/em&gt;", click on the link.&lt;/li&gt;
&lt;li&gt;It will open a page with a text box. Write why you want to close your account and submit. If you are not sure what to write and also feeling adventurous, you can copy paste this link : https://www.youtube.com/watch?v=dQw4w9WgXcQ&lt;/li&gt;
&lt;li&gt;They will email you within 24 hours either for more instructions or to tell you that your account is closed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Depending on where you live or how many Amazon services you used, you may need to go through more steps.&lt;/p&gt;</content><category term="Notes"></category><category term="100DaysToOffload"></category></entry><entry><title>$ADB_VENDOR_KEYS is not set</title><link href="https://murtezayesil.me/adb_vendor_keys-is-not-set.html" rel="alternate"></link><published>2020-07-22T00:00:00+06:00</published><updated>2020-07-22T00:00:00+06:00</updated><author><name>Ali Murteza Yesil</name></author><id>tag:murtezayesil.me,2020-07-22:/adb_vendor_keys-is-not-set.html</id><summary type="html">&lt;p&gt;Authorizing adb when no prompt will come, the hard way.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Story&lt;/h2&gt;
&lt;p&gt;I like &lt;a href="https://github.com/Genymobile/scrcpy" title="scrcpy by Genymobile - GitHub"&gt;scrcpy&lt;/a&gt;. It allows me to cast my phone to computer and use it ther thanks to cable technology (wifi works too). So, after hopping to &lt;img src="https://fosstodon.b-cdn.net/custom_emojis/images/000/025/123/static/a76f54a7dbcd8afd.png" width="15em" height="15em"&gt; Pop_OS! I reinstalled adb and scrcpy.
But this time scrcpy didn't work. Instead it throw this error:&lt;br&gt;
&lt;blockquote style="font-style: normal;"&gt;
&lt;code&gt;
adb: error: failed to get feature set: device unauthorized.&lt;br&gt;
This adb server's $ADB_VENDOR_KEYS is not set&lt;br&gt;
Try 'adb kill-server' if that seems wrong.&lt;br&gt;
Otherwise check for a confirmation dialog on your device.&lt;br&gt;
ERROR: "adb push" returned with value 1
&lt;/code&gt;
&lt;/blockquote&gt; &lt;/p&gt;
&lt;h2&gt;Easy way | Grant access using prompt on the phone&lt;/h2&gt;
&lt;p&gt;After enabling &lt;a href="https://www.howtogeek.com/129728/how-to-access-the-developer-options-menu-and-enable-usb-debugging-on-android-4.2/"&gt;USB debugging in Developer options&lt;/a&gt; connect phone to computer and run &lt;code&gt;scrcpy&lt;/code&gt;. Phone should prompt you for granting access to computer. All you have to do is accept and connection will be granted 🎉️&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;This prompt didn't appear on my phone. As it turns out, that prompt doesn't works as expected on some custom ROMS. After some digging online, I came across &lt;a href="https://stackoverflow.com/a/26309956"&gt;this answer on stack &lt;strong&gt;overflow&lt;/strong&gt;&lt;/a&gt;. Which leads to a &lt;a href="https://android.googlesource.com/platform/system/core/+/d5fcafaf41f8ec90986c813f75ec78402096af2d"&gt;commit message for (new) adb authentication&lt;/a&gt; implemented in 2012. This prompt copies ~/.android/adbkey.pub on computer, &lt;code&gt;$ADB_VENDOR_KEYS&lt;/code&gt;, to &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt; file in phone's memory. since prompt isn't working for me I have to add that key manually 😕️&lt;/p&gt;
&lt;h2&gt;Littler harder way | copy-paste using Termux + root&lt;/h2&gt;
&lt;p&gt;Since &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt; file is offlimits for the user, we need root priviledges for this method.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy ~/.android/adbkey.pub to phone's memory&lt;/li&gt;
&lt;li&gt;Open Termux and install sudo &amp;gt; &lt;code&gt;pkg install tsu&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Navigate to where file adbkey.pub is. I'm using Redmi Note 4 and its &lt;code&gt;/sdcard&lt;/code&gt; directory is used for .&lt;br&gt;
File is at &lt;code&gt;/sdcard/adbkey.pub&lt;/code&gt; in my case &amp;gt; &lt;code&gt;cd /sdcard&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Copy &lt;code&gt;adbkey.pub&lt;/code&gt; to &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt; with sudo priviledges &amp;gt; &lt;code&gt;sudo cp adbkey.pub /data/misc/adb/adb_keys&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Double check if content of &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt; on phone and &lt;code&gt;~/.android/adbkey.pub&lt;/code&gt; on computer are the same&lt;/li&gt;
&lt;li&gt;Enjoy 😊️&lt;/li&gt;
&lt;/ol&gt;
&lt;video width="720" height="auto" controls="controls"&gt;
&lt;source src="https://murtezayesil.me/videos/copying_adb_vendor_keys_using_termux_and_root.mp4" type="video/mp4"&gt;
Your browser does not support the video tag.
&lt;/video&gt;
&lt;hr&gt;
&lt;h2&gt;Hard way | copy-paste using TWRP&lt;/h2&gt;
&lt;p&gt;This is the "no-root" hard method. You will still need root priviledges to edit &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt;. If your phone isn't rooted but has TWRP, GREAT. TWRP has root priviledges and a file manager.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Boot into TWRP by holding Vol+ and Power keys while the phone is turned off.&lt;/li&gt;
&lt;li&gt;Connect phone to computer&lt;/li&gt;
&lt;li&gt;Copy ~/.android/adbkey.pub to phone's memory&lt;/li&gt;
&lt;li&gt;Go to Advanced &amp;gt; File manager&lt;/li&gt;
&lt;li&gt;Navigate to where adbkey.pub was copied to. I am using Redmi Note 4 and MTP connects to &lt;code&gt;/sdcard&lt;/code&gt; on this device.&lt;/li&gt;
&lt;li&gt;Copy &lt;code&gt;adbkey.pub&lt;/code&gt; to &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Delete &lt;code&gt;adb_keys&lt;/code&gt; in &lt;/li&gt;
&lt;li&gt;Rename &lt;code&gt;adbkey.pub&lt;/code&gt; to &lt;code&gt;abd_keys&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Double check if content of &lt;code&gt;/data/misc/adb/adb_keys&lt;/code&gt; on phone and &lt;code&gt;~/.android/adbkey.pub&lt;/code&gt; on computer are the same&lt;/li&gt;
&lt;li&gt;Enjoy 😊️&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt="SCRCPY is casting Android phone's screen on to computer after manually copying computer's adbkey.pub file to phone's adb_keys file" src="images/scrcpy_casting_android_to_computer.png" title="scrcpy is finally working"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;It was a little annoying adventure for me to find where the adbkey.pub suppose to go. I am not immitated with having to do that thing manually. I was annoyed that this information isn't out there in Android documentations and requires reading answers from 2014 on stack &lt;strong&gt;overflow&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;I hope this guide was helpful to you 😊️&lt;/h3&gt;</content><category term="Notes"></category><category term="android"></category><category term="problem"></category><category term="100DaysToOffload"></category></entry><entry><title>FizzBuzz with single semicolon</title><link href="https://murtezayesil.me/fizzbuzz-with-single-semicolon.html" rel="alternate"></link><published>2020-07-20T00:00:00+06:00</published><updated>2020-07-20T00:00:00+06:00</updated><author><name>Ali Murteza Yesil</name></author><id>tag:murtezayesil.me,2020-07-20:/fizzbuzz-with-single-semicolon.html</id><summary type="html">&lt;p&gt;Attempt to write an eccentric FizzBuzz program with as few semicolon as possible.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Semicolon is a bit special in Rust. It only comes after statements, not expressions. that includes codeblock returns. This gave me a silly idea.&lt;/p&gt;
&lt;h2&gt;How many semicolons needed to write a FizzBuzz program in Rust?&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// for every number from 1 to 100&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;println&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;{}&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// check if number is&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// divisible by both 3 &amp;amp; 5&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;fizzbuzz&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// if so return &amp;quot;fizzbuzz&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// divisible by 3&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;fizz&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// if so return &amp;quot;fizz&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// divisible by 5&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;buzz&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// if so return &amp;quot;buzz&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// but if not&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_string&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// return number as String&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// print returned value&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h1 style="text-align: center;"&gt;1&lt;/h1&gt;
&lt;p&gt;There is also &lt;a href="https://github.com/Keith-S-Thompson/fizzbuzz-c/blob/master/fizzbuzz004.c" title="Brute forcing FizzBuzz in C"&gt;brute forcing method&lt;/a&gt; 🤦‍♂️️&lt;/p&gt;</content><category term="Notes"></category><category term="code"></category><category term="100DaysToOffload"></category></entry></feed>