The Only Three Ways To Be More Productive

I’ve met plenty of people who have “five years of marketing experience” that can’t market as well as someone who has worked in marketing for six months but read the fundamental books of the field.

At the end of the day or week, make a list of your least valuable tasks and ask: “Is it profitable?” If not, stop doing it. If yes, can you delegate it?

From https://taylorpearson.me/3productivity/

Advertisements

Everything You’ve Been Taught About How To Read a Book Is Wrong

the main role of reading is improving your model of the world to more accurately reflect reality so that you can make better decisions.

The reason for reading a book is not to be able to spit back facts at a cocktail party — it’s to shape the way you think.

From https://taylorpearson.me/howtoreadabook/

Log mysql queries in Docker container

To log mariadb (mysql) SQL queries in a Docker container add - ./docker/mysql/conf.d:/etc/mysql/conf.d to volumes of the database service.

version: '3'

services:
   db:
     container_name: db
     image: mariadb:10.1
     volumes:
       - db_data:/var/lib/mysql
       - ./docker/mysql/conf.d:/etc/mysql/conf.d
     environment:
       MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'

volumes:
    db_data:

The contents of docker/mysql/conf.d/my.cnf

# docker/mysql/conf.d/my.cnf

[mysqld]
general_log = 1
general_log_file = /var/log/mysql/query.log

slow_query_log = 1
long_query_time = 1 # seconds
slow_query_log_file = /var/log/mysql/slow.log
log_queries_not_using_indexes = 0

 

Tried mitmproxy & mitmweb

Today I came by https://mitmproxy.org/ and gave it a shot just to know what it is capable of. For example for REST API communication debugging. The mitmweb is in beta, but looks good and also worked for me 🙂

The best is that they provide a docker image so trying it out was really simple.

  1. Just run docker run --rm -it -p 8080:8080 -p 8081:8081 --net="host" mitmproxy/mitmproxy mitmweb
  2. Open http://127.0.01:8081
  3. I changed Firefox to use proxy at 127.0.0.1 and port 8080 and browsed the web with mitmproxy intercepting the HTTP communication

mitmproxy & mitmweb

Put WordPress in maintenance mode without a plugin

1. In your web root directory (where the wp-config.php is located) create file .maintenance
2. It’s content should be <?php $upgrading = time();
3. You can customize the page by creating wp-content/maintenance.php

See source https://github.com/WordPress/WordPress/blob/9041e7a07150b10ed28ec274374ce7d397b0ac9b/wp-includes/load.php#L203-L206

GitHub compare for changelog check

Changelogs are handy sometimes, but I’m curious so I prefer to see code changes and learn new things so while the new WordPress security release came by I looked at it at GitHub with compare

https://github.com/WordPress/WordPress/compare/4.8.14.8.2

I also checked what’s new in Arch Linux’s today’s VIM update.

https://github.com/vim/vim/compare/v8.0.1092v8.0.1127

To check other repo just replace thinks in the URL:

https://github.com/NAMESPACE/REPOSITORY/compare/TAG_BRANCH_FROM...TAG_BRANCH_TO

For more about GitHub compare read https://help.github.com/articles/comparing-commits-across-time/