Thursday, January 11, 2018

LIBREELEC RPI2/3 Physical Power Off Button

There are many tutorials about installing a Power Off button in the Raspberry Pi 2/3 with Raspbian but there aren’t many about installing one if you use LIBREELEC so I decided to make this small tutorial.

First you need to know we will be using gpiozero, to install it you need to go to Add-ons / [Box on top] / Install from repository / LibreELEC Add-ons / Program add-ons / Raspberry Pi Tools and activate the Raspberry Pi Tools application.

We will make a very basic gpiozero script, I will include a link in the bottom to a website that has more advanced scripts.

This is the gpiozero script you need, just paste the text into a text editor:

import sys

#!/usr/bin/env python3
from gpiozero import Button
import os
os.system("shutdown now")

Save the previous script as and save it into the /storage folder of LibreELEC.

If you have trouble finding the folder you can use any FTP client (like FileZilla) to find it, it's inside the root folder (/) on the top of the hierarchy.

Then you need to run the script at boot, you can do it any way you want, I'll show you one way of doing it with this script (just paste this into a text editor):

 python storage/;
) &

Now save it as into the /storage/.config folder of LIBREELEC (\\LIBREELEC\Configfiles for samba users)

Reboot LibreELEC with the "reboot now" command.

Test if the script is running, you can test it with this command:

ps -eaf | grep | grep -v grep

If you can see the “” script on the list, it means that it is running.
Similar to this: (648 root       0:14 python storage/

Disclaimer: It is unsafe to short pins in the Raspberry Pi, you must configure them first in order to be able to short them safely. This method shorts two pins on the Raspberry Pi but there is another method that uses a pull-down resistor, that method is supposed to be the ideal and safest way of doing it. Here is a link if you want to check it out.

Pull-down resistor:

I use the shorting method because it's simple and gpiozero supports it, if you do it like this you may want to use a resistor (like a 1K) for extra security in case the switch is pushed while the script isn't loaded (like during boot or if you reinstall LIBREELEC or Raspbian and forget to run the script).

It should be safe to short the pins now. You need a momentary switch of course; you need to connect it to the pins 39 and 40 (or GPIO 21 and GND).

Here you have an image of the pinout:

Press the switch once and that should do it, your Raspberry Pi should shutdown with the press of a button. You may want to program a push delay in the script to avoid accidental pushes, there are other things you can program with gpiozero, if you are interested check the link below.

Switch tutorial (for Raspbian) and more commands:

Sunday, October 2, 2016

Install the audio driver for Intel DG965WH motherboard in Windows 10

Why would you want to install the driver? There are two main reasons, first to get front header audio support and secondly for the "Stereo Mix" feature in order to capture internal audio with some installed software that captures audio. (Those are the features that the default Microsoft driver doesn't support, I haven't tried but if you can't use Dolby DTS sound, this may fix it).

Do this under your own risk, these are old drivers from 2009 not made for windows 10, you may want to make a system backup or restore point before trying this, in case something goes wrong. I'm not responsible for any damage to your computer or software.

I'm posting this because I installed the drivers and they seem to work just fine on my DG965WH motherboard under Windows 10 64bit, the next method may also work for other Intel 965 motherboards (with the right drivers for the boards of course).

1- Get the drivers: The drivers from Intel may no longer be available so you may have to find them somewhere else. Here you can find them

Get the driver named "High Definition Audio Device", the one from 2009, the version is 6.10.20001.0 (I compared the file and this is the exact same file you would get from Intel). Do not double click the file, it will not get installed anyways because the driver interface is not compatible with windows 10 (beware do NOT install in compatibility mode, I warned you).

2- Extract the driver: You need Winrar to extract the file (go ahead and install Winrar if you don't have it), right click the audio driver file and in Winrar options click on "Extract to AUD_allOS_D20001.0x_PV_IDTGUI_v105_Legacy\". Take note of the created folder location.

3- Once the files are extracted go to "This computer", on the left pane right click "This PC" and select "Manage", go to "Device Manager" and on the right pane find the sound section and expand it, there you'll find 2 entries, right click the top one and click on "Properties", in the "General" tab make sure the "Location" is 0, if the "Location" is 2 or other number just check the other entry on the sound section, it should be 0.

4- Go to the "Driver" tab and click on "Update Driver", click on "Browse my computer for driver software" and browse for the folder you just created with Winrar, click on "Next" to install the driver.

The driver should be installed now, to check if it works right click the sound icon in the taskbar and click on "Playback devices", you should have at least these features (Speakers / HP, Headphones (RTC), SPDIF-Out (Rear)) if you dont see any of those, right click on the list and make sure the checkboxes are activated for "Show disabled devices" and "Show disconnected devices".

On the "Recording" tab you should see "Front microphone", "Rear microphone", "Input line" and "Stereo mix".

Note: The text between "quotes" may be different in your computer.

Restart your computer, then you should see the icon in the taskbar, go to options and disable the taskbar icon to reduce the risk of anybody changing the settings. I strongly advise you not to change any other setting there to avoid problems (the equalizer and other options won't work anyways).

Edit: Windows 10 no longer lets you replace drivers this way but what you can do is uninstall both audio entries in the "Sound, video and game controllers", then go to "AUD_allOS_D20001.0x_PV_IDTGUI_v105_Legacy\WDM\Vista" and double click "suhlp64.exe", Windows smartscreen will give you a warning, ignore it and install the driver.

Saturday, September 10, 2016

Configure your Raspberry Pi 3 (bug fixes)

So this is not only a simple guide, unfortunately the Raspberry Pi 3 Operative System (Raspbian Jessie 4.4) has a ton of bugs and you may not be able to use some of the most basic features out of the box, here are the fixes for the most annoying bugs I've found. Many of these bug fixes (or workarounds) can be hard to find so I decided to make a compilation here.

This assumes you already logged into your Raspberry Pi after installing Raspbian.

1) First you need to update the system, for that do (you can do one command at a time):
 sudo apt-get update  
 sudo apt-get upgrade  

2) If your screen has a black border all around do:
 sudo nano /boot/config.txt  

Then on the file uncomment (remove the #) from the line that says:

If you want to use RCA video output (for composite video) and it doesn't work, find and edit the next line to look like this:

In this case (RCA output), if you are using a CRT TV you may want to comment out the "disable_overscan=1" line so the display fits into the screen.

Press CTRL+O, then ENTER to save the changes, then press CTRL+X to exit the text editor (nano).

Reboot the system, it should be fullscreen now (and RCA video should work).

3) Then to configure the system settings do:
 sudo raspi-config  

  • It is recommended but not required to change the user password.

  • Change the Internationalization options: / Change Timezone / Yourzone / Yourcountry

  • If you have an iternational keyboard, you can Change keyboard layout: for example for a spanish keboard you can do:

  • Generic 105-key (intl) pc / spanish include dead tilde / key to function as altgr / right alt (altgr) / compose key / no compose key

    Tip: To configure the keyboard it may be easier if you simply go to the raspbian configuration utility on the top left menu. Be careful with what you do there because sometimes you'll find a bug that deletes the icon and you won't be able to configure through that utility again (I don't know the fix for that bug).

  • WIFI Country, find your country and select it.

  • In advanced options you may want to enable SSH (only if you want to use SSH, if not, skip this step).

4) If your WIFi doesn't work (you get an "invalid argument" message) do:
 sudo nano /etc/network/interfaces  

Edit the "wlan" section to look like this:
 auto wlan0  
 allow-hotplug wlan0  
 iface wlan0 inet dhcp  
   wpa-ssid "yourssid"  
   wpa-psk "yourwifipassword"  
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf  

Remember to enter your SSID (router WIFI name) and your PSK (WIFI password).

Press CTRL+O, then ENTER to save the changes, then press CTRL+X to exit the text editor.

Then you can reboot the system to confirm if WIFI works.

5) If SSH doesn't work open this file:
 sudo nano /etc/ssh/sshd_config  

And add this code to the end of the file:
 IPQoS cs0 cs0  

Press CTRL+O, then ENTER to save the changes, then press CTRL+X to exit the text editor.

Then do this (so you don't have to reboot):
 sudo service ssh restart  

You can check right away, SSH should work now.

6) NTP server not updating date/time:

This is a bit more complicated, you need to go to and on the menu on the right of the website find your zone and country, then copy the URLs and paste them in the next file.

Open the file:
 sudo nano /etc/ntp.conf  

You can comment out the other URLS or put this on top of them, for example, for the United States:

Press CTRL+O, then ENTER to save the changes, then press CTRL+X to exit the text editor.

This may not work for several reasons, one may be that the current date/time are too outdated, so you can set date/time manually like this:
 sudo date -s "10 JAN 2016 20:37:00"  

Of course, you need to set the right date/time for you. I must say that there may be some other bug on the NTP server that I haven't figured out, so time may keep getting out of syc (you can always adjust it manually). There are some hardware clocks that come with a battery, in case you want to check that out.

7) If you can't ping do:
 sudo chmod u+s `which ping`  

You should be able to ping right away.

So these are basically all the bugs I've fixed after many hours of research, It's a real shame that the Raspberry Pi 3 has all these issues, hopefully they will be sorted out in a future release.

Sunday, May 22, 2016

How to connect to a Minecraft multiplayer server

How to connect to a Minecraft multiplayer server:

1) Open your Minecraft game.

2) Click on the "Multiplayer button"

3) Click on "Add Server" 

4) On "server Address" enter the IP Address of the server (you may need to enter the port too), it can look like an IP Address (numbers) or like an URL (name of the server).

 5) Click on "Done", now the server list will contain the server you just added.

6) Double click the server you want to connec to (or select it and click "Join Server").


Play Minecraft:

Monday, November 17, 2014

Configure MySql Server Workbench root password from XAMPP.

This is for people who have installed XAMPP and MySql Server Workbench together for development, the problem you may get is that when you want to set a password for your MySql database connection the Workbench won't ask you to enter one, even if you have cleared the password "Vault", MySql Server's Workbench will just simply log you in without asking you to set a password.

The solution to this problem is to set the password from XAMPP's Security settings, instead of having to use a bunch commands or configuring files XAMPP gives you the option to set the password from it's web interface, let's get to it.

1) Start XAMPP's Apache server.
2) Click the "Admin" button from XAMPP's Control Panel, or go to http://localhost:80

3) On the left navigation menu click on "Security".

4) A new tab opens, look for a link that says "http://localhost/security/xamppsecurity.php" and click  it.

5) Finally in the section named "MYSQL SECTION: "ROOT" PASSWORD" set the root password. You can leave the other default options.

The first time you enter this section there will be no "Current password" input field.

Now you can start the MySql server from XAMPP's Control Panel, then start the Workbench and click on your connection or create a new one, MySql will ask you for the root password.

To change the password in the future you can simply return to the Apache security options in XAMPP.

Update: XAMPP no longer uses the standard MySql engine, they have switched over to MariaDB.

Because of this MySql Workbench no longer supports XAMP's new default database engine, you may try to use MySql Workbench with MariaDB but some features may be broken, you will also get a repeating message telling you the Workbench is not compatible with that version of MySql.

One possible solution is to use the PHP MyAdmin that comes with XAMPP (instead of the Workbench) but in my experience it can be really slow...

You can also use a GUI/Workbench for MariaDB instead of MySql's Workbench.

Other solution is to downgrade XAMPP to the latest XAMPP that supports the standard MySql engine, that is, XAMPP version 1.8.3.

One last solution would be to install the standard MySql version and use it instead of XAMPPs MariaDB.

Wednesday, November 12, 2014

Edit the junk (spam) folder list in

1. Go to the Junk folder.

2. Check down in the page where it says "Looking for an email? If you don't find it here, check your blocked senders list." and click the provided link.

3. Add and/or remove your blocked senders.

Notice that if you block a sender as spam/junk they can tell you did it (you can thank Microsoft for that), this can stain your reputation, for example in the case you block someone's emails by mistake after subscribing to them, so when they find out they may ban you from their website.

To disable this wonderful feature go to the gear icon on the top right of the page, click "Options", then in "Preventing junk emails" click on "Filters and reporting", from there look for the section "Report unwanted email to the sender" and make sure the option "Don't tell senders when you don't want their emails." is checked.

Sunday, April 20, 2014

Sony VAIO 100% hard drive activity.

For anyone updating your VAIO to Windows 8.1 Update 1, with a computer that experiments 100% Hard Drive activity at OS boot for 10 to 30 minutes or randomly, you may try this:

Press WIN+R

Type "services.msc" and press ENTER

Find "Sony Digital Media Server", right click it and select "Properties"

Find "Startup Type:", select "Manual".

Restart your computer, if the problem is solved you could also go to "Control Panel", "Programs and Features" and find the VAIO media server and uninstall it.

If the problem continues you can set it to "Automatic" again, if you want to. You must keep troubleshooting, Some things that could be affecting the computer are:





Antivirus Scan

Windows Defender (or Windows Security Center)

Windows update


Raid driver

Some networking issue like a bad/old driver

Corrupted files

Windows 8.1 Update 1 seems to use more resources from your computer but hopefully your computer won't be at 100% all time.


After some testing even though the problem has been reduced, the hard drive still shows too much activity, I found out some files were corrupted (this seems to be a common issue with W8.1 U1), the way to test is by running the command
"sfc /scannnow", if the result shows corrupted files with this message "Windows Resource Protection found corrupt files but was unable to fix some of them." then run this command
"Dism /Online /Cleanup-Image /RestoreHealth". You can run "sfc /scannnow" one more time to check the problem has been fixed.

If you indeed have corrupted files, there may be more that sfc is not detecting, one alternative is to test the partition with other software outside of windows like with an Ububtu Live CD and ntfs-3g.

Update: After installing W10 I  figured out that most of that activity is normal for this hard drive, the ideal solution would be getting an SSD.