Sunday, August 31, 2014

Monday, August 25, 2014

raspberry pi lcd links

Links with notes useful for an ongoing project:

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/test-and-configure
http://www.neighborgeek.net/2013/02/using-16x2-lcd-with-i2c-on-raspberry-pi.html
http://www.rpiblog.com/2012/07/interfacing-16x2-lcd-with-raspberry-pi.html
https://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage
http://www.extremeelectronics.co.uk/blog/i2c-control-of-lcd-display-using-ywrobot-lcm1602-v2-raspberry-pi/
http://nwazet.com/code/loading-i2c-spi-and-1-wire-drivers-on-the-raspberry-pi-under-raspbian-wheezy

Saturday, August 23, 2014

Creating mysql development database

Quick & dirty way to create a localhost db for testing. Database is called db_dev and user is called db_dev_user

mysql -u root -p

mysql>CREATE SCHEMA db_dev;
Query OK, 1 row affected (0.01 sec)

mysql>CREATE USER 'db_dev_user'@'localhost' IDENTIFIED BY 'Passw0rd';
Query OK, 0 rows affected (0.01 sec)

mysql>GRANT ALL PRIVILEGES ON db_dev.* to 'db_dev_user'@'localhost';
Query OK, 0 rows affected (0.01 sec)

mysql>FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql>QUIT;
Bye

Saturday, August 16, 2014

Automatically mount windows share on ubuntu linux

Create a file that will hold the user and password for the share. Make this file readable only by you.
nano ~/.raspcredentials

(type the following)
username=share_username
password=share_password

chmod 600 ~/.raspcredentials

Create the mount point for the share. I'll call it ~/docs but can be what you want
mkdir ~/docs

edit fstab as root. Here we will mount the /home of the share to the ~/docs folder.
Add this line to fstab

//ip_address_or_hostname/home /home/your_username/docs cifs credentials=/home/your_username/.raspcredentials,iocharset=utf8,sec=ntlm,uid=your_username,user,users 0 0

eg:
//192.168.1.3/home /home/tiago/docs cifs credentials=/home/tiago/.raspcredentials,iocharset=utf8,sec=ntlm,uid=tiago,user,users 0 0

At this moment you cannot yet mount it because samba/cifs is not yet installed. This is easy to fix:
sudo apt-get install cifs-utils
As non root, to be able to mount use mount <mount_point>. In this case this is
mount ~/docs

Done.