Vagrant, Time Machine, and waiting forever for a backup

For some reason, moving to the new MacBook Air hasn’t been very successful. My Alfred spotlight is broken, Apple Mail slows to a crawl for no good reason even though everything is in the cloud, and I have a \<50% success rate of backing up my Time Machine during my workday. Basically if it doesn’t complete before lunch, it isn’t going to finish at all.

That last one seems to be well within the realm of what’s feasible. I mean why is it backing up 15GB of new files each day and why is it when I really get working the last 2GB never seems to complete? Not to mention that this 5TB drive I purchased four years ago to back up what is only a 500GB SSD (was smaller in years back) is now starting to appear full.

Well I think I figured it out. I’ve been using Vagrant for the last 5 years to build out virtual machines for development and each of them is a single (very large) virtualbox file that needs to be re-imaged every time and is constantly changing if the machine is up during the backup process.

After some research here are some suggestions on what to exclude from your time machine backups

Working scratch folders:

Things like ~/.Trash and ~/Library/Caches should automatically be excluded by Time Machine in general, but for me, I use ~/Downloads as scratch space for stuff that I don’t care if I lose. If it’s important, I usually drag that to desktop, so I added that. You can add something similar

Cloud files

I added ~/Dropbox because that stuff will be built from Dropbox, and Time Machine or migration restores will just confuse the backup system. If I used Google Drive, I’d probably add that too.

Virtual machines and other dev related environments

For me that’s ~/.vagrant.d and ~/VirtualBox VMs where vagrant downloads the boxes and where, by default, it puts the VirtualBox VMs. The actual boxes that I might image to do Windows/IE development are manually created and imaged in ~/Documents so there is no need to exclude those. If you want to keep your plugins then save ~/.vagrant.d/boxes only.

I also added ~/Library/Containers/com.docker.docker because sometimes I did Docker development and that’s where those instances are.

Also if you have a standard place where you put Python virtual environments with virtualenv you should probably add that too. I don’t develop on localhost anymore so that isn’t the case for me.

Local software caches

I added ~/.gem for Ruby and ~/.npm for NodeJS. I’d probably look into what I can torch from rbenv and rvm but I no longer do local Ruby development, but if you do, add those to your checklist.

Games

I don’t have this on my work computer, but on my home one, I added ~/Library/Application Support Steam/steamapps because those are big files that are downloaded from the internet anyway. When I get home, I’ll have to make sure that sort of thing wasn’t moved into /Users/Shared.

Unknown unknowns

I probably should figure out where Ulysses puts its files because every time I do Migration Assistant I have unresolved conflicts which take forever to clean up. It’s not a big deal though since almost all copies are actually the same file.

Know of any other things I need to add?

I’m speaking again!

If you haven’t been paying attention, I’m starting to speak again at PHP conferences. The first one is SunshinePHP in Florida. (I figured I needed to see the Sunshine State again before it all goes under water.)

My talk is going to be a case study on recommender systems. It’s a bit of an odd-ball because it’s not PHP-specific, but that’s because the company I worked at was a Ruby-on-Rails shop. It’s okay, it will still have application and ironically the heavy lifting is done in Python and Go. Lol! Trust me, it’ll be a good talk. Data is an important part of any website and this gets you going into how you can use it without all the bullshit “big data” buzzwords.

I really think you should register for the conference and come see the talk. If you are already going, please stop by and say “hi!” I promise, I won’t bite too much. I’ll be there for the entire event and this time I already have my talk 95% done so I won’t be holed up in the hotel room finishing slides. It’s been much too long since I’ve seen anyone in the community, and I’ve got to earn my place on the PHP terrorist deck.

See you in February!

Running Python scripts on a schedule in AWS

Answered in Quora:

Q: What is the easiest/fastest way to set up AWS to repeatedly run a small Python or PHP script (24×7)?

Probably the easiest way is to use Lambda. It has a built-in scheduler and you only pay for the time it is running. (Note that in PHP you have to create a lambda package using this tutorial or via node Serverless here.)

If you mean continuously, and not repeatedly, then the caveat for PHP at least, it is a bad idea to have it repeat forever in the process because it was designed to be set up and torn down and might leak memory (with the proper setting to set_time_limit and ignore_user_abort, have it run forever). In those cases you would have something else constantly call the php script via command line and restart.

Other than that, whether PHP or Python or whatever, it is better to create a non-burstable EC2 instance and run it, since it will always have some load. You can write something simple to the crontab that will make sure the process is always running or, better yet, use forever.

Old alumni page

One thing I’ll always be grateful to my father for was buying me a lifetime Caltech alumni membership on my graduation.

Dear Terry,

We are writing to share news about your Alumni Website. You may have received this email already, and if so, I apologize for the duplicate announcement. For those that have not received it, we are aware that many of our emails are being caught by Spam or getting lost so we want to make sure you are aware of this news.

We are upgrading the SquirrelMail server to Microsoft Office 365. This means that your alumnus.caltech.edu webpage will not transfer and we will no longer be able to host your site. You will need to transfer any photos or documents you wish to keep. The current alumni server will be decommissioned on December 17, 2018.

If you would like to keep your website address, we are able to provide you with a redirect. This will only provide you with a redirect and will not transfer any documents or photos to your new site. Please fill out this form: Alumnus Website Redirect before December 15, 2018. If you do not have a webpage address ready, we can also create one at a later date.

To log in: please go to: https://alumnus.alumni.caltech.edu/wp-admin
Your website is: http://alumnus.caltech.edu/~tychay/

The Caltech Alumni Association has been working diligently to help support a widely inclusive and connected alumni community.
Thank you for your understanding. If you have any questions, please email us at email@alumni.caltech.edu or call us at 626.395.6592.

Thank you,
The Caltech Alumni Association

First of all, wow, we were using a WordPress install for authentication for a CMS? Since when?

Second of all, I had a alumni page? Since when?

Hmm…

&lt;HEAD&gt;
&lt;TITLE&gt;terrychay&lt;/TITLE&gt;
&lt;/HEAD&gt;

&lt;BODY&gt;
&lt;P&gt; My homepages
&lt;OL&gt;
&lt;LI&gt; &lt;a href=&quot;http://www.pws.uiuc.edu/~tychay/&quot;&gt;Old physics page&lt;/a&gt;
&lt;LI&gt; &lt;a href=&quot;http://guava.physics.uiuc.edu/~tychay/photo/&quot;&gt;Photo Album&lt;/a&gt;
&lt;LI&gt; &lt;a href=&quot;http://guava.physics.uiuc.edu/~tychay/swing/&quot;&gt;Swing Society&lt;/a&gt; (site I designed)
&lt;LI&gt; &lt;a href=&quot;http://phy290p.physics.uiuc.edu/&quot;&gt;Personal Webserver&lt;/a&gt; (intermittent)
&lt;LI&gt; &lt;a href=&quot;http://game1.zipasia.com/actions/&quot;&gt;Adobe GoLive Actions&lt;/a&gt;  (may be moved)
&lt;LI&gt; &lt;a href=&quot;http://www.zipasia.com/&quot;&gt;ZipAsia&lt;/a&gt; (current employer)
&lt;LI&gt; &lt;a href=&quot;http://game1.zipasia.com/&quot;&gt;Zip2Games&lt;/a&gt; (current project)
&lt;/OL&gt;
&lt;P&gt;I&#039;ll consolidate this sometime. It&#039;ll be so 3leet that it will be 4leet!
&lt;/BODY&gt;

Wow, that’s some old shit. I must have done that over 18 years ago. None of the links there even work. The days when we used to capitalize HTML tags, which is the reason why PHP functions are case insensitive by the way.

I never did get 4leet status by consolidating all my internet sites. They just all went down the memory hole. I think I’m going to let this one go that way also.

What’s something very few people know about PHP?

Answered in Quora:

Q: What’s something very few people know about PHP?

It is mind-bogglingly popular for web development. That popularity hasn’t diminished even though conventional wisdom says otherwise…

Over a decade ago, I said about 40% of the top 100 websites use PHP — a number I pulled out of my ass — but nobody (not even the Ruby on Rails developers I pissed off) argued with that spurious claim. In 2009, Matt Mullenweg, the creator of WordPress became curious with my claim and did a survey of Quantcast’s top 100 sites — he got almost exactly 40. Even today, among the 10 most important websites, four use PHP as their language of choice — 40% again.

Overall, almost 80% of the internet is powered by PHP, and that has held steady for years! Newer web languages such as Ruby or NodeJS have only grown at the expense of other languages such as ASP, Java, or Perl.

Just one single application written in PHP, WordPress, is used by over 30% of all websites on the entirety of the internet. That’s more than double the market share since back when I last worked at Automattic/WordPress in 2011! It grew until it saturated its entire market — over 60% of all CMSs. In the CMS market as a whole, PHP-based CMSs occupy positions 1, 2, 3, 6, 7, and 8 in the top 10. The most popular non-PHP-based CMS is both closed source and sitting at only a 2.5% share.

It was estimated back in 2009 that there were 5 million PHP developers worldwide. It’s difficult to make this estimate today, but it’s obvious that that number has also held steady or grown.

These last few years, I’ve been commercially working in Ruby (on Rails), GoLang, NodeJS (for static servers), and Python (Django), but PHP is still also my love in that love/hate relationship.

Come see my talk in February 2019 at SunshinePHP in Florida!

What don’t you like about PHP?

Answered in Quora:

Q: What don’t you like about PHP?

It’s a ball of nails with almost no logic to it. From the perspective of software language design — as Tim Bray, co-creator of XML and at the time Directory of Sun Microsystems’s Web Technologies division, once said — “PHP is soul destroying.”

To take one of the most notorious examples: strpos and in_array.

In one, the order of variables is $needle, $haystack in the other it is $haystack, $needle. I challenge even the best PHP developers to remember which it is without a reference. Also, even though they both serve the same purpose they return different things and don’t obey a consistent naming convention: they should be named strpos/arrayin, posinstr/inarray or `str_pos`/`array_in`. That’s three terrible design choices in one single example!

Another example is the namespace separator in PHP is what is an escape sequence everywhere else \\. Why? Because by the time PHP added namespaces, they had run out of ASCII symbols for the lexer.

I could go on and on, but I won’t.

I love the language sometimes because I hate it so much. 😉

Come see my talk in February 2019 at SunshinePHP in Florida!

After being constantly bothered by your automated help

Let’s just say when my phone buzzes at 10:30pm and again at 12am. I turn into Statler or Waldorf

Dear DoorDash support,

I did not do this support request. I’ve never used your service. (I believe many at a previous company I worked at would use you when catered lunch wasn’t ordered that day, but I’m among those that subscribed to the theory of “Learned Laziness.”) In fact, initially I thought this was phishing or spam because we have no previous business relationship or customer interaction.

If the person who whined to you to create this support ticket provided a phone number or other contact information —which I’m sure they did if there was a real order attached — please contact them through that order and tell them to not mistype their email in the future. I can understand how not receiving their hot pockets or whatnot on time can be stressful (in my younger years I’d have probably blown up for less if ordering-shit-from-my-iPhone-because-I’m-too-lazy-to-walk-downstairs were a thing), but that’s no excuse for not double-checking what one is typing in the contact field(s).

If I keep receiving these e-mails , I’ll simply train my mail filters to ignore and and all future e-mails coming from you.

I wish you all the best! Thank you.

terry

P.S. There is an apostrophe in “youve.” I normally wouldn’t mention it, but it’s in e-mail template you have probably sent out more than 10 million times and I’d have think it’d be a little embarrassing that the $970 million in venture capital you took in didn’t pay for a spell-checker.

Begin forwarded message:

From: “support@doordash.com” \<support@doordash.com>
Subject: Thanks for contacting DoorDash Support!
Date: September 17, 2018 at 10:30:31 PM PDT

Hello,

Thanks for contacting DoorDash!

This email is to confirm that we have received your request. Our team will be following up with you shortly.

If you do not receive a response within the next 48 hours, please make sure to check your spam or junk folder to ensure our messages can reach you.

In the meantime, check out our Dasher Help Center! We have curated answers for your most asked questions.

Your reference number is xxxx.

Sincerely,
DoorDash Support
DoorDash Help

Begin forwarded message:

From: “support@doordash.com” \<support@doordash.com>
Subject: DoorDash Inquiry
Date: September 18, 2018 at 12:11:54 AM PDT

Hi ,

Thank you so much for reaching out to us regarding your inquiry. We’re happy to look into this for you; however, we need more information regarding the issue/concern you’ve encountered.

In line with this, can you please provide us details of your inquiry, the name/email on the account so that we can have it checked and verified from our end!

Hoping to hear from you soon,! Thank you for your patience and understanding in dealing with this matter.

Take care and be safe!

Your reference number for this request is xxxx.

Best,
Allan
DoorDash Support
DoorDash Help

ref:_00D1aKEiH._5001ajJUcj:ref

Back Kill Merlin!

My former CTO started to develop a board game with his kids back when I started working there. He just posted it on Kickstarter and you need to back it right now!

It’s pretty amazing seeing it evolve from just a bunch of handwritten cards and a board to what it is today.

But if you don’t believe my review, you can always check out independent reviews on BoardGameGeek.

It was a struggle balancing this game with his wonderful family and a startup to boot. I remember discussing with him the struggles of whether to go to GenCon and still making his kids’ events.

Personally, I wish the title of the game was someone else than Merlin , but other than that, I’d have given the game more thumbs up if I could.

And, Dave, if you are reading this. Yes, I was backer 139. I would have been a lower number but… well you know what’s happening on my end 😉

Which has better packages, Python or PHP?

Answered in Quora

Q: Which has better packages, Python or PHP?

It depends on the target utility. In the Python world, the most common package installer is pip; the PHP world didn’t settle on a dominant format/installation for packages until composer, and that was relatively recently (last 4 years).

The reason for this is because PHP is a language almost exclusively designed for websites, and the economy of the open-source world has found that a dedicated application, instead of a framework or library could serve the bulk of most commercial needs. For instance, a single application, WordPress, four years ago (2014) accounted for nearly 20% of all websites and 50% of all blogs. There is little need package management when a single download and install (or a single click during ISP/hosting account creation or visit to site like Bitnami) can set up everything a typical website might need, fully under your control, with its own package infrastructure (plugin and theme ecosystem) where the underlying language (PHP) is pretty much irrelevant to the user.

Other languages like Ruby (with gems) or Go (import) or Javascript (with npm) which matured later and are more general purpose had a more robust package management and installation system. PHP Composer, in fact, is most modeled on npm.

Python, like Perl, predates these languages, but its general purpose demanded package management early in its development. However, because of this, pip takes less advantage of web conventions that npm does. Python has the added headache of version compatibility with its core runtime. Still pip is perfectly workable and relatively seamless and easy to use.

So which has better packages? The answer is it depends on the domain. In nearly any language you can find an adequate package for any of your needs, but overall you will find the packages are higher quality, more up-to-date, and sometimes just better overall in the domain the language seems to target well.

In my opinion, packages for data science/AI/ML applications, Python packages are second to none. As a PHP expert, I wouldn’t even bother looking in Composer for them and would instead find a PHP extension that binded to a dedicated engine optimized for the problem area or write a dedicated solution/web service in Python/flask and call it from PHP. If, for some crazy reason, I needed to do this entirely within PHP, I would search for the best solution in Python and see if someone has a port for that in PHP.

I would expect the same in DevOps for Python, but right now that space, like blogging (WordPress), seems to have dedicated solutions where a domain-specific language has abstracted one from the language-specific package management solution. For instance, in the configuration management space the top four applications are: Puppet, Chef, Ansible, and SaltStack. Of those four, I believe only one (Chef) exposes the underlying language (Ruby), and it does this to the DevOps engineer no more than WordPress exposes PHP to a blogger.

For server-side web-based packages, I feel PHP and Composer are going to have a solution for any problem PHP itself is capable of solving. That is a restricted set, however, as more and more work for web applications is being done on the client-side in Javascript and there is already an adequate toolchain for that (as well as a package management system in npm). Other web-based languages will probably have adequate solutions in this space with decreasing order/quality: Ruby (on Rails), Javascript (NodeJS), Python, Go, Perl, Java… The web problem is now pretty discovered at this point so there is less a need to adopt the bleeding edge in the web problem.