Outstanding Advice from a tribe of mentors

This will be my final post covering tribe of mentors. If you are a little bit lost and not sure which direction to take you will find a lot of great advice and pointers from this book. It is a great reference book and I’d recommend it to all.

In a previous post, I wrote a quick review on the book Tribe of Mentors but I also wanted to give you some of the advice that stood out to me.

1- Personal Development and Routine

Discipline = Freedom. We are always between freedom and bondage. We move away from freedom when we lack discipline. Freedom to choose the life you want comes only by discipline. There are extreme cases where one really can’t choose, but for the average person, this is a fortunate choice to have.

To become the best you, you must work on your own weaknesses continuously.

2 – Learning

The best student wins. Make sure that you are a life long student, make sure you grow to become the best student.

All successful people read a lot. An example is Terry Cruise. He is a man of great depth who has an incredible reading list. You would think that comedians are just naturally good at telling stories that make people laugh. Now I know why some comedians make it in life: they read! See Trevor Noah’s favorite books as an example: https://www.nytimes.com/2016/11/11/t-magazine/entertainment/trevor-noah-favorite-books-list.html

Be in a hurry to learn, not to get validation. Embrace change and keep learning, the only way to stay relevant.

We arrive at certain destinations because of our decisions. Our choices are mostly a result of how we weighed our options. From Julia Galef’s interview, I learned that most advice is one size fits all but that the best advice helps one improve judgment.

Tom Peters stated, “The number one failings of CEOs: they don’t read enough”. I was so inspired by how much the mentors read and how many of them actually made time for reading in their schedule. Reading is absolutely critical. You can not avoid this if you desire growth. Reading is probably the most important career and life habit and is one strand that connects all the mentors. To be well prepared for all situations one must read a wide range of topics, even poetry.

3- Health.

In pursuit of success, you can’t ignore your health.  Resting is important, simply put: Uptime is as important as downtime and growth come from periods of rest.

Even if you don’t exercise you should at least make time to walk. Make it part of your life. Walk a little.

Eating healthy is critical and sugar is toxic. Avoid sugar especially soda and juice.

The important things in life must be done in parallel: relationships, health, religion, work.

4 – Success

No success came overnight. Even if that is what the media would like you to believe.

It is possible to out-prepare any competition.

To future proof yourself, focus on personal resilience and emotional intelligence.

Choose opportunities based on the people you get to work with. Skate to where the puck is going and remember persistence is greater than talent.

To reach success Tom Peters said: Become a superstar, all-pro listener, read up on it, work on it, have a mentor grade you on it.

Beware the “philosophologist”. Beware the one who has not been in the trenches. Seek wisdom from people who’ve done it, not the people who teach it.

5- People

On saying no: Have a yes list, for everything else say no.

Saying maybe, when you want to say no, is lying to yourself and others.

Say no to complaints, blame, and gossip.

Don’t underestimate languages. It is the doorway to another world.

There is so much to gain from being generous. Generosity elevates us all.

Avoid ego and embrace truth. Ego’s focus is: who is right. Truth focuses on what is right.

6 – Attitude and Personal Philosophy

Have a Gratitude Journal, write in it and read it. This gives you perspective.

Self-esteem, the reputation you have with yourself. Do not do things that erode that reputation.

Confidence is overrated and even irritating -try Courage. As you take courage and build up a track record of success, with yourself, genuine confidence grows.


Other Posts you may like:

Local Development: Secure Docker Sites.

This article targets Debian docker containers running on MacOS.

HTTP (hypertext transfer protocol) is a set of rules by which your browser retrieves web pages from the internet. HTTP is the same as HTTPS whit the difference being it retrieves pages from the internet in a secure way through a private communication channel.

In our modern age, most sites have this on by default.

When we are developing sites, specifically eCommerce sites, we assume that this would be turned on in the production environment. This post is an attempt to get your development environment even closer to production.

Step 1 – Generate Certificates

For your browser to recognize a site as trusted and secure, it needs to validate the site’s SSL certificate. We will start by creating certs locally. To do this, you need to have OpenSSL installed.

To confirm, type this into your terminal:

openssl version

You should get the currently installed version as a reply. If not in you will first need to install it. See google for further instructions on this.

Next, change to the root directory of your project, where your docker-compose.yml is. There enter: openssl genrsa -des3 -out rootCA.key 2048. You will be prompted for a password, make sure you remember what he is to avoid recreation. This rootCA.key file will be used to create a new root SSL certificate.

To create a new root SSL certificate, valid for 1024 days, type the following command into the terminal. Feel free to change the number of days.

openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem

You will be prompted for the password that you set earlier and then some details about your address. Make sure you fill in the qualified hostname as the domain you’re using for testing.

To confirm that all is in order type: ls | grep root. You should now see two files:

rootCA.key
rootCA.pe

Step 2 – Trust the Certificates Root

The files you’ve just created are certificate generator. Before we can trust the certificates we need to trust the generators. For us to trust the certificates generated by these files, we need to tell MacOS to trust the root files.

To trust the root files, open Keychain Access on your Mac. Press CMD+SPACE and type Keychain Access to open the program that allows you to manage your certificates. Click on the Certificates category in the bottom left sidebar. Now, import the rootCA.pem using `File > Import Items` from the top MacOS menu bar.

After the import, double click the imported certificate and under the “When using this certificate:” dropdown select “Always Trust”.

Step 3 – Generate Server Files

Create a file named server.csr.cnf. Edit this file and add the following content to it, be sure to change your domain name. This will help you avoid entering all the details manually:

[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn

[dn]
C=US
ST=RandomState
L=RandomCity
O=RandomOrganization
OU=RandomOrganizationUnit
emailAddress=hello@example.com
CN = localhost

Next, create a v3.ext file with the following content, in order to create a X509 v3 certificate. Notice how we’re specifying subjectAltName here. Also, make sure to change your domain name accordingly.

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost

Next, create a certificate signing request and sever key file for your domain using the configuration settings stored in server.csr.cnf. The command below will output server.csr and server.key:

openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config <( cat server.csr.cnf )

Next,  create the certificate file called server.crt. The .key and .crt files will both be used by the server. server.key is the private part. sever.crt will be shared with browsers and other clients. Remember the password from step one:

openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256 -extfile v3.ext

openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.pem -days 500 -sha256 -extfile v3.ext

Step 4 – Add to your server

Apache

Apache comes with default SSL certificates. The aim is to find out where they are and replace them with your newly created files. We are not going to update configs as this is more complicated.

SSH into the machine. For me the command to do so is. You can find the image name where your server runs in the docker-compose.yml file

docker-compose exec --user root php bash

Next, there should be a list of sites enabled by default. Let’s look at the contents of the SSL specific config:

cat /etc/apache2/sites-enabled/default-ssl.conf

<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
		ServerAdmin webmaster@localhost
		DocumentRoot /var/www/html
		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined
		SSLEngine on
		SSLCertificateFile	/etc/ssl/certs/ssl-cert-snakeoil.pem
		SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>
	</VirtualHost>
</IfModule>

We are interested in these two files. They may be called differently on your system.

  • SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
  • SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

Now we must figure out how to get our files in these directories. If your docker container is mapped to your local file system you can simply navigate to these and copy them over and then renaming your files to match these names( overwriting theses files)

Lastly, after overwriting these files with your own you can restart apache and then load up your sit at it’s HTTP address.

  /etc/init.d/apache2 restart 

If you’re still not getting this to work, try this post: https://www.linode.com/docs/security/ssl/ssl-apache2-debian-ubuntu/

Nginx

For Nginx let us find out which config file is used:

docker container exec <containern> nginx -t

If you are able to ssh into the container run: nginx -t.

Now let’s view the contents of the config file:

docker container exec woocommerce2test_nginx_1 cat /etc/nginx/nginx.conf
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

We are after the following lines:

ssl_certificate
ssl_certificate_key

In the conf file above you will see that there are no ssl_certificates, but towards the bottom of the output, you will see include /etc/nginx/conf.d/*.conf;. Looking inside this directory we will see: /etc/nginx/conf.d/default.conf;

Now looking at the output of default you will see the location of the default SSL certificates.

ssl_certificate /etc/nginx/certs/localhost.crt;
ssl_certificate_key /etc/nginx/certs/localhost.key;

Now you need to figure out a way to get your certs into that directory. In my case, this was mapped already but you can also manually map it by adding these locations to your docker-compose.yml file.

After adding and renaming your files to match the names above you can reload Nginx with this command:

docker container exec <container> nginx -s reload

In closing

I wrote it mainly for my future self, but I hope you benefit from it as well. Please leave comments if I’ve missed a step or if anything is unclear.

References

Comparing Software Engineering to RailRoads in the 1800’s

An amazing (biased) talk about the rust language by one of the core contributors. Comparing accidents in the rail road industry to computer programming and memory safety.

Getting air-breaks approved in passenger and freight trains took a long time.

I’m starting to consider Rust as my next language to learn. The idea is growing in me as Rust allows you to write software at a much lower systems level. The other languages I know (PHP, Javascript, GO) are more targeted at web and server technologies. I have yet to write code for an embedded system.

Have a listen to the talk. I found it very interesting and I’m sure you will too.

Habits of Highly effective Software Engineers

Valuable advice from the “Tech Lead”. A career in software engineering is a long term game, it’s a marathon, not a sprint. Having habits like these, ensure that you’re preserving yourself as you grow in experience and influence.

  1. Healthy Lifestyle, exercise, water and nutrition. Keep a good posture.
  2. Good Sleep routines.
  3. Continual learning. Keep your skills sharp.
  4. Have result-oriented work ethic. Focus on being effective, get work done.
  5. Keep things simple. For yourself and others. Complexity works against you.
  6. Create periods of deep work in your day.
  7. Collaborate with other programmers to save time and effort

Strategies for not neglecting your blog

When we start a blog, we dream of many readers, followers, and online interactions. Our hope is that writing would open doors for us, you know make us a little more famous than we are currently. In most cases, what follows is the exact opposite. Our blog lies dormant, no articles, nor any comments and no changes since who knows when.

At the beginning of 2018, I started doing a few things very intentionally different, which helped me to do at least one post per month, and some months a little more. These ideas did not only lead to more articles but also, as you’ll discover, improved quality.

1 – Define consistency for yourself

We sometimes place subconscious pressure on ourselves. It affects our ability to think and write. The number one thing you can do for your blog is this: decide for yourself, based on the reality in your life, what the definition of an active blog is.

Defining this for yourself releases creativity and unblocks your thinking. Decide at minimum how many posts you want to put out for the period that you decide on, this has given me a way to maintain accountability. If your reality only allows for one post per quarter, do that! As you grow, so will the frequency. The aim here is not to post all the time, but mainly to get a good rhythm going.

2 – Forget quality

I use to think that the only thing that mattered was quality. Until I heard this story:

A teacher divided his art class into two groups. Each group will work on their year-end project. To the one, he said: “You will be marked based on the quality, bring me one top quality piece. The higher the quality, the better your grade.” and to the other, he said, “You will be marked based on quantity, bring me as many art pieces as you can. The more you bring, the higher your grade”. Both groups went off and came back at the end of the year with their art pieces.

You would think the group who focused on quality performed better, but the results were the opposite. The group who concentrated on quantity had better work than the group solely focused on quality. This deduction from this was simple:practice makes perfect! I believe the same applies to our ability to blog.

From this, I gather that the more you blog, the better your blog posts eventually become.

3 – Gather Ideas and move them to drafts

For a blogger, having nothing to write about is one of the worst situations to find yourself. Having the desire, but no content leaves one feeling paralyzed. To me, blogging is, starting with a basic idea and expanding on it. The wise Solomon said, “there is nothing new under the Sun”. I believe this to be true of ideas as well. There are no new ideas under the sun. There are; new ways to frame them, unique ways to express them and your own life experiences to incorporate into them.

Ideas come and go. Our job is to hold onto the good ones. You can write them down, make a video, graft it into a song. Just don’t leave them solely as thoughts -they will disappear. I’ve had many ideas that slid into forgetfulness. Now I write them in my journal; I email them to myself, I record voice notes. Whatever it takes, I make an effort to hold on to the good ones.

Read more. Reading exposes one to ideas and new ways to express them.

I currently have 20 drafts waiting to be fleshed out or polished. These may not sound like very much, but if I compare them to the time where my blog was a ghost town, I think they are a sign of my strategies working for me.

A strategy that I learned from writing is thinking is to start every blog post with a brain dump. Dump your idea and start creating small sentences as you explore the idea. Do this as a blog post draft so you can save it and have it ready for the next time you work on your drafts. The system of taking Ideas and fleshing them out into mind dumping drafts gives you something meaty to return to when you make time for your blog.

4 – Set out blog time every possible day

How much time should you set aside for blogging? How often? You decide. My method is to set time aside every working morning. I take 10-20 mins and work on my drafts. If you have more time, that’s even better! When you sit down to work on your drafts. Set a timer and stop when it runs out.

This method may mean that a blog post, like this one, takes you a few weeks to write. That doesn’t matter. What matters is that you are thinking as you are writing, which makes you a better thinker and a better writer. The result is a well thought out post every once in a while.

The more time you make per day, the more you can think and write, the more regular your blog posts may be. Remember you are getting better as you do this so 10 mins today and 10 mins 1 year from now is not the same 10 mins. A year from now, you are pouring more experience and knowledge into the 10 mins than what you are capable of today. This system helps you grow your capabilities.

5 – Remove the fear

I currently have about 21 drafts. I don’t work on all of them. I pick one; actually, I force myself to choose the one that’s closest to finish and try to push it forward. Some days, when my motivation is low, I allow myself to pick anyone I like and working on it until the timer runs out. This daily process has helped me with my consistency, which is the secret sauce of an active blog.

Don’t hit publish. I have touched on this before, but the most effective way for me to overcome fear is not to hit publish, but rather to set the date a week from today and then hit the schedule button.

Forget your readers (for now). If you care about who’s reading your posts, it puts even more fear on the table. Remember, we are not referring to a newspaper article that needs to go viral. We are talking about you developing your ability to communicate better by having a more active blog.

Forget the future. Focus on now and what you want to say now. How relevant that is tomorrow is not essential. One day you will write timeless classics, for now, focus on the habit of daily writing.

6 – Keep it short

If you only have a paragraph to share under a given topic, schedule that! If all you have is a sentence write that down. It’s your blog, if you want to come back in a few weeks and, in another post, elaborate on what you said, why not, you own it.

I have tried to use my blog as the primary outlet for social media rants and statuses. It is not as rewarding as my blog does not have many visitors, but I’ve gotten to a point where, growing my ability to communication and gathering skills in this area have become more important than likes, comments, and retweets. So the idea here is to blog first and share that on a post on other services you use. Pump your creativity into one platform, preferably one where the data belongs to you.

In Closing

I’ve experienced more confidence and a greater desire to blog. My blog is no longer something I dread; instead, I’m excited to write and make time for writing. Let this be your reality too.

gap, my most loved git command

gap the alias I created, mapping to git add -p has been one of my most typed commands ever since I changed my workflow.

What this does :

It breaks up your diff into smaller chunks that help you avoid committing things you really don’t want to and helps you know exactly what code is going into the next command. For each chunk, you can choose to stage it or not. All staged changes are those that will be included in your next commit.

To add this command it opens your .bashrc in any editor and add this to it: alias gap="git add -p

It doesn’t matter if you use Git CLI or the app as you get the same things done, but if you really want to get comfortable with it, start using the terminal. It will be painful in the beginning, but you’ll learn more about Git this way.