Skip to content →

diego.org Posts

Node.js on the Raspberry Pi

I needed to install Node.js on the Raspberry Pi and searching the web gave me so many difficult ways to do it. But since node.js now distributed as a binary for the Raspberry Pi, it’s pretty easy.

First, go to http://nodejs.org/dist/latest/ and find the latest Raspberry Pi release. It’s the file ending in: linux-arm-pi.tar.gz

Then on the Raspberry Pi, update the package list

sudo apt-get update

Update packages

sudo apt-get upgrade -y

Create a directory to install node:

sudo mkdir /opt/node

Change directories to a temporary directory.

cd /tmp

Download the latest release you found at http://nodejs.org/dist/latest/

wget http://nodejs.org/dist/latest/node-v0.10.17-linux-arm-pi.tar.gz

Uncompress it:

tar xvzf node-v0.10.17-linux-arm-pi.tar.gz

Copy it to your new directory:

sudo cp -r node-v0.10.17-linux-arm-pi/* /opt/node

Then add it to your environment variables by opening or creating .bash_profile in your home directory. (You nano if you can’t use vi.):

cd
vi .bash_profile

Add the following to your .bash_profile

PATH=$PATH:/opt/node/bin
export PATH

After saving the file, you’re all set!

Comments closed

Raspberry Pi Tip: Change keyboard layout

If you’re in the US like me and you start coding on your Raspberry Pi, you might quickly realize that when typing the pound key # you get the currency symbol: £

This is because the Raspberry Pi defaults to the British Keyboard layout. To change this, as sudo edit the file:

etc/default/keyboard

Change XKBLAYOUT=”gb” to XKBLAYOUT=”us”

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

Then restart your Pi.

Comments closed

Knight Rider with Arduino and AdaFruit NeoPixel

Arduino code to light a AdaFruit NeoPixel with the Kight Rider light sequence. This code was based off the Arduino Knight Rider Tutorial.

Source: https://github.com/dougdiego/KnightRiderNeoPixel

Requirements

  1. An Arduino Board. I’m using an Uno.
  2. AdaFruit NeoPixel
  3. Adafruit NeoPixel library

Instructions

  1. Install Adafruit NeoPixel library
  2. Connect the NeoPixel to ground and power. Power requirements here: AdaFruit NeoPixel
  3. Connect NeoPixel to PIN 6 of the Arduino. Connect NeoPixel ground to the ground of the Arduino.
  4. Upload KnightRiderNeoPixel to the board and run it.

Credit

This code was based off the Arduino Knight Rider Tutorial.

Knight Rider Light sequence on a Arduino with AdaFruit NeoPixel led lights from doug on Vimeo.

Comments closed

MHTabBarController

Source: https://github.com/dougdiego/MHTabBarController

I forked MHTabBarController, which is a custom tab bar controller for iOS 5.  I forked it to accomplish two things.

  1. I wanted to use Quartz to draw my arrow instead of using images.
  2. I wanted my arrows to go down in addition to up.

To change the direction of the arrow, just set the pageIndicatorDirection variable like:


MHTabBarController *tabBarController = [[MHTabBarController alloc] init];
tabBarController.pageIndicatorDirection = PageIndicatorDirectionDown;

You can also easily modify the colors in MHTabBarController.m here:


// TAB Colors
#define SELECTED_TAB_COLOR UIColorFromRGB(0xCF785B)
#define SELECTED_TAB_TITLE_COLOR UIColorFromRGBWithAlpha(0xFFFFFF,0.5f)
#define DESELECTED_TAB_COLOR UIColorFromRGB(0xF5EECD)
#define DESELECTED_TAB_TITLE_COLOR UIColorFromRGB(0xAF553A)

ScreenshotDownScreenshotUp

Comments closed

devonThinkToDayOne – Apple Script

Source: https://github.com/dougdiego/devonThinkToDayOne

An AppleScript to export item(s) from DEVONthink to Day One.

Requirements

Download and install Day One Command Line Interface: http://dayoneapp.com/downloads/dayone-cli.pkg

Instructions

  1. Open DEVONthink and select the entries you want to export. You can select 1 or more than 1.
  2. Run the script. An entry will be made into Day One for each entry you selected in DEVONthink.

Configurations

To make the name of the DEVONthink entry a header in Day One, set the following property to ON:


property dayHeader : "OFF"

By default the create date of the entry in DEVONthink is used as the entry date in Day One. I organize my entries in DEVONthink like: 20110101-journal, 20110102-journal. If you use this format, set the following property to “ON”


property extractDateFromTitle : "OFF"

Note: you can modifiy the script if you use a diffent format for you note name.

Credit

The inspiration for this script came from:

Comments closed

evernoteToDayOne – AppleScript

Source: https://github.com/dougdiego/evernoteToDayOne

An AppleScript to export item(s) from Evernote to Day One.

This code was originally taken from the work done by Justin Lancy at: http://veritrope.com/code/export-evernote-items-to-day-one/

I added the property:


property extractDateFromTitle : "OFF"

I organized all my Evernote entries by the title rather than create date. I gave them a title like “20130718-notes”. When this property is set to “ON” the date is taken from the title instead of the create date.

Follow the link above for details on how to run the script.

Comments closed

iOS 7 App Redesigns

iOS 7 App Redesigns is a tumblr showing an iOS 7 redesign next to an iOS 6 design. Great site to get you think about how to update your own apps.

ios7_app_redesigns_instagram

Comments closed

Android App using only half the screen

When running an Android Application, I found that  it was only using half the screen as in the screenshot here.


I had this problem when the android:minSdkVersion was set to 3 in the AndroidManifest.xml

For example the following caused the issue:


<uses-sdk android:minSdkVersion="3" />

When I set it to something higher than 3, it used the whole screen. For example:


<uses-sdk android:minSdkVersion="8" />
Comments closed

Replacing the gasket on a front loading GE Washer

Recent our front loading GE washer started leaking all over the floor. At first it was not obvious what was causing the leak. Eventually I found that the gasket on the door was torn and water was leaking through it.

After searching online, this appeared to be a common problem with front loading GE washers.

Our model number is: WH08X10036 Given this I search for the right part number. These sites were helpful:

http://searspartsdirect.com
http://appliancepartspros.com
http://repairclinic.com

And I found the part number I needed was: WH08X10036.

I found the part on Amazon: GE WH08X10036 Gasket for Washer

Installing it was not easy. Luckily I found this helpful video: http://www.appliance-repair-it.com/GE-front-loader-washer.html

Comments closed