{"id":8303,"date":"2022-10-11T06:29:55","date_gmt":"2022-10-11T11:29:55","guid":{"rendered":"https:\/\/bobbeaty.com\/wp\/?p=8303"},"modified":"2022-10-13T10:59:44","modified_gmt":"2022-10-13T15:59:44","slug":"setting-up-ipad-pro-development","status":"publish","type":"post","link":"https:\/\/bobbeaty.com\/wp\/archives\/8303","title":{"rendered":"Setting up iPad Pro Development"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/bobbeaty.com\/wp\/wp-content\/uploads\/2021\/12\/iPadPro.jpeg\" alt=\"IPadPro\" title=\"iPadPro.jpeg\" border=\"0\" width=\"130\" height=\"130\" style=\"float:right;\" \/><\/p>\n<p>I have been doing some manual tasks that I decided today I really wanted to automate. The problem was, it was updating a few rows in a database, and so I didn't really want to expose an endpoint that achieve this, just on the very slim chance that the service might get hacked. I know, we protect these things carefully with Google Cloud Tasks, but I just felt these tasks needed to be done outside the scope of the running service, and it was possible, but tiring, to do it manually. First, with <tt>psql<\/tt>, and then with a <tt>bash<\/tt> script which took command-line options, and then called <tt>psql<\/tt>, and made the updates.<\/p>\n<p>In all, it wasn't a bad idea. And it was working just fine - except for the <em>tired<\/em> part. \ud83d\ude42 So while I didn't want to set up a <tt>crontab<\/tt> job on my laptop, I could set up one on a Cloud VM that is only accessible by me based on an RSA key. That is secure, and it's out on the network, so I don't have to worry about my internet service going down.<\/p>\n<p>So I needed to have some way to replicate my entire development environment onto my iPad Pro, and then from there use the tools I've pulled together to try and make this happen, and decided to push it that last little bit.<\/p>\n<p>Starting with Working Copy on the iPad, I have a complete, stand-alone Git client that has created local directories on my iPad so that an editor like Textastic on the iPad can access these files, save to them, and Working Copy will detect the changes. Additionally, Textastic can upload the files to a hope using <tt>scp<\/tt>, so I can edit and save, upload and test, and then make a PR, and push up to GitHub.<\/p>\n<p>I needed to be able to run Node, and a few more <em>watching<\/em> commands on the box, so I had to get everything up on the Ubuntu 22.04 box in the Cloud, and then wrangle everything to get it all going. The most troublesome thing is that <tt>mosh<\/tt>, the Mobile Shell that I use with Blink on my iPad, doesn't allow for SSH Key Forwarding. It's something about <tt>mosh<\/tt>, and I understand the reason, but I also know the <tt>mosh<\/tt> folks are working to fix this - but it is annoying not to be able to use <tt>git<\/tt> within <tt>mosh<\/tt> because the SSH keys aren't carried up in the communication stack.<\/p>\n<p>Still, with conventional <tt>ssh<\/tt>, they are carried, and I can use that, as needed. Someday soon, there will be a way to use something like Guardian Angel for the SSH key forwarding in <tt>mosh<\/tt>, but for now, this works.<\/p>\n<p>At this point, I can edit locally... push to the cloud, have <tt>nodemon<\/tt> restart the server on any change... and hit the service on the standard Node port 6543. But then I needed to get <tt>nginx<\/tt> forwarding HTTPS to port 6543, and that's another challenge for another day.<\/p>\n<p>What I can do is to run the <tt>bash<\/tt> scripts on the Cloud VM, and then crontab the runs so that I can never again have to worry about being so tired from running these commands at odd hours. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been doing some manual tasks that I decided today I really wanted to automate. The problem was, it was updating a few rows in a database, and so I didn&#8217;t really want to expose an endpoint that achieve this, just on the very slim chance that the service might get hacked. I know, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12],"tags":[],"class_list":["post-8303","post","type-post","status-publish","format-standard","hentry","category-coding","category-javascript-coding"],"_links":{"self":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/8303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/comments?post=8303"}],"version-history":[{"count":2,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/8303\/revisions"}],"predecessor-version":[{"id":8312,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/8303\/revisions\/8312"}],"wp:attachment":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/media?parent=8303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/categories?post=8303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/tags?post=8303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}