New 2016 Retina MacBook Pro is Awful

A lot has already been said about the new 2016 MacBook Pro with it’s fancy new emoji bar. I’m in the “it’s fucking awful” camp. I don’t care about the missing SD card slot. What I care about are the missing USB ports.

Future proofing something is one thing. But making something that will only be useful in 2-5 years time is pointless. Having 2 USB type-c and 2 USB type-a would’ve been perfect. Another fucking bullshit thing is the new non emoji bar MacBook Pro only has 2 USB Type-C ports. One if you exclude (and you should) one for charging.

In order to avoid dongle city (and the smaller battery (and money (and the emoji bar))) I’ve ordered a refurb 2015 13 inch retina MacBook Pro. This should last me a couple years until USB Type-C is the norm. Replacing my 2014 11 inch MacBook Air. Which is still a wicked machine.

How to Kill Multiple Processes with One Line in Bash

In bash:

Details on its workings are as follows:

  • The ps gives you the list of all the processes.
  • The grep filters that based on your search string
  • The awk just gives you the second field of each line, which is the PID.
  • The $(x) construct means to execute x then take its output and put it on the command line. The output of that ps pipeline inside that construct above is the list of process IDs so you end up with a command like kill 1234 1122 7654.

Source: http://stackoverflow.com/questions/3510673/find-and-kill-a-process-in-one-line-using-bash-and-regex

Connect to Amazon Elasticache Redis outside of AWS

SSH port forwarding should do the trick. Try running this from you client:

Then from your client:

5 Column Layout With Twitter Bootstrap

By default Bootstrap does not provide grid system that allows us to create five columns layout, but as you can see it’s quite simple.

At first you need to create default column definition in the way that Bootstrap do it. I called my classes col-..-15.

Next you need to define width of new classes in case of different media queries.

Now you are ready to combine your classes with original Bootstrap classes. For example, if you would like to create div element which behave like five columns layout on medium screens and like four columns on smaller ones, you just need to use something like this:

source: http://www.wearesicc.com/quick-tips-5-column-layout-with-twitter-bootstrap/

Changing the AWS Shell Prompt Without Affecting the Hostname

If you do not want to modify the hostname for your instance, but you would like to have a more useful system name (such as webserver) displayed than the private name supplied by AWS (for example, ip-12-34-56-78), you can edit the shell prompt configuration files to display your system nickname instead of the hostname.

Edit the file and change the shell prompt variable (PS1) to display your nickname instead of the hostname. Find the following line that sets the shell prompt in /etc/bashrc (several surrounding lines are shown below for context; look for the line that starts with [ “$PS1”):

And change the \h (the symbol for hostname) in that line to the value of the NICKNAME variable.

Log out and then log back in to pick up the new nickname value.

source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-hostname.html

Retrieving the AWS Public Key for Your Key Pair on Linux

On a Linux instance, the public key content is placed in an entry within ~/.ssh/authorized_keys. This is done at boot time and enables you to securely access your instance without passwords. You can open this file in an editor to view the public key for your key pair. The following is an example entry for the key pair named my-key-pair. It consists of the public key followed by the name of the key pair.

You can use ssh-keygen to get the public key for your key pair. Run the following command on a computer to which you’ve downloaded your private key:

When prompted to enter the file in which the key is, specify the path to your .pem file; for example:

/path_to_key_pair/my-key-pair.pem

The command returns the public key.

If this command fails, ensure that you’ve changed the permissions on your key pair file so that only you can view it by running the following command:

source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#retrieving-the-public-key

How To Update To The Latest zsh on OS X

 

Using MySQL Enums in Symfony Doctrine

Enum isn’t supported in Doctrine. I prefer to keep things as vanilla as possible so instead of registering a new type, we shall map it to a varchar.

You have to ensure that each varchar field that is an “enum” in the database only gets passed the allowed values. You can easily enforce this in your entities:

This is a lot easier to manage and requires no migration if you decide to add more options.

source: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/mysql-enums.html

OnePlus One: Quick Review

After Sony royally messed up an update to my previous phone I decided to (had) to buy a new phone.

I chose the Black 64GB version. Awesome phone and the sandstone back is very cool. I hate slippery phones. And having had this phone for over 6 months I can say I’m very impressed.

I decided to root and flash it immediate and went with BlissPop. Everything works well, camera etc, and it has an immense battery life!

Sony Fucked Up The Xperia Z1 Update

I regret updating my Z1. Kitkat (4.4) was perfect. After updating to Lollipop (5.0), the once perfect battery life is now trashed. It drains in hours without any warning. Going from 90+% to 0% suddenly. Countless attempts to solve this have been in vain. Can’t even easily downgrade it back.

Fucking awful.

I was planning to hold onto this phone for a little while longer and do a proper upgrade. But after a year and a half, my hand was force so I went for the OnePlus One.

Awesome phone (according to the reviews anyway) for such a low price.