Hello, my name is Daniel, and I make things! Join me in this exciting journey exploring the world of computers and electronics


Opening a popup ninja from php

Checking the documentation from popup ninja plugin on how to open the popup from a link, the only available option is how to open from a blog post. But if you want to add the link in your website using php, you need to use the wordpress function do_shortcode. The documentation doesn’t show how to add a do_shortcode with content between the tags.

To open the popup with php, simply get the popup ID and use the code bellow. Just remember to change the text for your desired one.

< ?php echo do_shortcode( '[ninja-popup ID=1234]'.'text to open popup'.'[/ninja-popup]' ); ?>

Checking if php-curl is installed

If you wanna check if php-curl extension is installed in your system, type on terminal

sudo php -m | grep "curl"

If the response from the code above is empty, the extension is not being loaded with php. Then you can install it with:

CentOS

yum install php-curl

Ubuntu

sudo apt-get install php5-curl

Metronome v2.0

metronome

During my first semester of Electrical Engineering back in 2007, I had an introduction to electronics class where by the end of the semester we had to develop an open project. At first I tried to build a AM radio using only passive components, I remember that after hours placing components on the breadboard I managed to make it work, but it was really inconsistent and super noisy. The project was working, but it wasn’t as good as I wanted, so I decided to build something else, something that could be actually useful, that when the metronome idea came alive. Using a few components and a 555 IC I could make the circuit “tick” in a frequency that can be used your music studies.


One Dollar Board – Cheapest development board on the market

What if you could manufacture a very simple development board that is arduino compatible and have a final price of only ONE DOLLAR!? That’s what some crazy guys from my home country (Brazil) are trying to accomplish.

one dollar board

The main idea of the project is to enable every kid around the globe to leave school knowing how to program, the basic of electronics, and how to apply their knowledge by building cool things. Think like this, with only $25 you can buy 25 boards, which will enable pretty much an entire classroom to own these boards and create amazing things with it. It’s crazy to think the impact that the project can make in poorer areas of the world, enabling those engineering minds to flourish and change the world for better (why not?!).

Check their indiegogo video below and remember that for every dollar invested is one entire new board built!

Click here to check their campaign!

(of course the project is part of the open hardware movement)


The Amp Hour

Hey guys, this is a quick post where I want to share a great podcast that I listen all the time called “The Amp Hour“.

Quoted from their about page: “Dave Jones from the EEVblog in Sydney (Australia), and Chris Gammell from Contextual Electronics in Cleveland (USA) discuss the world of electronics design in an hour long(ish) weekly show, recorded “live” without editing or a mute button!

If you are into electronics (which obviously I am), it’s a much listen show!
Check it out on the link below 🙂

The Amp Hour


Build a 3.5mm Audio Switch

audio mux p2

I moved to Berlin a few months ago to start working as Lead Electronics Engineer at UNU Motors. As soon as I found my own place (after spending three months apartment hunting), I decided to buy a good audio monitor, so I could listen to music and watch videos with a decent audio quality. My choice was a BX5 M-Audio audio monitor, great speaker at a very good price. The only annoying thing is that every time I wanted to listen music from my computer, I had to take the P2 plug from the RaspberryPi (running OSMC) and connect to my mac, and vice versa… To fix this problem, I decided to make a small PCB where I can plug everything together and then flip a switch to toggle inputs.


Backup and Restore Raspberry PI SD Card

If you are like me who is always trying different linux builds for Raspberry Pi or keeps messing up with Kodis configurations, this post is for your. I will teach you to make an perfect image of your SD Card so that you can simply go back to the last image, without having to install everything again from scratch.

If you don’t know how to install any linux distribution for RPi, I suggest you to follow this guide HERE

Backup

  • First thing after you insert the SD Card in your computer is to check what is the device’s location. Open a terminal, then run:
    diskutil list

    diskutil to check out raspberry pi sd card

    In my case, the SD card is in /dev/disk3. Remember that you are looking for the disk (not partition) of your SD card, so it would be disk4, not disk3s1.

  • Unmount your SD card by using the disk identifier:

    diskutil unmountDisk /dev/disk(disk# from diskutil)

    for example, in my case:

    diskutil unmountDisk /dev/disk3
  • Clone your SD Card to a file on your computer by using the following command:
    sudo dd if=/dev/disk(disk#) of=my_rpi_backup_image.img bs=4m

    you can change my_rpi_backup_image.img to any other desired name you want. Also the above process can take a few minutes to complete.

  • Now you can store your backup file anywhere you want for further restore.

Restore

  • Follow the first two steps described above and make sure you have the disk unmounted.
  • We can restore our backed up file to the SD Card, go to the folder where the image file is located and run on the terminal:
    sudo dd if=my_rpi_backup_image.img of=/dev/disk(disk#) bs=4m

    Same as before, this process can take a few minutes to complete, so you can go have some coffee while your computer finishes the job.

    Once it’s done, simply remove the SD Card from your computer, insert it to your RPi and turn it on, it will boot with the system the exact same way as it was before you saved it.


Round Corner PCB with EagleCad

Quick video showing how to create a PCB on Eagle Cad with round corners.
This is the way I do it, there are probably many different ways to do the same, if you know a better one, please share!


Altium Designer Tip & Tricks

altium logo

While Altium Designer is a relatively easy program to start working with, there are so many tricks, shortcuts and extra options to be discovered (which keeps me excited to always learn more!). I decided to create some kind of cheat-sheet for personal reference and I believe that it can also be helpful for other users out there.


Virtualmin: Backups to Google Cloud Storage

Virtualmin plus Google Cloud Platform

For a while I have been running a few websites using Virtualmin under CentOS. It’s a great free Web Hosting Control Panel application that helps you to manage your server without having to do it manually. It contains Apache, MySQL, proFTPD and much much more.

As I am a backup freak I have been backing up my server to Amazon S3 for a while. Amazon backups costs around $0.03 per GB, not that bad, but a few months ago I switched to Google Cloud Storage which has a technology called Nearline costing only $0.01 per GB (yes, 1/3 of the price!). The only disadvantage comparing to S3 is that the files retrieval takes a few seconds instead of milliseconds, as I am not serving this file on websites, and I really don’t mind waiting a couple secs to have the download link ready.