This little bastard had to be replaced

The car was leaking coolant. Spent time: 2.5 hours. Money spent: $150 MXN (~7.5USD).

Loading

Quick tip, vagrant with less RAM

Vagrant is a popular solution to isolate your development environment, while there are many images to use with vagrant the most popular is an Ubuntu server image cooked by HashiCorp. Although with the current computer specs having a virtual machine that uses 512MB in RAM is almost nothing (I bet Google Chrome is wasting more than that now) if you are like me you don’t like to have a Virtual Machine wasting resources.

The main reason of why vagrant images uses that amount of RAM is because they don’t have SWAP, so, if your program/script is using more RAM than what is in the VM the program/script is killed.

You can add a SWAP file by using dd

$ dd if=/dev/zero of=/swapfile bs=1024 count=655360
$ chmod 00600 /swapfile
$ swapon -a

Then add it to /etc/fstab. Pretty simple, but you have a big file that may or may not be used in totality.

A better approach is to use swapspace daemon, it will create a swap space that will grow/shrink as needed. You can install the service in your VM if you already have it working or, add this to your Vagrantfile to have it done automagically.

config.vm.provision "shell", inline: "sudo apt install swapspace -y"

If you do this with a VM already working just shut it down, use vagrant up --provision to run the provision instruction and you are done!.

Having a Swap space allows you to reduce the amount of RAM dedicated to your VM.

Loading

Replacing the auto focus flex of a Canon 18-55 IS lens

A couple of days ago I got the flex for the focus mechanism in my 18-55 camera lens, but in my lack of experience I didn’t do a god job, the focus moved, and the camera tried to focus (it really tries) but the image remained blurry. So I had to put the flex in place again, the first attempt was not perfect. In order to do this. Here some pictures.

Loading

Quick tip when using vagrant+django

I started to use vagrant to hold my development environment, it helps to keep the development environment isolated, since the app will run on a Linux server, with a specific database engine and probably some other specific modules, I don’t want to clutter my OS with all that stuff. More if I plan to work on another project that maybe, have a dependency on other versions of the same base (legacy Django perhaps?)

Continue reading

Loading

Fixing the camera lens

I have a problem with my camera, there’s a small cable that is flexible and helps to get the autofocus working, the problem is that with the time and usage the flex got broken, and then autofocus stop working.

I ask a friend that is very skilled soldering stuff, he usually repair broken motherboards, I asked if he could join the flex, he told me that he can, he would charge $300MXN (about $16.5 USD) to do the job. I found in mercadolibre (similar to eBay) the same flex I needed for $150 (about $8.3USD). So, I bought one and my goal was trying to fix the lens by myself.

The good part, I have everything needed, a really small Phillips screwdriver, the one used for the iPhone screws is just fine, a small Phillips is required too, and tons of patience.

The good part, I learned how to disassemble this lens, is quite simple once you understand it. I removed the damaged flex and put the new one in place.

The bad part, the flex was not exactly in place, so, focus is not working, I mean, it moves, but getting something in focus takes a lot of time.

The challenging part… fix it without asking for a new flex (although they are pretty cheap).

Some pictures for the memories.

Loading

Now I have a reason to watch Jessica Jones, Ironfist and Luke Cage.

https://www.youtube.com/watch?v=jEmPh6DsfnQ

I have seen Daredevil already and I have to tell that I like a lot both seasons, but  didn’t really feel that need to watch JJ, IF and LC. But, to appreciate this new series I have to watch them all.

Fortunately I have done with House of Cards last week and I’m in the middle of Archer season 8.

Continue reading

Loading