<?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[LifeOps — One problem at a time. - Medium]]></title>
        <description><![CDATA[Figuring out problem one at a time, tech or non-tech - Medium]]></description>
        <link>https://medium.com/devops-one-problem-at-a-time?source=rss----4133a785597f---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>LifeOps — One problem at a time. - Medium</title>
            <link>https://medium.com/devops-one-problem-at-a-time?source=rss----4133a785597f---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:30:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/devops-one-problem-at-a-time" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Controlling Humidity for Ukulele]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/controlling-humidity-for-ukulele-1b6de8c3cf78?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/1b6de8c3cf78</guid>
            <category><![CDATA[ukulele]]></category>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[humidity-control]]></category>
            <category><![CDATA[guitar]]></category>
            <category><![CDATA[esphome]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Sat, 07 Jan 2023 01:58:16 GMT</pubDate>
            <atom:updated>2023-02-08T19:14:35.688Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PjvmZp9S59_veomb" /><figcaption>Photo by <a href="https://unsplash.com/@idgeek?utm_source=medium&amp;utm_medium=referral">Samuel Ramos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Problem</h3><p>Wooden musical instruments such as guitar and ukulele are best kept in humidity control environment, somewhere between 40% — 60%. This prevents wood from being too dry which causes cracking or warping.</p><p>For dry region like California or Arizona, it’s either</p><ol><li>Use humidifier for the room.</li><li>Have a case with humidity control. Either with electric humidifier or humidity pak.</li></ol><p>Although common for cigars, instruments are pretty big to build a humidity control case. Some company does offer such solution.</p><p><a href="https://www.acousticremedycases.com/products/ukulele-wall-model?variant=18225148854329">Ukulele ClimaCase | Triangle</a></p><p>Which is a nice wooden box to seal ukulele in. Inside, you can either connect a humidifier or place Boveda humidity control pak that will release moisture if humidity is too low, and absorb is it’s too high.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjF5M5V8lyJr_1tK02bnag.jpeg" /><figcaption>Boveda Humidity Control Pak</figcaption></figure><p>Case looks really nice, but at $850 a pop, I wanted to see if a cheaper solution can be done. I can try to build a case myself, but probably not gonna be much cheaper. Since I didn’t need to showcase the instrument, I opt to use the case that uke came with to experiment.</p><p>There is a few draw back of using electric humidifiers:</p><ol><li>Requires power.</li><li>Requires monitoring water level and refill.</li><li>If using a case instead of humidifying whole room, it will need some way to read humidity and adjust accordingly.</li></ol><h3>Selected Solution</h3><p>Even tho Boveda pak is 2 way humidity control, if it’s too dry for long period of time, it wouldn’t control humidity anymore. So I need some way to replenish moisture.</p><p>Enter Oasis Humidifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILkfLnGRGs8G6EB062pXXw.jpeg" /></figure><p>An Oasis humidifier is filled with water which get absorb by some special gels. It then emits moisture little by little. But since it only emits moisture until it dries out, it might over done it.</p><p>However, when pair with a Boveda pak that can absorb excess moisture, excess issue is resolved. When Oasis is dried out, Boveda starts to emit moisture which solves the dry issue.</p><p>So that’s combination: <strong>One Boveda Pak + One Oasis Humidifier</strong>.</p><p>This allows the case to stay in right humidity much longer between each refill becasue Boveda acts as a buffer. I think it has gone over 2 weeks without re-filling the Oasis. And Boveda can last another 2–3 weeks. Will be doing some experiment soon.</p><p>Although the case is not sealed well, with the solution, you can see from the chart that it still maintains much more consistent humidity between 45%–51% compare to room’s normal humidity fluxtuation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YidwN4mI07dEu2YNfUUKZw.png" /></figure><h3>Monitoring System</h3><p>To be able to check humidity without being next to the instrument is important. If monitoring is too cumbersome, then I won’t check it.</p><p>Better yet, it would be great if I can be notified only when action is needed, otherwise, no news is good news.</p><p>For monitoring, the final system is as follow:</p><ul><li>Home Assistant software in home NAS, in a docker container. NAS was modified with 10GB of RAM in order to run docker. Home Assistant can store data, automate notification and show pretty dashboard. NAS is a good choice because it stays on anyway.</li><li>Collector and display: Adafruit ESP32 board that supports BTLE(Bluetooth Low Energy) and has a TFT Screen, and I attached 2 Sensors(Temp/Humidify and Light/Proximity) to monitor in room temp as well as turning off display when room is dark. <a href="https://www.adafruit.com/product/5483">https://www.adafruit.com/product/5483</a>.</li><li>ESPHome is a plugin to HA which allows user to configure custom firmware to run on ESP32 board. It reads data from sensors and send to HA. Needs to configure each of the sensor and some component required custom coding to bring driver into ESPHome.</li><li>Xiaomi BTLE humidity sensors. <a href="https://www.adafruit.com/product/4881">https://www.adafruit.com/product/4881</a>. It’s a cheap $10 sensor that allows custom firmware so any device in the room can pick up unencrypted transmission of humidity.</li></ul><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MwEnhMCrZn7_Hol98Qj-Dg.jpeg" /><figcaption>This is how it looks like in the ukulele case.</figcaption></figure><p>With everything running, while case is closed and store anywhere in the room, ESP32 will remotely collects humidity and temperature reading from sensors, display the values on build-in TFT screen.</p><p>Currently monitoring humidity means me looking at the numbers once a while to ensure case is maintaining humidity somewhere between 40%–60%. Because it’s running with Home Assistant, I can be notified via email or slack if something needs my attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cllih68rs8bj_my-WU-rrw.jpeg" /></figure><p>Since data is tracked in Home Assistant, building dashboard is easy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xw0SXTh3ulzKag_dR7ubRw.png" /><figcaption>Dashboard in Home Assistant</figcaption></figure><h3>Actions</h3><p>If Uke’s humidity is too low, refill water in Oasis. If it’s too high, remove Oasis from case. But for the past 2 months, it’s been pretty hassle free, just water filling every month or so.</p><p>What’s good about this solution is that, any new instrument, it just needs a sensor, plus a oasis and Boveda pak, and it’s good to go.</p><p>The battery on the sensor uses 20% for 2 months. So probably needs to replace every 10 months. Since it’s also tracked in Home Assistant, we can be notified when battery is under certain threshold.</p><h3>Cost Breakdowns</h3><p>ESP32 Board is $24.99, much cheaper if getting some Aliexpress version at around $12. Just need one. Need more if ukes are stored in different room since board needs to be 10–15 feet away from sensors.</p><p>Sensor = $10</p><p>Boveda 49% Pak = $7</p><p>Oasis Ukulele Humidifier = $15</p><p>So, each uke costs about <strong>$32</strong> to maintain its humidity.</p><p>One can also just go for multiple Boveda Pak which would last for long time and just need to replenish its moisture level every few months or so.</p><p>Anyway, that’s how I ended up building an home automation system for monitoring the humidity of the ukuleles. Overkill? Absolutely. But 100% worth it for the learning experience.</p><h3>Side Notes</h3><p><strong>Simpler monitoring #1</strong> For simpler humidity tracking, with those Xiaomi sensors, you could just run an app on the phone to read the sensor data. Draw back is that phone must be in close proximity to the sensors in order to receive data.</p><p><strong>Simpler monitoring #2</strong> The Boveda Butler and D’Addario Humiditrak will push notifications to your mobile devices when the humidity and/or temperature is below desired set points determined by the user.</p><p>Both of the simpler solution requires your phone being close to the sensor.</p><p>It’s my first time toying with any development board like ESP32. It was a pretty amazing learning experience. Since Home Assistant is an open source project, there is lots of reading and experiementation for getting this to work.</p><p>Who knew it could be so exciting just to make a library work under ESPHome so it can displays some simple text on the TFT screen.</p><p>Paired with earlier experience from building a mechanical keyboard from scratch such as printing PCB boards, making case design for fabrication, I know, we can turn this into a more refined solution.</p><p>But for now, it’s good enough.</p><p>Reference:</p><p>Custoom portion of ESPHome configurations:</p><p><a href="https://github.com/kloktech-mark/humidity_control">GitHub - kloktech-mark/humidity_control</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b6de8c3cf78" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/controlling-humidity-for-ukulele-1b6de8c3cf78">Controlling Humidity for Ukulele</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby 1.9.3-p551 in MacOS]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/ruby-1-9-3-p551-in-macos-dc950983c714?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/dc950983c714</guid>
            <category><![CDATA[compile]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Fri, 10 Dec 2021 20:59:09 GMT</pubDate>
            <atom:updated>2021-12-18T08:00:58.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GyQ1FHZVeJ7LyXOZ" /><figcaption>Photo by <a href="https://unsplash.com/@joshuafuller?utm_source=medium&amp;utm_medium=referral">Joshua Fuller</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have old ruby code that needs modification in 2021? One could use docker to build the exact same environment as 2011, but it’s not as nice as editing the code and seeing rails console reload instantly.</p><p>After much frustration and bless of Buddha, we nail down the steps needed to compile ruby-1.9.3 on Monterey with xcode and its command line tools.</p><pre># Install RVM<br>\curl -sSL <a href="https://get.rvm.io/">https://get.rvm.io</a> | bash</pre><pre># This env variable is needed to compile ruby 1.93 successfully.  See: <a href="https://stackoverflow.com/questions/69298869/what-does-with-cflags-wno-error-implicit-function-declaration-do">https://stackoverflow.com/questions/69298869/what-does-with-cflags-wno-error-implicit-function-declaration-do</a></pre><pre>export CFLAGS=-Wno-error=implicit-function-declaration</pre><pre># Ruby 1.9.3 needs openssl 1.0<br>brew install rbenv/tap/openssl@1.0</pre><pre># Latest version of rubygems that supports ruby 1.9<br>rvm_rubygems_version=2.7.9 rvm reinstall ruby-1.9.3 --with-openssl-dir=/usr/local/opt/openssl@1.0</pre><pre># If you use rails app<br>brew install v8@3.15<br>brew link v8@3.15</pre><pre># Install these 2 gems individually<br>gem install libv8 -v &#39;3.16.14.19&#39; -- --with-system-v8<br>gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8\<a href="http://twitter.com/3">@3</a>.15/</pre><pre># Run this in your app directory to install needed gems.<br>bundle install</pre><p>This is tested on MacOS Monterey 12.0.1 with Xcode 13.1.</p><p>Best luck to those of you needing to modify old codes. I guess one can replace rvm with rbenv, just replace rvm install command appropriately.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc950983c714" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/ruby-1-9-3-p551-in-macos-dc950983c714">Ruby 1.9.3-p551 in MacOS</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Machine Woos]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/time-machine-woos-3ebc57e41fc9?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ebc57e41fc9</guid>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[cpu]]></category>
            <category><![CDATA[time-machine]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Tue, 07 Dec 2021 00:05:07 GMT</pubDate>
            <atom:updated>2021-12-17T16:41:03.138Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z_XGZa7OEbJsNuwZ" /><figcaption>Photo by <a href="https://unsplash.com/@sebastiaanstam?utm_source=medium&amp;utm_medium=referral">sebastiaan stam</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Time Machine suppose to be effortless. Problem is, if you don’t fit what time machine expects, the behind the scene stuff will bite you. Recently, I notice Mac’s metadata service related process kept running.</p><p>Using this command :</p><pre>sudo fs_usage -w -f filesys mds</pre><p>I see that it’s reading tons of stuff from NAS which Time Machine backs up to. It’s reading those old backups. <a href="https://discussions.apple.com/thread/253034980">Some discussion on this.</a> MDS is spotlight related process, it reads and index files.</p><p>Maybe it’s something to do slow network storage being on the slower side, but nevertheless, it’s taking cpu cycle doing stuff that I don’t see benefit. And every 1 hour, TM cause cpu spike during backup. Although one can use <a href="https://tclementdev.com/timemachineeditor/">Time Machine Editor</a> to customize TM schedule.</p><p>For my purpose, I just need to have a copy of my home directory, so this constant indexing of files and slowing down machine just aren’t worth it.</p><h3>Conclusion</h3><p>So at the end, the solution was to disable Time Machine backup which stop almost all mds process. I ended up using Arq backup which is a straight forward backup application: setup source directory(home dir), setup credential on NAS and mount the destination, set backup schedule either interval or set time and done! No more sudden slow down or super loud fan noise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ebc57e41fc9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/time-machine-woos-3ebc57e41fc9">Time Machine Woos</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curing Mac’s High CPU + Fan Noise + Heat]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/curing-macs-high-cpu-fan-noise-heat-6b567cb81ea0?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/6b567cb81ea0</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[zoom]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[cpu]]></category>
            <category><![CDATA[slack]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Wed, 01 Dec 2021 07:44:30 GMT</pubDate>
            <atom:updated>2021-12-01T07:44:30.001Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wk_ouY2bcbpPihLR" /><figcaption>Photo by <a href="https://unsplash.com/@macroman?utm_source=medium&amp;utm_medium=referral">Immo Wegmann</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TL;DR: Jump to Troubleshoot</p><p>Have your relatively new Macbook Pro’s fan gotten into turbo mode when having a simple zoom meeting? Or with doing nothing, cpu would constantly be utilized and the case just always feels too warm. Or between each Time Machine backup, while only browsing the web, it tries to backup Gigs of data you have no idea why.</p><p>God forbid, if you try to actually edit photo or compile code, the fan will max out at 6000+ rpm which would cause actual disruption to your zoom meeting. If you have such cases, maybe this article can help a bit.</p><p>I’m a devops by trade, which usually troubleshoot performance issue of larger system and code. However, this high cpu usage issue has been plaguing my 2018 MBP 13&quot; since I got it and only until this Thanksgiving week, I was fed up enough that I tried to get to bottom of it.</p><p>It’s not without previous tries of troubleshoot, but just not enough time spent to it, always had some project more important than dealing with laptop issue. It’s not until I turned my laptop to Apple for fixing a known keyboard issue and replaced a short-lived battery(212 Cycles Only), I used my old 2011 Mac Mini for a week. And to my surprise, this 10 years old machine rarely kicks off fan and it was fast enough to do my work. Albeit, I did upgrade memory to 16GB and swap out old HD with SSD, but it was stable and QUIET.</p><p>That got me thinking, it must be software issue that’s causing the cpu to be busy. Time to use my system administrator skill on this noisy laptop.</p><h3>Troubleshoot</h3><p>*For reference, this is tested on 2018 MBP 13&quot; with Big Sur.</p><p>First, in order to know what’s going on, we need a way to see what’s chewing up the CPU. I prefer command line most of time. So open a terminal and type top and see which process is using cpu. This is important, as this is the way we determine what to troubleshoot and determine outcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85RE24wRCbcDFwk3ak4EGQ.png" /></figure><p>What I have seen causing major cpu spikes for my system:</p><ul><li><strong>Metadata related process</strong>(mds, mdsync, mds_store, mdworker). This is related to spotlight as it tries to index any changes to files. This also relates to Time Machine backup when mds tries to index local snapshot of Time Machine.</li><li><strong>coreaudiod</strong>. Audio daemon that sometimes app doesn’t release audio properly causing the audio daemon continuously take on cpu.</li><li><strong>Browser process</strong>(com.apple.WebKit or Chrome). This is related to certain tabs or pages in the browser that’s taxing cpu hard.</li><li><strong>WindowsServer</strong>. This is related to application that’s drawing complex stuff which causes cpu spike.</li><li><strong>kernel_task</strong>. This is a special process that Mac kicks off when it detects system is running too hot.</li></ul><p>In general, run top to see system utilization. You can also press i and then mem to sort by memory usage. Sometimes when memory ran out, CPU will be busy swapping content from memory into disk.</p><h3>Resolution</h3><p><strong>Metadata related process</strong>. I’ve seen this a lot, different metadata process that reads lots of files and index them. If you are seeing those process constantly running, it’s possible that existing index is either corrupted or your files are constantly changing which is causing the index to run constantly. To find out what the process is doing, use following command to see what files it reads or writes.</p><pre># Well known metadata process<br>sudo fs_usage -w -f filesys mds_stores<br>sudo fs_usage -w -f filesys mds<br>sudo fs_usage -w -f filesys mdsync</pre><p>And you’ll see result like this which shows what operation and what files mds is working .</p><pre>18:59:53.182239  getattrlist                            /System/Volumes/Data/usr/local/var/mongodb/diagnostic.data/metrics.interim                                                                                            0.000062   mds.1775007<br>18:59:53.182264  listxattr                              /System/Volumes/Data/usr/local/var/mongodb/diagnostic.data/metrics.interim                                                                                            0.000012   mds.1775007<br>18:59:53.182359  getattrlist                            /System/Volumes/Data/usr/local/var/mongodb/diagnostic.data/metrics.interim                                                                                            0.000078   mds.1775007<br>18:59:53.182826  getattrlist                            /usr/local/var/mongodb/diagnostic.data/metrics.interim</pre><p>In my case, I see that it’s reading a lot of brower cache file from Chrome from ~/Library/ which is not good since I never search anything from cache file. Also, the same constantly changing files are causing Time Machine to backup stuff that I don’t really care. What I suggest was putting those constant change folders on the exclude list for both spotlight and Time Machine. Go to “Finder” and click on ‘GO’ -&gt; ‘Go To Folder’, then type in ~/Library and it will open the folder. Sort the folder by “Date Modified” and observe what’s constantly change</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HI1oLjQEvPJrfYdZVKIR_A.png" /><figcaption>Time is 6:59PM and you can see bunch of folder just</figcaption></figure><p>Determine what you don’t need to index and backup. Open up Spotlight preference, click on “Privacy” and drag any folder you don’t want to index into the pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*rAxpNjNTESvGYpNzKravKQ.png" /></figure><p>Also drag those folders into Time Machine exclude list so it doesn’t get backup constantly which also uses CPU to calculate what to backup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*WmFDoHE-WuPnE6kU7HA7Zw.png" /><figcaption>Exclude files for backup</figcaption></figure><p>Also use the following command to see what Time Machine will try to backup next time. The last parameter is from time machine volumes.</p><pre># Suppose to calculate size of backup, but I always get 0 bytes.<br>malin ~/dev/kloktech $ tmutil calculatedrift /Volumes/.timemachine/276ADFF2-901A-4279-A403-618CB21887CB/2021-11-08-234632.backup/</pre><pre># See the backup <br>malin ~/dev/kloktech $ tmutil listbackups<br>2021-11-09-222606.backup<br>2021-11-10-203518.backup<br>2021-11-11-183659.backup</pre><pre># To see size of earlier backup backup<br>malin ~/dev/kloktech $ sudo tmutil uniquesize /Volumes/.timemachine/276ADFF2-901A-4279-A403-618CB21887CB/2021-11-08-234632.backup/2021-11-08-234632.backup/</pre><pre>6.9G /Volumes/.timemachine/276ADFF2-901A-4279-A403-618CB21887CB/2021-11-08-234632.backup/2021-11-08-234632.backup</pre><pre># Delete older backup, note the format.<br>sudo tmutil delete -d /Volumes/.timemachine/276ADFF2-901A-4279-A403-618CB21887CB/2021-11-08-234632.backup -t 2021-11-08-23463</pre><p>To fix corrupted index, turn off index, then turn it back on. mds will re-index everything which would take 10–30 mins depending on how much files there are.</p><pre># Check current index status<br>sudo mdutil -avs</pre><pre># Turn off index for all disk.  &#39;-a&#39; applies to all disk<br>sudo mdutil -a -i off</pre><pre># Turn on index.<br>sudo mdutil -a -i on</pre><pre># You can turn off indexing for specific disk.<br>sudo mdutil -a -i off /Volumes/external_disk</pre><p>If you have time machine, you will seeing something like in output of index status.</p><pre>malin ~ $ sudo mdutil -avs<br>/:<br>        Indexing enabled.<br>/System/Volumes/Data:<br>        Indexing enabled.<br>/Volumes/.timemachine/NAS._smb._tcp.local/E4D6C7AD-A9BF-4CD8-8B78-744FDCC44B6D/TM-Mark:<br>        Indexing and searching disabled.<br><strong>/Volumes/Backups of Mark-MBP:</strong><br>        Indexing enabled.<br>        Scan base time: 1970-01-01 00:00:01 +0000 (1638326378 seconds ago), reasoning: &#39;(null)&#39;</pre><p>Notice “<strong>/Volumes/Backups of Mark-MBP</strong>”, that’s folder with local snapshot used by Time Machine and it’s supposed to have index turn on in order for TM to work.</p><p>Also something to note is that ‘/’ and ‘<strong>/System/Volumes/Data</strong>’ both needs to be indexed in order for spotlight to find files and preferences. I turned off indexing on ‘/System/Volumes/Data’ hoping it would reduce mds cpu usage, but without index on that volume, spotlight have not much to search on.</p><p><strong>Coreaudiod</strong>. Some application would cause audio daemon to continue running after audio stop playing. Open a terminal with top running, and close application one by one until you find which app is cause coreaudiod to hog cpu. Usually restart the app would cure this problem. In my case, it’s usually the instant messenging app ‘Line’ that causes the issue.</p><p><strong>Browser process</strong>. Sometimes some page has crazy code or heavy graphic that would cause cpu to run hot. If you see chrome or WebKit in top, use browser’s task manager to find out which tab is using lots of cpu and close them.</p><p><strong>WindowsServer</strong>. This is related to application that’s drawing complex stuff which causes cpu spike. This is similar to web pages that cause cpu hike, but in this case, it’s some application that doing heavy drawing. In my case, when messenging app “Slack” has animated emoji option turned on, it sometimes cause WindowsServer to draw lots of CPU.</p><p><strong>kernel_task</strong>. This is a special process that Mac kicks off when it detects system is running too hot. It cools down system by occupying cpu cycles that does nothing so other process can’t utilize more cpu. However, it isn’t always trigger by high cpu usage. Supposedly, port that power plugs into affect temperature too. On MBP 13, looking at monitor, left side ports would trigger fan because there is thermo sensor there. I tried both side without seeing much difference. When this process is doing 10% or higher cpu, that means your system has deemed itself being too hot and fan will kick off. If you use laptop with closed lid and external monitor, you’ll see this process often. I guess close lid would cause higher temperature than open lid.</p><p>And that’s it! Hopefully, as each cpu chewing process gets tame, you’ll get a nice cool laptop with better battery life to work with.</p><h3>APPENDEX</h3><ul><li><a href="https://support.apple.com/en-us/HT204015">Time Machine Local Snapshot Explained</a></li><li><a href="https://news.ycombinator.com/item?id=14087899">Animated Emoji Caused CPU Spike</a>, old discussion, but helped my case.</li><li><a href="https://apple.stackexchange.com/questions/131399/what-folders-can-be-safely-excluded-from-time-machine-backup">What To Exclude In Time Machine?</a></li><li><a href="https://eclecticlight.co/2020/01/22/time-machine-11-tmutil/">Time Machine Command Line Chops</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b567cb81ea0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/curing-macs-high-cpu-fan-noise-heat-6b567cb81ea0">Curing Mac’s High CPU + Fan Noise + Heat</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free of Amazon Prime]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/free-of-amazon-prime-8ad6c190bf39?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/8ad6c190bf39</guid>
            <category><![CDATA[control-of-thyself]]></category>
            <category><![CDATA[amazon-prime]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[freedom]]></category>
            <category><![CDATA[nas]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Tue, 26 Oct 2021 03:27:14 GMT</pubDate>
            <atom:updated>2021-12-01T22:27:36.429Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nHOsoSpNZrppNT2T" /><figcaption>Photo by <a href="https://unsplash.com/@christianw?utm_source=medium&amp;utm_medium=referral">Christian Wiediger</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Main reason my household keeps multiple prime account is because I have 2TB+ worth of pictures stored on Amazon drive that was part of Amazon prime’s unlimited photo storage offering.</p><p>Prime is $120/year and I paid for extra 1TB for video for $60/year. Although $180/year isn’t much, it didn’t feel good that I couldn’t cut off prime anymore because it holds all my files….almost like hostages.</p><p>When wife and I were traveling abroad for 1.5 years, I realized I could have save quite a few dollars if I planned a little better. If I was able to cancel our California health insurance which doesn’t work abroad anyway, car insurance, and Amazon prime, it’s close to $1000/month saving. To be fair, Amazon was like $15/month only, but it’s more symbolic than actual monetary saving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FTlX1JFcOaI0mIfc" /><figcaption>Photo by <a href="https://unsplash.com/@anneniuniu?utm_source=medium&amp;utm_medium=referral">niu niu</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So foster a plan to rid myself of AWS handcuff. Enter NAS. The plan was to get a NAS with 2 drives with mirror. Then sync all the files from Amazon and cut it off.</p><p>I got a <a href="https://www.amazon.com/dp/B087ZCBWFH?psc=1&amp;ref=ppx_yo2_dt_b_product_details">Synology DS220+</a> with 2 <a href="https://www.amazon.com/dp/B08TZYBMMC?psc=1&amp;ref=ppx_yo2_dt_b_product_details">Western Digital Red w/ CMR</a>. WD Red hard drive is long term storage specific type of drive. All big hard drive manufacture makes similar offering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*0gTrDBrW38-U4Vq-A3_j1A.png" /></figure><p>When I got the drive and eager to sync files off Amazon drive, I found out that Amazon has cut off all 3rd party access to Amazon drive. What a bummer. It only allows their own mobile app and desktop sync software. I wasn’t too happy about this, because that basically ruin the whole operation.</p><p>But then I found that DS220+ supports virtual machine.</p><p>Oh interesting, so maybe I can run Windows VM to sync all the files into NAS. Build-in memory wasn’t enough to run virtual machine, so got a <a href="https://www.amazon.com/dp/B08C56KXQJ?psc=1&amp;ref=ppx_yo2_dt_b_product_details">8GB laptop memory</a> and away we go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oYOTcRTWyPTdrm99eRJWXg.png" /><figcaption>Using Windows VM on DS220+ to Download Amazon</figcaption></figure><p>It worked. After couple days, this little NAS running windows 10 VM actually downloaded all my amazon drive. And I just cut off the extra $60/year for 1TB. Will be removing amazon prime soon and had my housemate add me to their account. Then we’ll finally be Amazon Prime free.</p><p>Only down side is I over used Comcast’s bandwidth cap and that costed $100 extra for month of October.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5dcjdIpmftHM7MjEY2VhzQ.png" /><figcaption>If we gonna over use it, might as well go hard</figcaption></figure><h3>Update:</h3><p>It is done. I’ve officially cut ties with Amazon Prime today(2021–11–30). Amazon did tried hard to pull you back in, but this last screen just made me realized that I buy stuff more than I thought I did. And all other Prime perks are pretty useless to me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyUDBmJQvHk0SL7Ctd3w4g.png" /><figcaption>The thing with free shipping: I certainly don’t feel like I’ve gotten 62 packages in the past year.</figcaption></figure><p>Also, forgot to factor in with Prime membership, I get 5% off with Amazon’s credit card. Without the card, it’s 3% off. Supposedly, I got $214 back from past 12 months of purchase, which is $4280 spent on Amazon. I know Amazon’s trying to show how much money I got back, but I actually feel pretty bad that I spent over that much on Amazon.</p><p>So without Prime and same spending, I would lose out $85 worth of cash back. Now, that kinda mess with the equation. If all the spending on Amazon is necessity, then Prime now costed $120 minus $85, which is $35. That would be cheap enough to get it for the free shipping, maybe? But then I look at the spending report, I made some large purchase on behalf of some project which isn’t gonna happen every year. So for now, we’ll leave it the way it is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ad6c190bf39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/free-of-amazon-prime-8ad6c190bf39">Free of Amazon Prime</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rackspace Cloud Server Deletion]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/rackspace-cloud-server-deletion-e333049fb4fe?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/e333049fb4fe</guid>
            <category><![CDATA[rackspace]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[delete]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 05:10:23 GMT</pubDate>
            <atom:updated>2021-08-10T05:10:46.109Z</atom:updated>
            <content:encoded><![CDATA[<p>One of client is using rackspace cloud for their servers. Went through some upgrade this weekend and found out that rackspace doesn’t allow its customer to delete a server from its web interface. When click on delete, it will prompt you with following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*wGTz45mBz-MaAay3Sjf21g.png" /><figcaption>call if you want to delete server</figcaption></figure><p>There must be some sort of reason behind this, but logic, sound, business reason not allowing its customer to delete a server from the web interface. But as a user, it’s just a terrible user experience.</p><p>Turns out, if you’re a REAL power user, you can use rackspace’s API to delete a server. Here’s how:</p><p>Login to web, get your username and API key under “My Profile and Settings” then run following curl command with username and apiKey set to your own settings.</p><pre>curl <a href="https://identity.api.rackspacecloud.com/v2.0/tokens">https://identity.api.rackspacecloud.com/v2.0/tokens</a> -X POST -d ‘{“auth”:{“RAX-KSKEY:apiKeyCredentials”:{“username”:”yourUsername”,”apiKey”:”yourAPIKey&quot;}}}’ -H “Content-type: application/json” | python -m json.tool</pre><p>from the output, find server api url. That’s right, there is a specific server API endpoint instead of one central api endpoint. It will contain your tenant ID at the end of URL, in this case 123443 is the tenant ID.</p><pre>export API_ENDPOINT=”<a href="https://iad.servers.api.rackspacecloud.com/v2/887624">https://iad.servers.api.rackspacecloud.com/v2</a>/123443&quot;</pre><p>Find token id, that’s the token to use to make api call</p><pre>export AUTH_TOKEN=”AAAfdNKdRn15cnhasdflas3wunlKSJASfWXN2YUZ2xffZPdljq6Q-V5q6jT0asdfas7kG2KSKtAF493jasdfas2asdafUyCNZsspeqa91cTh3Dq9lKOW9jH5p_mhrexzvJthsdF6k6eu5IHPoqYRAXzp0kqgcoJr4BG37SpVRinY_4&quot;</pre><p>once you have those two variables, again, use your UI to find server id to delete and run following curl:</p><pre>curl -i $API_ENDPOINT/servers/0ajsdd0e-2805–4466-a38e-2azzdwda9bd1b -X DELETE -H “X-Auth-Token: $AUTH_TOKEN”</pre><p>If it returns HTTP 204, then it went through.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e333049fb4fe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/rackspace-cloud-server-deletion-e333049fb4fe">Rackspace Cloud Server Deletion</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GoPro Plus, I dunno…]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/gopro-plus-i-dunno-a95cee94091a?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/a95cee94091a</guid>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Tue, 15 Sep 2020 07:00:22 GMT</pubDate>
            <atom:updated>2020-10-12T12:49:03.690Z</atom:updated>
            <content:encoded><![CDATA[<p>We just did a 12 days, 1190 KM, bicycle tour around Taiwan. Along with the trip, I’ve rented a GoPro Hero 8. Last GoPro I used was Hero 4 Black, although the video quality is great, not having good enough sound and extra bulky water proof case are the main reasons I stopped using it. And when I brought it along with my first cycle around Taiwan, even with 3-ways stabilizer, most of the footage mounted on bike are unusable, still way too shaky.</p><p>Now that Hero 8 comes water proof without case, a better quality microphone and a build-in electronic stabilizer, I decided to rent one to document the trip. I’ve heard about over-heating issue which I would expect especially in the heat of Taiwan.</p><p>Since the rental only provided one 128GB memory card and not wanting to buy another card just for this trip, I needed someway to backup the videos/photos and clean up storage for more recording. After researching a few options, GoPro Plus subscription from GoPro is picked. It’s a premium service that provides “unlimited” upload of GoPro recordings AND insurance for GoPro that will replace the camera maximum of twice a year. I only needed the backup service since Taiwan isn’t one of country that supports insurance.</p><p>With 30-days free trial, I used the bike trip as testing stone. Now that I think of it, I really shouldn’t use real trip as experiment in case of any hiccup because hiccup did happen.</p><p>I had issue with setting up GoPro Plus on the camera, mainly because it was a rental and the camera was associated with another account. The error message just says “Unable to Fetch GoPro Plus Account” and I couldn’t find information regarding this message.</p><p>Anyway, for future reference, it meant this camera was associated with some account that no longer exists or have disassociate with this camera. And the way to re-associate with new account is: <strong>Factory Reset</strong>. Once reset, GoPro app on the phone will be able to pass new account to the camera so when camera’s wifi is connected every night, it will upload new recording to GoPro Plus service.</p><p>In theory, this works great. Once uploaded, just wipe the memory card clean and do more recording tomorrow. However, I found that some videos are missing from GoPro Plus media library while exist in the memory card.</p><p>Now, this service suddenly became scary. If it couldn’t backup reliably, I can’t use this service. Problem with this is that when I upload the missing video manually through web browser, it actually recognizes the video is already in library, but YET….it can’t be found in app or in website media library.</p><p>This is the first problem. Then here comes second issue, downloading the uploaded media.</p><p>12 days bicycle trip yield about 900 files, about 220GB. I am not sure about others, but my phone doesn’t have 220GB free space and I can’t edit all the video with phone. I needed some other way to download the files.</p><p>There are two ways, GoPro legacy software ‘Quik’ and download from site. Quik can multi-select all the files and download via queue, however, it has very slow download speed. Which I don’t understand, the media is hosted on AWS, I don’t understand why it’s so slow. So that left with last option, download from GoPro Plus website.</p><p>Although the speed is much better, it’s buggy when downloading multiple files. When selected multiple files to download, the site will issue download request to AWS one at a time. However, it doesn’t wait for current request to start download before issuing the next request. In this case, current request will be canceled. As the result download will also miss files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkbLntbW6kObVN609kgA6g.png" /></figure><p>There is a work around. When seeing the error, right click on the request to open request in new tab which will reissue the download the request.</p><p>Problem is, I had several hundred files to download. I thought of writing some sort of script to do this, but…I can’t run the code on GoPro Plus site, so instead I just suck it up and download/redownload until all medias are fetched.</p><p>But that pretty much ends my hope for using current form of GoPro Plus service. Also, when uploading media to GoPro Plus, it messes with timezone, so files captured in Taipei time afternoon on Sep 2, will show up as Sep 3 media. This is a big no-no.</p><p>At the end, it could be my computer/phone that has these particular issues, but nevertheless, it doesn’t work out. Hope future experience will improve. So unless one lives in a country that support insurance replacement, either bring additional memory card or some ways to copy files off memory card to somewhere else seemed to be better choice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a95cee94091a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/gopro-plus-i-dunno-a95cee94091a">GoPro Plus, I dunno…</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tracking Down a Lost Macbook]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/tracking-down-a-lost-macbook-ef6550965053?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/ef6550965053</guid>
            <category><![CDATA[tracking-software]]></category>
            <category><![CDATA[stolen]]></category>
            <category><![CDATA[macbook-pro]]></category>
            <category><![CDATA[prey]]></category>
            <category><![CDATA[recover]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Wed, 20 May 2020 03:37:11 GMT</pubDate>
            <atom:updated>2020-10-12T12:46:05.553Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Car with smashed window." src="https://cdn-images-1.medium.com/max/1024/1*64DfK_0BpmXsGNBDuxGflw.jpeg" /></figure><p>Jan 19 2019, walked out of restaurant to find my car with smashed window behind driver side. My Mac and wife’s Dell laptops were taken. Filed police report, Mac’s Find My Mac is pretty useless unless computer is online. But computer can’t be online because thief didn’t have credentials to login.</p><p>I had to get a replacement computer quickly and not wanting to pay full retail price, I picked up a used Macbook Pro with same spec as the lost one. I asked seller for his driver’s license in order to make a purchase receipt since it’s a big purchase item. For some reason, seller initially was hesitant to comply, which made the transaction seemed a bit fishy but eventually he gave in and whipped out his license.</p><p>First thing I did with newly purchased used Macbook Pro was to wipe everything inside and reinstall operating system. Everything worked, until after installation, a curious message box popped up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cg6DcEj6ZVdnbfK62NQwGg.jpeg" /><figcaption>Device Enrollment after Fresh MacOS Install</figcaption></figure><blockquote>Some company can automatically configure this Mac? What is going on?</blockquote><p>Surprised that fresh installed OS could be controlled by external entity so I started to look how this is possible. And after some research, this is what the pop-up message meant:</p><p><strong>This used MBP belonged to some company before and still under its control.</strong></p><p>Luckily, seller was willing to take the machine back and refund the money. Having that receipt with his driver’s license number probably saved me from purchasing a potentially stolen laptop.</p><p>Then a lightbulb lit up in my head.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xCgQXhYRq898B0kg" /><figcaption>Photo by <a href="https://unsplash.com/@ale_s_bianchi?utm_source=medium&amp;utm_medium=referral">Alessandro Bianchi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If previous owner of this laptop can configure machine after I purchased and wiped it clean, that means if I can somehow claim to Apple as rightful owner of my lost laptop, then maybe I can do the same thing?</p><p>Turns out, it is possible and can be done with Apple’s Device Enrollment Program(DEP). When machine is reinstalled, as part of installation, it will contact Apple to check if it belongs to a DEP. Now, DEP itself doesn’t configure the machine. You have to configure DEP with MDM(Mobile Device Management) service provider. MDM is the service that configures iPhone/iPad/MBP.</p><p>For MDM, I chose Jamf Now because..it allows 3 free devices. That was enough for home use.</p><p>But there’s a caveat. If you purchase laptop from Apple directly, you have to tell Apple to enroll the device at purchase time. It is <strong>NOT</strong> possible to enroll device into DEP after purchase.</p><p>However, which still seemed dumb, if you purchase from authorized 3rd party vendor such as B&amp;H, you can ask vendor to add the device into your company’s DEP <strong>AFTER</strong> purchase. To me, this is just non-sense that Apple could’t do this themself. Luckily, the lost laptop is purchased from authorized 3rd party.</p><p>To get into DEP, you’ll have to be either a school or business. I run a consulting business, so opt to setup a business account which involved jumping through a few hoops. Apple has to verify if business is legit, so self employee folks without business entity might be out of luck. Apple uses Dun &amp; Bradstreet (D&amp;B) record to validate business. Apple even called multiple times to check. Not a lot of pain, but not straightforward either.</p><p>After setting up business account, enroll in DEP and get a DEP number. Email B&amp;H customer service, cs@bhphoto.com, request your MBP to be added into your DEP. You’ll have to provide receipt to prove that you are the rightful owner of laptop. Once B&amp;H added laptop in DEP, you’ll receive an email from MDM that laptop is now under your control.</p><p>Achievement Unlock!</p><p>Now that we can do anything with machine, we need to install some sort of monitoring/tracking software onto this lost MBP. For that, <a href="https://preyproject.com/">Prey</a> was chosen. Also free with 3 devices.</p><p>Next challenge was to install it without user interaction since I can’t login to this machine. (<em>Or can I? If I have MDM, I should be able to create myself a user and enable remote access. Maybe we can try that next</em>). In order to install tracking software without interaction and have it start sending homing info, I need to build a software package around this software to install and automatically run.</p><p>So here’s the biggest cost of this whole game, $99/year Apple Developer account in order to sign the package with valid crypto key that allows Mac to validate source of the package. Without this digital signature, Mac won’t install this app automatically and Jamf Now also requires signed package for installation. It’s a good thing. I have documented steps to build your own tracking package with Prey Project on this github repo: <a href="https://github.com/kloktech/recover_lost_mac">https://github.com/kloktech/recover_lost_mac</a>. It was quite a bit of wrestle due to my lack of experience with MacOS packaging, but all that is now encapsulated in a script.</p><p>To build your own package, clone the repo, go through README.md and supply your own PREY_ID and Apple developer ID to build script, it will build your own automated Prey package that once install by MDM, starts to send homing info to your Prey account. With newest MacOS, 10.15, Prey requires permission to turn on webcam which would probably startle current user. But even they deny webcam access, screenshots and many information can still be tracked.</p><p>After package is prepped, use Jamf Now to create new app, then add new app to a profile and assigned lost MBP into the profile. So next time Lost MBP is reinstalled, Jamf Now will be contacted to configure the machine and this package will be pushed to it, install and start running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*MJFuTktOcmgDtvGGlhAb0A.png" /><figcaption>Jamf Now waiting for machine to check in then it will push Prey into machine.</figcaption></figure><p>With everything prepped, tested and configured, it’s now a waiting game. I knew the process works in my lab and tracking app really can track, but I can’t tell when The Lost One will get its OS reinstall so Jamf Now can install package.</p><p>About a week in, this email from Prey showed up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*ZRLd4LNB8mYtDCj4Ao7WWw.png" /><figcaption>The Lost One Reported In</figcaption></figure><p><strong>WOW.</strong></p><p>I can’t believe this long shot of an idea actually worked! Click into Prey Project portal and turn on “Report Missing” for this MBP and it starts to gather data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mkHRdjSFuVfivLJwR17quw.png" /><figcaption>Tons of useful information on whereabout of laptop.</figcaption></figure><p>At the end, with webcam pictures of user, bank PDF, screenshots of various online services such as Gmail, Facebook, Spotify and their account names, I decided not to pursue further.</p><p>I can’t bear the thought of a person being scared by police officers knocking on the door with a charge of potential felony on stolen property.</p><p>We did learn how to find a lost MBP without any previously installed software <strong>AND</strong> where to fix car window cheaply.</p><p>That, was a fun ride worthy of Lost MBP.</p><p>Summary:</p><ol><li>Get yourself a DEP(Device Enrollment Program) from Apple.</li><li>Associate machine under DEP. Can be done at purchase time if purchase from Apple, or after purchase if bought from 3rd Party.</li><li>If machine is still in your possession, install tracker software, then encrypt both disk and boot sector to prevent OS reinstall. Then create a no-password guest account so whoever taken the laptop can login with such guest account and we can track them when they connect to Wifi. Jump to next step if machine is not in your possession.</li><li>Setup MDM(Jamf Now) with your Apple account so machine can be supervised by you. When machine is wiped and reinstall, it will automatically check against DEP by which point it will be pointed to your MDM, and tracker software will automatically install.</li><li>Bonus: Setup disk encryption as part of configuration.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef6550965053" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/tracking-down-a-lost-macbook-ef6550965053">Tracking Down a Lost Macbook</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup TV Set-Top Box & Chromecast]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/setup-tv-set-top-box-chromecast-b7ea58b378e2?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/b7ea58b378e2</guid>
            <category><![CDATA[network]]></category>
            <category><![CDATA[iptv]]></category>
            <category><![CDATA[chromecast]]></category>
            <category><![CDATA[multicast]]></category>
            <category><![CDATA[wifi]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Fri, 24 Apr 2020 02:44:44 GMT</pubDate>
            <atom:updated>2021-08-13T15:48:26.133Z</atom:updated>
            <content:encoded><![CDATA[<h3>TV Set-Top Box &amp; Chromecast Multicast Issues</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yyldwOPbSYdCKrmv" /><figcaption>Photo by <a href="https://unsplash.com/@daanstevens?utm_source=medium&amp;utm_medium=referral">Daan Stevens</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In Taiwan, TV service is mostly done with digital set-top box(STB) that uses multicast streaming. Connectivity usually goes from provided wifi router to box directly so there isn’t much issue since it’s been pre-configured properly.</p><p>If for some reason one wants to use second wifi router behind carrier provided one, there are a few things to configure.</p><ol><li>On your own wifi router, check if there’s IPTV option to enable under ‘LAN’ configuration. It typically allows one to turn on IPTV on specific port. If there is, enable it, and connect STB to that port. This is to allow multicast traffic to pass through.</li><li>If your TV provider uses multicast to stream, enable IGMP Proxy and IGMP Snooping. This is to allow devices such as your phones and chromecast to find each other.</li></ol><blockquote>IGMP snooping is the process of listening to Internet Group Management Protocol network traffic to control delivery of IP multicasts. Network switches with IGMP snooping listen in on the IGMP conversation between hosts and routers and maintain a map of which links need which IP multicast transmission.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_Qz7rHY3g_lMeJ_zcsu_Q.png" /></figure><p>You ever had issue with chromecast where your phone or tablet can’t seem to see chromecast or YouTube/Netflix is missing that “Cast” icon? That’s because for Chromecast to work consistently under wifi router among devices, IGMP Snooping on WAN setting should be <strong>enabled</strong> in order for device to see chromecast. I guess chromcast uses multicast to communicate with devices on the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xt4p4Cjx5Zh2YXtZudzqZg.png" /></figure><p>And that’s it. You should now see chromecast function working consistently in your app.</p><p><em>Reference: <br></em><a href="https://www.snbforums.com/threads/how-to-use-iptv-on-asus-router.30674/"><em>https://www.snbforums.com/threads/how-to-use-iptv-on-asus-router.30674/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7ea58b378e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/setup-tv-set-top-box-chromecast-b7ea58b378e2">Setup TV Set-Top Box &amp; Chromecast</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[tmux, where have you been?]]></title>
            <link>https://medium.com/devops-one-problem-at-a-time/tmux-where-have-you-been-658cd4f212ab?source=rss----4133a785597f---4</link>
            <guid isPermaLink="false">https://medium.com/p/658cd4f212ab</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[tmux]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mark Lin]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 21:23:17 GMT</pubDate>
            <atom:updated>2021-02-22T19:00:41.909Z</atom:updated>
            <content:encoded><![CDATA[<p>My first system admin job was dealing with Sun Solaris. At that time, I learned to rely on most basic tools because sometimes, only most basic tools are available. I picked <strong>vi</strong> over <strong>emacs</strong> because it’s more available. I did bumped into situation where even <strong>vi</strong> wasn’t available to change a file in single user mode, only <strong>ed</strong> was. Ed is a line editor, no full screen editing, just one line, that came with Unix operating system when it was first developed, <strong>1969</strong>.</p><p>This is just to show my “upbringing” as system admin. Use simplest tool to get stuff done, rely on default setup instead of customization. Of course, the world has moved on, but little bit of that mentality is still in me.</p><p>As sys admin, I use terminal a lot. I know utility like “screen” that does session switching and window splitting. But since I deal with unix a lot, with screen using Ctrl+a to initiate screen command, it collides with same command for jumping to beginning of command line. It was annoyed enough to abandon screen. I am sure one can switch Ctrl-a to something else, but screen’s benefit doesn’t seem worth the effort and I tend to rely on default instead of customization.</p><p>19 years later, couple days ago, I saw a friend’s terminal window with 4 evenly split panes each with a session in it. He was able to run application in one and see output in another and tailing logs on third one without switching tabs or windows. It doesn’t look like it’s screen, too fancy. I was intrigued.</p><p>Tmux, as I was told, is terminal multiplexer. It’s similar to screen to maintain session and split windows and most important of all, its default command key is Ctrl+b. A key sequence I don’t remember ever used on Mac. That means it wouldn’t interfere with existing muscle memory. I was sold.</p><p>Installation reference:</p><p><a href="https://medium.com/hackernoon/a-gentle-introduction-to-tmux-8d784c404340">A Gentle Introduction to tmux</a></p><p>Long story short. Now I have multiple windows each with its own panes layout that’s customized for each client/project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZFuMlvyAERvg-6SBYfyq6w.png" /><figcaption>tmux screenshot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dnLBPi9RwjLVtcQVCYAuQ.png" /><figcaption>tmux window selection</figcaption></figure><p>What’s cool about tmux is that it can work with mouse to activate pane, scroll, and select text for copy. It’s kinda mind bender, a text-based utility that can work with mouse to adjust its history and pane size.</p><p>To install session restore follow</p><p><a href="https://github.com/tmux-plugins/tmux-continuum">GitHub - tmux-plugins/tmux-continuum: Continuous saving of tmux environment. Automatic restore when tmux is started. Automatic tmux start when computer is turned on.</a></p><p>My own ~/.tmux.conf has mouse enable and vi copy mode enable</p><pre>set -g <a href="http://twitter.com/plugin">@plugin</a> ‘tmux-plugins/tmux-resurrect’<br>set -g <a href="http://twitter.com/plugin">@plugin</a> ‘tmux-plugins/tmux-continuum’</pre><pre># Disable status bar<br>set -g status off</pre><pre># Longer history<br>set -g history-limit 5000</pre><pre># Restore saved session<br>set -g <a href="http://twitter.com/continuum">@continuum</a>-restore ‘on’</pre><pre># Set to vi mode<br>setw -g mode-keys vi</pre><pre># Enable mouse support version 2.1+<br>setw -g mouse on</pre><pre>unbind -T copy-mode-vi MouseDragEnd1Pane<br>bind P paste-buffer<br>bind-key -T copy-mode-vi v send-keys -X begin-selection<br>bind -T copy-mode-vi y send -X copy-pipe “reattach-to-user-namespace pbcopy”\; display-message “copied to<br>system clipboard”<br>bind-key -T copy-mode-vi r send-keys -X rectangle-toggle</pre><pre># Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)<br>run -b ‘~/.tmux/plugins/tpm/tpm’</pre><p>That’s it. Install tmux, install the plugin, configure with .tmux.conf and learn a few quick key strokes, you now have a super flexible terminal.</p><p>One thing I haven’t figured out is selecting text and copy. With current config, once text is selected, I can press ‘y’ or hit enter to copy the text. But hitting ‘y’ would not turn off text highlighting. Press enter will copy the text but jump out of buffer mode. I wanted the same behavior as rest of Mac copy, highlight text, Cmd+c, text copied, highlight disappear and screen stay where it it.</p><p>All in all, I haven’t felt this excited about terminal since….ever. Happing tmux’ing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=658cd4f212ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-one-problem-at-a-time/tmux-where-have-you-been-658cd4f212ab">tmux, where have you been?</a> was originally published in <a href="https://medium.com/devops-one-problem-at-a-time">LifeOps — One problem at a time.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>