Universal Control rocks with iPad and using iSh for development

Wow I can’t believe Universal Control actually works and it is remarkable. First of all the setup is pretty complicated. Here is what you need to do to get this to work:

  1. Update iPadOS 15.4 and MacOS 12.4. This means go to System Preferences in MacOS and choose update and Settings/About for iPadOS.
  2. Then you need to go to a strange dialog in the Mac which is System Preferences > Display > Universal Control and enable all the buttons which are Allow your cursor and keyboard to move between any nearby Mac or iPad and then Push through the edge of a display to connect a nearby Mac or iPad
  3. Now when you drag over an edge on the Mac, it assumes that is where the iPad is and wanders over there. So it doesn’t do anything magically like figure out placement, but just guesses, it works pretty well.

One confusing things is that this is different from Sidecar where the iPad is used as a secondary display. That’s useful in coffee shops where you need more display space. But most of the time I think I’m going to be using Universal control because then I can still use the native iPad applications

When to use Universal Control?

So what do you use if for? Well that’s a great question:

  1. Putting Slack on the iPad. Well, so what do you put on there you things that you interact with but don’t want to be distracted. I find that it is really nice to type with a mechanical keyboard and also to use a real mouse (which iPadOS now supports well).
  2. In most of my home systems thanks to the pandemic, I have a big screen and then the MacBook is open on the right. I normally leave my music if I’m chilling or Trello on the right.
  3. Then the main screen I use Rectangle to do tiling windows and on 27″ screens I have four of them and on larger ones like 43″ or 55″, I can have six of them.

Using iPad as a computer for testing and simple development

My biggest issues with the iPad is that it is such a powerful computer. The latest 2021 model specifically because it has a real M1 chip, but you can’t really use it for anything. But I saw a post on ish and A-Shell. These let you run a full Alpine Linux environment inside an iPad application. You can even run Python with ask add python3 and other things. I’m going to experiment with this and see if I can just run sample applications and things there.

I’m going to see if I can do a git clone as well so simple python applications will run and maybe even docker! While there are python environments that you can run, this is a full version of Linux running inside a tablet operating system. Pretty incredible how powerful mobile chipsets have become

Tasting Olive Oil choices for 2022

Well, it’s that time of year again, so after the 2020 list of really great olive oils that are also available on this Amazon list, its time in 2021 and we’ve settle on some favorites, but its a good time to read Best Olive Oils from the NY Competition to see what’s wonder (gold medals galore) and available generally (eg Amazon) so its so hard to find, so here are some choices from the Amazon 2021 Best Olive Oils List:

Acropolis Organics. This is a single variety Koroneiki olive oil. It is medium blend with red pepper, tomato and green pepper. Chemical-free. $26 on Amazon for 500ml.

Agricola Pobena Alonso Olive. Chilean olive oil is something I’ve never tried but it’s medium bodied from Coratina. With notes of chicory, fennel, ripe and red chili pepper and herb. $27 for 16.9 fl oz or 500ml at Amazon.

Alonso Coratina. Chilean olive oil medium body. 500ml or 16.9 Fl oz for $27 at Amazon.

Cobram Estate Australia Classic. Australia olive oil that’s medium blend by Boundary Blend with fresh grassy notes, green bananas and tomatoes, moderate bitterness and fig leaf, chicory, celery and olive leaf at $17 for 12.7 fl oz or 375 ml at Amazon.

Entimio Vivace. Unique EVOO. Hand picked in Tuscany. Green fruitless and well balanced bitterness and pungency with fresh-cut grade, chicory. $24 for 8.5 fl Oz or 250ml at Amazon.

Lucini Italia Premium Select. Italian olive oil that is very green and has artichoke and peppery finish. A long term winner for the last four years, it’s been a gold winner. $33 for 1L at Amazon.

Manni Oil. This is an Italian oil from Toscana PGI which is made by a technique which makes very rich antioxidants that last for up to three years. The There is Per Me which is stronger, Per Min Figlio which is lighter and the Oil of Life which is mild. The Oil of Life is 8.5 fl oz or 250 ml for $44 at Amazon

Terra Creta Organic. Greek olive oil Koroneiki from Crete. It has subtle pear and almost and is medium Blend. $54 for 3L at Amazon.

Terra Creta Grand Cru. From the same family as the Terra Creta Organic, this is a cooperative of 1,200 farmers in Crete. Its robust as they say so pretty strong with artichoke, fig, unrip chicory. $54 for 1L at Amazon.

Rechargeable Battery the move to Lithium Ion vs. NiMH

Well, I’ve been using various NiMH batteries in the AA (aka LF-91) and AAA (aka LF-92) form factors for over a decade now. They are a great way to save the environment and they are cheaper too. We have the LaCrosse chargers and there are really two limitations to them:

  1. If you don’t get the Eneloop or other low discharge batteries, they will run down in a month or so.
  2. They generate 1.4V, so slightly lower than the 1.5V so some things won’t work with them as they need that much voltage. For instance, our Brother P-touch is a label maker that really wants to see 1.5V
  3. They have gotten quite cheap at less than a $1 per cell, so never as cheap as alkaline batteries, but they last over 500 charges, so you are saving a lot.

However, the big move now as with all things is to Lithium Ion, this has some advantages and then some disadvantages:

  1. Not that it matters in these applications, but they are definitely lighter, so if you have something that is weight critical like say a set of Garmin Powertap bike pedals, then this is a big deal.
  2. They are all internally really running at 3.4V, so they need step down electronics to get to 1.5V
  3. They do need new chargers which are tuned for this new battery chemistry and some just have a microUSB sticking out so you don’t need to buy a LiPo battery charger.
  4. They are pretty hard to find and expensive because everyone (cough, the EV, phone and laptop industries need them).
  5. They have less capacity than NiMH but they produce their 1.5V uniformly before failing, so this is nice for applications that can’t deal with gradual voltage loss.

Get NiMH for long life and low cost, LiOn for high voltage or light weight

TL;dr, the main point is get the Panasonic Eneloop if you have things that don’t need constant voltage, so for instance flashlights great, it will be slightly dimmer (1.5V for Lion vs 1.4V going down to 1.2V for NiMH). It is the default choice. Lithium ion is much more expensive and is best for the opposite case, where you need constant voltages and lightweight such a sensitive electronics. A great example of this are my PowerTap P1 pedals for the bike or the Brother P-Touch label makers or my blood pressure monitor the Omron BP7000 which works fine with alkaline but not with NiMH, you get all kinds of errors with those low voltage batteries.

The electronics on these are sensitive and need a 1.5V minimum voltage. And with the Pedals, the difference in weight of 10 grams matters if you are a weight weenie and want your bike to break the 1999 UCI weight limits for events like the Tour de France of 6.8 kg or just under 14.99 pounds. These days, you can get climbing bikes like the old Trek Émonda 10 which is 4.6 kg or 10.1 pounds!

NiMH Recommendations

Well there are a lot of recommendations (see Michael Blue Jay and Right Battery) for these, but most folks seem to like the original batteries made in Japan for Panasonic. For a long time folks really like the Maha/Powerex series of batteries but some have reported loss of charge over time, I have buckets of these and it is hard to tell, but they definitely haven’t just died which is nice. The PowerEx Imedion which I do have for instance is a 2400 mAh 1.2V Low Self Discharge with 1,000 cycles and in testing seem to meet their ratings at least when out of the box. Note that this rating of 2400 mAh is with low current like 0.2A, if you go to a say 2A load, the available capacity shrinks to more like 1900 mAh which is common with batteries like this. Also note that Panasonic does make the Eneloop Pro which is 2500 mAh but lasts only 500 charge cycles and has slightly higher capacity than the Powered Imedion (and is made in Japan)

Also Sanyo (now Panasonic) who made the original Eneloop (4th Generation) now has a 2100 charge cycle version so way more than the typical 1,000 cycles. But that does seem like a nice advantage, they are $3 each for AA 2000 mAH at Amazon and AA 750 mAh are $2.70 or so at Amazon.

Note that the Eneloops are now made in China for Asia distribution, but there is the original factory in Takasaki City Japan that are supposed to better but more expensive. They source the Japanese batteries from FDK (and beware there are many counterfeit Eneloops around, so don’t buy this on eBay). You can still get these original Sanyo/Panasonic cells though as a different brand. And there is a long history of Sanyo buying the Toshiba factory in 2001, then this was acquired by Panasonic.

Finally, you can now get 9V replacements as well which is nice for things like smoke alarms where I feel guilty about using so many 9V alkaline. As an example the Powerex Imedion 8.4V 250 mAh does well in these low current draw situations hitting that number with a 50 mA draw.

Charger recommendations

I have a bunch of different charges, but the SkyRC MC3000 is super expensive but customizable. It even has a bluetooth connection to your phone so you can charge NiMH, LiFe, Lilo etc. It’s expensive at $105 at Amazon but as with all geek devices hard to use. The other one which I do have and that is pretty much plug and play is the Opus BT 3100 and it can handle AA, AAA and LiIon cells like the 18650 and lots of other sizes so its probably the right one to get for most mortals. Finally if you don’t need Lithium charging, then the Powerex MH-C9000 is a good choice. I have one of these and it works great but note that the Opus is the same price and does Lithium cells.

Li-Ion Recommendations

Perhaps the biggest problem though is a lack of reviews, the number of sites (geekydeck.com)_ that do more than a quick survey of Amazon scores is incredible and it doesn’t pay to do deep reviews much anymore. Plus, some of these are going to need a longevity test which takes time and patience.

The two best sites I’ve found for this topic are Project Farm which does all kinds of random things, in particular he tests a huge number of brands which is great because none of the common household brands are doing this. The long and short is that he really like the Vapcell and the SmartToools for both the charge capacity and the how long they lasted.

Unfortunately, neither of these brands are available, but Tenavolt is all over Amazon right now. There are specialty folks like LiIonWholsale.com with a huge array. Most are the really common 18650 (of early Tesla fame) and also the newer 21700 (now inside the Tesla Model 3/Y) but they have a few AA Size but the Vapcell P1418A is out of stock at $9 each (so they are way more expensive than NiMH). CandlePower Forums has a deeper parameter analysis of this one and it looks pretty at least the 2020 version.

The other recommended battery is the SmartToools (yes that’s three ‘o’s in a row) is also not available that I can find. It is a 2600 mWH battery with 1200 cycles. And, it is MicroUSB charged.

They do have the Opicplus AA with 2800 MwH which is $10.49 in a dual pack for LiIonWhosales. And the Tenavolt INR which is all over Amazon at $35 for four plus the charger at 1850 mAh claimed and 1692 mAh measured). As well as the Pownergy which is micro USB and is $22 for four with a claimed 2960 mWh (or 1973 claimed and 1751 mAh actual)

So, get the LiOn if you need constant voltage, that is it is sensitive to voltage or it to be light weight. The best idea is to first stick some NiMH in and most equipment will work fine. For instance, in a flashlight or in a PS5 or Xbox controller or in a clock. Switch to LiON if you discover the electronics won’t run at lower voltages (Brother P-touch Labelmaker) or if you need it to be light (PowerTap P1 pedals)

The test done by Project Farm does two things, tells you the capacity of the battery at at a given current draw, so at 250 mA Discharge (at 1.5V), how many mAh does it have, in other works, the Vapcell as an example has a capacity of 1999 mAh, so that means it will last 1999 mAh/250mA or about eight hours discharging like that. In comparison, the Smarttools has 1470 mAh so it will last 1470/250=5.9 hours:

  1. Sorbo, 959 mAh
  2. Safeloop, 1103 mAh
  3. Maxwel, 1438
  4. Smartoools, 1470 (does much better at high drain)
  5. MaxLithium, 1593
  6. OpicPlus, 1606
  7. Tenavolt, 1692 (much worse at high drain)
  8. Pownergy, 1751
  9. Blackube, 1830 (worse at high drain)
  10. Amptorrent, 1988
  11. Vapcell, 1999

The second test is how long will you run with high drains, more like 500mA and then they have a fan test which also measures the Voltage as well (via the RPM). So in the test, the Eneloop NiMH runs longer, but runs down to lower voltages. Note this list should be about the same as the previous one if the current drains are close:

  1. Sorbo 102 minutes, $5.50
  2. Safeloop 115, $6
  3. MaxLithium 144, $6
  4. Tenavolts 154, $7.50
  5. Blackube 168, $7.50
  6. Maxwel 172, $7
  7. Pownergy 179, $5
  8. OpicPlus 186, $5
  9. AmpTorrent 188, $7
  10. Smartoools 193, $4.25
  11. Vapcell 233, $8.8
  12. Eneloop 278 minute but much lower voltages at 1.4 down to 1.2

So, given all that and the availability issues, what makes sense to buy now:

  1. Pownergy. These are $22 for four at Amazon, so a decent $5.20 and they are mid-pack in terms of lasting at 179 minutes in high current drains and 1751 mAh at low drain scoring #8 and #7 respectively highest. These use micro USB to charge.
  2. Tenavolts. It’s hard to tell the price since they bundle a charger, but it is $35 for the charger and four batteries. It scored #7 and then #4 highest on these tests, so a notch below the Pownergy

Finally, there are bunch batteries on Amazon that didn’t get tested:

  • Lankoo at $19 for four claiming 2600 mWh (which is 2600mWh/1.5V = 1733 mAh) but it does have USB C connections instead of microUSB
  • Deleepow. This is $14 for four claiming 3200mWh or a whopping 2,133 mAh but it is 4/5 rating on Amazon and requires it’s own charger (for about $2!). Also it says 1500 cycles (vs the normal 1,200 cycles of charge and discharge). It’s not clear if you need that charger or something that understands Lithium

Battery chargers for Li-ion and NiMH

Names for Batteries from AA to AAA…

As aside, the standard formula is the first two digits are the diameter and the second two are the length, so an 18650 is 18mm diameter and 65 mm long. So the AA form factor is also called a 14500 which is 14mm diameter and 50mm long. So if you want to be cool instead of saying AA, you can say L91 or 14500 if it Lithium 😅. And if you are using the International names IEC, then the names vary by battery chemistry so AA is the size, but an LR6 is an Alkaline battery, R15 is Li-Ion, HR6 is NiMH and Li-Fe (Lithium Iron) is FR6. For American standards, the ANSI/NEDA name are 14500 for Lithium, 15A for Alkaline (the traditional one-time use batteries), 15H for NIMH and 15K for NiCd. In China, it’s called a #5, a UM3 in Japan. Confused yet?

If you want to be a complete nerd, then there is an entire list in Wikipedia on this topic, for instance the smaller AAA battery is called the HP16 in the UK. The C battery is HP11, #2 in China, UM 2 in China, LR14 Alkaline. A D battery in china is a #1.

Migrating to Apple iCloud Mail and Research Twitter and Newsletters

Here are the latest feeds and tips from @rich on working better:

  1. YOu can now activate for your vanity domain and have it go to your iCloud account and up to three other vanity domains see Apple  or just go to iCloud Custom Domain and this is really handy for my @tongfamily.com and other single use.
  2. Twitter feeds and email news letters for anyone engaged in AI, Well, since the world seems to be moving away from Medium to Substack newsletters and twitter, I’ve reconfigured my feeds. Here are some tips. First there are now dedicated newsletter reading apps so it doesn’t clog your inbox like Newsletterss, really useful, but I can’t find a way to share these. Also there is a list of good twitter accounts (you might want to delete your Lindsey lohan feed or create a dedicated twitter account but a quick list is here. Springboard include @kaifulee, @googleai, @andrewng, @openai, @jhamrick, @teachthemachine, @lishai88, @amuellerml, @rasbt,…
  3. You can extract your email information from gmail by using https://takeout.google.com, you can extract everything out of google although contacts are useless, you have to use google.com/contacts and go to export for that. I had 160K emails in rich@tongfamily.com! 19GB!

Wow Safari Tab Groups

Are pretty cool and useful, you should give it a try sometime, but when synchronized Its surprisingly useful to be able to switch contexts from any machine. I have right now a tab group for buying stuff, another one for doing slides. And it is really nice you can now drag and drop tabs when in the view all tabs mode (this is the overlaid box icon on iPhones and then 2×2 box icon on the upper right on MacOS and iPadOS).

Also you can drag from the title bar to any tab group is you open up the tab group icon on the upper left. And you can see your current tab group up there as well. Surprisingly useful!

Vim macros and registers that I always forget

So I keep forgetting how useful macros (and registers are) or repetitive things. Basically, Vi has 10 numeric registers and then alphabetic registers.

If you want to see them then type :registers and you can see what is stored there. There are two ways to use them. The first is to stick thinks into a registry, you name register this way with a double quote (get it you are quoting a string and sticking it in). So the way this works is that you name the tag and then yank to copy it and put to paste it in:

  • “ayW – This means <register> is a and then yank a whole word
  • “aP – This means take the contents of register A and put it before the cursor

Then there is a completely different use of the same register which is to record a macro. This is actually just a text string that gets played back, so you do this by q <register> then a string of command and then an ending q. Then play back is @<register>:

  • qadWq. This says start a quote a string put it into register A, then record delete an entire word. Then the second q means the end of the macro
  • @a. This means run macro in register a

Wow Aftershotz Aeropex rocks!

Wow, so glad that Tony recommended these Aftershotz Aeropex and I have to say they are basically awesome. They are lightweight and easy to use. While the audio is going to be thin, they are perfect for a couple of uses:

  1. If you are biking or running and need to hear what is going on they are great.
  2. If you do conference calls while you are on it your ears don’t get tired and because voice sounds great.
  3. This an amazing way to listen to podcasts and then still have a conversation.

So if you want one, they are $159 from BikeTiresDirect as an example with a 10% rebate so not a bad deal.

The miracles of Vim g commands like gx and what heck is * and #?

OK, this is more nerdy, but there are some not so used commands that are super useful all named g for Global or g for Go.

The :g command and it’s reverse :v

This Global command is quicker than the typical :s/old/new/g instead the syntax is [range]g/pattern/cmd which is way more general. For for instance, if you wanted deleted all the lines with with world “hello” in it, you type :g/hello/d

And there is reVerse version so, :v/hello/d means delete all the lines with hello. You can also do this maybe more intuitively with :g!/pattern/d

The cool g command

The there is the Go command so you can do things like gx which means go to the hyperlink underneath, this was broken before on the Mac but works great as of September 2021, but there are bunch to them, more than I think I can remember and you do a :help *g* you will see all the current commands:

  • gf – go to the file name under the cursor
  • gm – go the column in the middle of the screen
  • gq{motion} – go format to the motion, so gq) means wrap lines to the end of the paragraph. You can also do gqq which is short for wrap the current line and for example gqj means wrap down to the next line
  • gu{motion}. Means make lower case (I know, u is lower), so guu means make the current line all lower case.
  • gd. If you loaded and you are in a program file, it will go to the definition of the word under the cursor. It’s not really smart, it basically does an [[ which moves to the beginning of a section and then searches for the word from there.
  • gD. Like gd but starts the search at the top and looks for the first occurrence of the world (it assumes that this is a language where the function is defined before it’s use).

So what the heck are the * and # commands

OK, there commands are really useful for editing html or programs. So, * means go to the next word that is the same as the word the cursor is on. If you are on the say an HTML tag like script then * will get you to the next script tag. and # will send you backwards.

More text stuff: Github command line gh and vim text-objects

OK, it’s taken a while, but in the spirit of typing rather than clicking, here are some notes about how to do all the common things with…


Catching up on dependable pull requests. If you are like me and are getting pull request automatically, here is all you have to do, the only confusing thing is that you need the pull request number or a branch name that you are merging in.

gh pr view
# you will get a set of pull request numbers for instance #16, #17 and #18
# the -r flag says rebase the pull request into the default branch
# normally main (or master in the old days)
# -d means delete the PR when done
gh pr merge 16 -r -d
# if you want it to ask interactively about the flags
gh pr merge 17

If you want to fork a repo into an organization that you control note that since this is github specific, you don’t need git@github.com or the full url, just organization/repo

# to fork the px4-autopilot repo into tong family/px4-autopilot
gh repo fork px4/px4-autopilot --org tongfamily

To create a new repo and the you can add it as a submodule or you can just clone it

# if you want interactive prompts
gh repo create tongfamily/net-px4
# if you know what you want, you can just use flags
gh repo create tongfamily/net-px4 --private --team dev --description "PX4" -g python

Vim motion command and text-objects

Well, that was awesome, but perhaps even more cool is what you can do with the latest VIM and what are called “text-objects”, the documentation is nearly unreadable, but the basic idea is that the old vi had this notion of objects, so if you wanted to deleted an entire word where the cursor is, you can do dw and if you want to change a word, it is cw that is the <command><motion key>.

Well, the latest vim extends this idea with two new operators call around or a and inside or i which means inside, so for instance if you want to change all the text inside a set of parenthesis, you get there and run. The basic idea is that things that are prefixed with a and i are actually “text-objects” rather than motion keys.

ci( - Change inside a parenthesis
ca( - Change everything including the parenthesis
di[ - delete everything inside the brackets there are around the cursor
da[ - delete the brackets too
cas - change everything around the current sentence

Now the really cool thing is that it has the notion of paragraphs (which are things with a blank line) so and like all vim commands, the complete syntax allows a repeat so it is <action> <number of repetitions> <a for around | I for inside> <text-object like (, [, s, p>

c2ap - change for the next 2 paragraphs

And yes they have a very complete list of text objects, just remember for this to work, you have to be inside these objects, so it is helpful to first move there, so you could do say f[ to find the first bracket and then do a ci[ which would change all the text inside of it.

aw - around a word which stops at non-alphanumeric characters like slashes
iw - inside a word 
aW - around a Word which means to the next white space (so an entire URL) 
iW - in a Word delimited by white space
as - around a sentence
is - inside a sentence
ap - around a paragraph (newline separated include white space)
a' - single quote include the quotes
i' - single quotes not including quotes
a" - double quotes (include the quotes)
i" - inside double quotes (leave them there)
a> - around angle brackets (include them), note that a< works too
i> - inside angle brackets
at - around an HTML tag
it - inside an HTML tag
a( - around parenthesis, not that a) and ab also work
i( - inside parentheses, note that that i) and ib also work
a{ - around braces (includes the braces). note that aB works
i{ - inside braces not that i} and iB also work

So some motion commands

f - find to a character landing the cursor on top of it
F - do this searching backwards
t - find a character landing just before the character
T - this is search to going backwards
^ - first character in the line
$ - last character
10| - the vertical bar means go to the 10th character 
w - forward a word delimited non-alphanumerics
W - forward a word delimited by white space
e - go back one word
E - go back a word until the next white space
) - move to the next sentence which is text that ends in ., ! or ? and a space
( - go back a sentence
} - go forward a paragraph which is delimited by a blank line
{ - got backward a paragraph

Finally, if you are really writing paragraphs remember that gqq does a forced word wrap of a paragraph which is really a more general form of the go quote command which takes a motion, so that gqG for example means go format all the way to the end of the document with a G


Finally a note on visual mode. This is actually pretty logical if you think about it, most of the time when you type a one command like say dW you have no idea what running the W command will do. So with visual mode, you reverse the command sequence with vWd and then with the v, you go into highlight mode, then run the motion command, it highlights the text that will be operated on, then it takes the command.

So for instance, if you want so say delete everything to the end of a paragraph, you don’t want to be surprised, you just do a vGGd and then if the GG doesn’t select what you want, you can fix it and then run the command. Nice!

2021-04-29 Of GarageBand, iCloud, Windows Nightmares, Drones setup problems, Mac cleanup, Smart Home and Champagne

Summary

Sorry to be so late doing this, to be truthful, I managed to delete all my GarageBand data when I recreated my machine, so some notes on how to make that that doesn’t happen to you, so you can see more at tongfamily.com, leave me at voice message at anchor.fm or tweet me at @richtong:

  1. GarageBand and backups
  2. Windows nightmares: How to make it work as a developer
  3. Cleaning up a Mac with the ultra-cool System Information > Windows > Storage Management > Reduce Clutter
  4. The latest hints on using the DJI FPV and Skydio V2 drones
  5. Getting a Champagne cork out.

— This episode is sponsored by · Anchor: The easiest way to make a podcast. https://anchor.fm/app — Send in a voice message: https://anchor.fm/richt/message

Transcription

Still working on this