Blog

The All-In Summit 2022 – Takeaways

I had the privilege of attending The All-In Summit last week in Miami. Here’s my takeaways.

 

Background

The All-In Podcast is run by investors Jason Calcanis, David Freedberg, Chamath Polyhopitia, and David Sacks. It was started out of starvation of human contact during Covid Lockdown in March 2020. They debate wide-ranging topics and share their conversations publically on YouTube and on the Podcast every Friday night.

World

Declining Birth Rate

Having more children is not worse for the environment. Birth rates are globally decreasing and at historical lows. As it stands China is likely to have a population of 600 million by 2095 if you extrapolate current numbers (the Chinese population is currently 1.4 billion). If you are concerned about how terrible today’s world is and are concerned about bringing children into it, look at history, things are a lot better now than they have been in the past. Think running water.

Importance of Military Technology

  • “Whoever becomes the leader in artificial intelligence will become the ruler of the world” – Vladimir Putin
  • There have been more mattress unicorns than defense industry unicorns in the last 30 years
  • The US is spending 52 billion on semiconductors within our borders. Meanwhile, Apple is investing over 200 billion into China
  • War breaks out when adversaries estimate they can win… if they are both unsure of the outcome you get diplomatic solutions

  On China

  • Talk from Claire Thielke
  • The average white-collar worker works 20 years to buy an apartment
  • China real estate is 10-15 years ahead of the US in technology: New buildings in China run on We Chat, We Chat is your ID, unlocks your doors, how you pay rent, do receipts, pay taxes, talk to your landlord, organize with your neighbors
  • China government does 5-year plans, currently on the 14th 5-year plan
  • 5-year plan sets KPIs and government officials are measured against those KPIs
  • China is as urbanized as the 1950s US (I’m assuming this is by % of geography)
  • I will posit that Elon is a slave driver, you will not stay at Tesla US if you are lazy. That being said Elon says Tesla China is more productive than Tesla US. China workers are motivated.
  • That being said, US workers are 15x more productive than Chinese on a GDP basis

U.S. / Politics

Tim Urban gave a very compelling talk on politics. You should watch this. Discourse in the country has reverted to “low-rung” politics, where ideas cannot be discussed, and if you disagree with the prevailing party then you are labeled as a fascist/nazi. This type of politics is regressive, whereas high rung politics are more aligned with the scientific method and the intent to improve the overall state of the country.

“We need to stop infighting in the US and stop punching ourselves in the face and step up our game because if we don’t we will not hold our place in the world.” – Elon Musk

Everyone should watch Ray Dalio’s changing world order video (45 Minutes).

Economy

We more likely than not are in a recession. The recession will last somewhere between 6 months and 24+ months. Taking into account scenario planning the line is drawn at approximately 14 months of recession, possibly shorter, possibly longer. Pre-covid valuations are the new normal again.

Recessions are not necessarily a bad thing. When a boom goes on for too long money rains on fools and there is a misallocation of human capital. Bullshit companies go bankrupt and the ones making useful products will be fine.

Plan on at least 24 months of burn rate in the bank because you might not be able to raise more money for at least 2 years, possibly more.

The new normal looks like the pre-covid normal. The stock market is still up 30% vs January 2020

Business

“If you don’t do your chores then the company goes to hell. No one likes doing chores.” – Elon Musk

“Great companies are built by great engineers, ruined by great CMOs, and destroyed by great CFOs” – Antonio Gracias

Outside of productivity tools, there is not a single software company that can get really really big doing one thing only. Slack is an example of one that can do one thing and get really big. There are only 21 software companies with more than 1 billion in revenue.

“Business keeps changing and so there will always be a need for new B2B SaaS companies” – David Sacks

The following notes from BG2

  • A 1% change in interest rates is equivalent to a 15% change in valuation multiples
  • 50% year over year growth is good for about 8.6x revenue
  • Without that growth more like 5x
  • Focus on net term retention and free cashflow
  • If you want a real look at what’s going on you need to deconstruct CPI and build a model around it. Real inflation is more like 16%
  • Negative unit economics is a viable strategy only if you are capable of reining it in, and if you tried it 50 times it probably works once
  • Growth stocks will be 6.385% higher in a year – Bill Gurley

Technology

Military Tech has been systematically under-invested in for decades since the fall of the Soviet Union. Wars happen when states calculate that they have a better chance of winning a war against another state. When states feel mismatched in a war diplomatic solutions are found. Warfare is increasingly reliant on drones to the point that drones that can destroy drones are becoming increasingly important in modern warfare.

Crypto

  • Miami government created a cryptocurrency project? The mayor thinks of crypto as a means for economic development. By creating the project Miami was able to attract more tech companies and VCs. Still smells like vaporware though.
  • Crypto market is a sponge for excess liquidity
  • Bitcoin is a hedge on political risk. Ukraine is the 3rd largest holder of bitcoins.
  • “If I lived in Taiwan I’d have 50% of my net worth in bitcoin” – Antonio Gracias

Real Estate

Real estate is not experiencing the same economic downturn as public or private markets. Real estate generally lags the broader economy (the Great Financial Crisis of 2008 culminated in March 2009 stock market lows and real estate prices hit their lows in 2011).

The housing market is unlikely to crash because people aren’t using their homes as an ATM like they were in 2008, and there is no supply. The housing market has been under-invested in (from a new construction standpoint) since 2008.

On Poker

  • Chamath argues poker is the best business training you can get because you are constantly dealing with good, moderate, and incorrect information and managing risk
  • You play better when someone else stakes you

 

End of line

Do what you want but it is my belief that listening/watching (watching is better cuz they show the charts etc) to this podcast is the single smartest thing you can pay attention to on a weekly basis.

The All In Podcast Youtube Spotify Twitter

 

Migrating WordPress from Pagely

Pagely is an expensive and robust solution for WordPress hosting. With the right caching setup wordpress can be performant, so let’s slap it in a docker container behind nginx.

To get off of Pagely, the most critical thing you’ll need to do with your exported backups is to make sure to either remove or rename or remove the mu-plugins folder.

  1. Rename or delete mu-plugins/ from the folder export.
  2. Import the database and wp-content directories.

What’s easier than physically moving your wp-content directory is using the Updraft Plus plugin to create a backup of your wordpress install.

Redirect Hell

Setting the siteurl and home settings in the database shoots me into redirect hell.

 

Setting as localhost instead of localhost/blog yields a somewhat more functional site, but all the links are broken and nothing tends to work. I must need PHP 5. (This was definitely not the solution)

So it all works after disbabling the pagely plugins but this reverse proxying to a docker container from a subfolder thing, wordpress really doesn’t appear to like it very much. Everything worked for a second but now it doesnt again, just stuck in a 301 redirect loop to itself. The wp-admin functions fine as long as you remember to add the trailing slash on the URL.

Endless redirect loops later, we’re still stuck in a redirect loop.

Hopefully you won’t need to spend that much time dickerin with it.

wp-config.php

define('FORCE_SSL_ADMIN', true);

define('WP_HOME', 'http://example.com/newblog/');
define('WP_SITEURL', 'http://example/newblog/');

$_SERVER['REQUEST_URI'] = '/newblog' . $_SERVER['REQUEST_URI'];

This $_SERVER['REQUEST_URI'] line was the most helpful fix I came across. I had previously been using $_SERVER['REQUEST_URI'] = str_replace("/wp-admin/", "/blog/wp-admin/", $_SERVER['REQUEST_URI']); as recommended by several resources in place for the wp-admin but rewriting the whole URI with $_SERVER['REQUEST_URI'] = '/newblog' . $_SERVER['REQUEST_URI']; stopped redirect hell.

/etc/nginx/sites-enabled/default

We’ll add a section for nginx to proxy to the wordpress container.

    location /newblog/ {
        access_log off;
        auth_basic off;

        rewrite /newblog/wp-admin$ $scheme://$host$uri/ permanent; # This line redirects /newblog/wp-admin to /newblog/wp-admin/ which is nice to have. 

        proxy_set_header  Host               $host;
        proxy_set_header  X-Real-IP          $remote_addr;
        proxy_set_header  X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Proto  $http_x_forwarded_proto;

        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_read_timeout    90;
        proxy_connect_timeout 90;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Proxy "";

        proxy_redirect    off;
        proxy_pass        http://wordpress/;
    }

.htaccess

The .htaccess file that wordpress creates will attempt to make the RewriteBase and RewriteRule include the newblog/ part of the URL, which we don’t want, and will cause a redirect loop.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

The deploy

So it all works after destroying and rebuilding containers. What are the steps to do it live?

  1. ✅ Install Updraft Plus and create a backup, stuff it in dropbox.
  2. ✅ Deploy the containers, on the /newblog/ URL.
  3. ✅ Run our install script via wp_cli:
#!/bin/bash

docker-compose run wp_cli core install --url='http://example.com/newblog/' --title=temp --admin_user=temp [email protected] --admin_password="password"
docker-compose run wp_cli plugin install updraftplus --activate
  1. ✅ Connect dropbox in the updraft plus plugin. Click rescan remote storage, select the backup to install, and restore that backup.
  2. ✅ Reset the siteurl and home options in the wp_options table.
mysql -uroot -psecret -h 0.0.0.0 wp_database -e 'update wp_options set option_value = "http://example.com/newblog" where option_name = "siteurl" or option_name = "home"'
  1. 💣 Make sure it all works!
  2. ✅ Remove the old nginx redirect for the /blog url and replace it with the /newblog directive. Update the wp-config.php and the database to remove the references to /newblog.
  3. ✅ Shut down pagely. Keep your money.

HTTPS Support.

We didn’t test SSL support locally before deployment, and it’s easy to bang your head against the wall chasing down a fix for a problem that’s the result of something else.

Turns out that Jeff’s Application Load Balancers handle SSL termination and thus pass http_x_forwarded_proto. We set that right in the nginx config and suddenly there is no more redirect hell, and everything’s running on https.

The line in the nginx config proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; must use x_forwarded_proto instead of $scheme since we’re behind an ALB on AWS. This is only needed if you’re using nginx behind an application load balancer on aws, otherwise using $scheme should allegedly work.


Resources

github ↗ a5hleyrich/wordpress-nginx
docs.j7k6.org ↗ Basically looks to be exactly what we are looking for, but not quite.
stackoverflow ↗ nginx subpath to redirect to wordpress docker container

serverfault ↗ hosting a wordpress blog using nginx as a sub directory
stackoverflow ↗ wordpress nginx proxy and subdirectory wp login php redirects to domain

stackexchange ↗ wordpress wp admin https redirect loop

stackexchange ↗ https leads to sorry you are not allowed to access this page
stackexchange ↗ setting server https on prevents access to wp-admin

codex.wordpress.org ↗ administration over ssl

serverfault ↗ x forward proto custom header