Skip to content

Instantly share code, notes, and snippets.

@glennschler
Last active March 25, 2022 02:39
Show Gist options
  • Select an option

  • Save glennschler/7345428 to your computer and use it in GitHub Desktop.

Select an option

Save glennschler/7345428 to your computer and use it in GitHub Desktop.

Revisions

  1. glennschler revised this gist Mar 3, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Notes.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,7 @@ sudo apt-get update
    sudo apt-get upgrade
    ```
    * Optional

    ```
    sudo apt-get install vim
    sudo apt-get install htop
  2. glennschler revised this gist Dec 6, 2013. 1 changed file with 129 additions and 0 deletions.
    129 changes: 129 additions & 0 deletions raspicam-fix-exif.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,129 @@
    // Run this script in node.js
    //
    // First install deps:
    // sudo apt-get install libexiv2-12 libexiv2-dev
    // npm install exiv2
    //
    // Argument #1 = .JPG relative path
    // Argument #2 = overwrite file true/false. False will create a new file with ".jpg.jpg" extension
    // "raspicam-fix-exif.js"

    ar ex = require('exiv2');
    var fs = require('fs');

    // overwrite or not? true/false
    var _OVERWRITE=process.argv[3];

    // the file name to read exif
    //example '/tmp/RPIPICI13120400001.jpg';
    var fName = process.argv[2];

    // make a backup which should be overwriten
    // with the fixed tags
    //
    function copyFile(origFName, newFName, cb) {
    var fCalledBack = false;

    var readIn = fs.createReadStream(origFName);
    readIn.on("error", function(err) {
    callback(err);
    });

    var writeOut = fs.createWriteStream(newFName);
    writeOut.on("error", function(err) {
    callback(err);
    });

    writeOut.on("close", function(ex) {
    callback();
    });
    readIn.pipe(wr);

    function callback(err) {
    if (!fCalledBack) {
    // call the callback function which was passed in.
    cb(origFName, err);

    // to be safe, in case err/close trigger arrives more than once
    fCalledBack = true;
    }
    }
    };

    // Get the exif info
    //
    function getImageTags(fName, cb) {
    console.log ("reading exif... " + fName);

    ex.getImageTags(fName, function(err, tags) {
    if (err) throw err;

    var dateTime = tags["Exif.Image.DateTime"];
    var dateTimeOriginal = tags["Exif.Photo.DateTimeOriginal"];
    var dateTimeDigitized = tags["Exif.Photo.DateTimeDigitized"];

    // print the old values
    console.log("\tFilename: " + fName + " :: \n" +
    "\tDateTime: " + dateTime + "\n" +
    "\tDateTimeOriginal: " + dateTimeOriginal + "\n" +
    "\tDateTimeDigitized: " + dateTimeDigitized + "\n");

    // fix the old values. Replace the ":" in between date and time with a " ".
    dateTime = dateTime.substr(0, 10) + " " + dateTime.substr(11, 20);
    dateTimeOriginal = dateTimeOriginal.substr(0, 10) + " " + dateTimeOriginal.substr(11, 20);
    dateTimeDigitized = dateTimeDigitized.substr(0, 10) + " " + dateTimeDigitized.substr(11, 20);

    // put then in a new tag array
    var newTags = {
    "Exif.Image.DateTime" : dateTime,
    "Exif.Photo.DateTimeOriginal" : dateTimeOriginal,
    "Exif.Photo.DateTimeDigitized" : dateTimeDigitized
    };

    // callback the caller
    cb (fName + (_OVERWRITE ? "" : ".jpg"), newTags);
    });
    };

    // Write out the new exif tags to the new jpg file
    //
    function setImageTags (newFName, newTags) {

    // now save the exif info
    ex.setImageTags(newFName, newTags, function(err) {
    console.log ("Exif set = " + (err ? ("Error: " + err) : "Success"));
    }); // set image
    };

    // Called either directly or after the copy file (when not overwriting) is complete
    function retag(fName, err) {
    if (err) throw err;

    console.log ("getting....");
    // lets get the original tags
    getImageTags (fName, function (newFName, newTags) {
    console.log("Will soon set tags to " + newFName);
    setImageTags (newFName, newTags);
    });
    };

    console.log ("working....Overwrite=" + _OVERWRITE + " Fname=" + fName);

    // This is the primary control. Either overwrite or not.
    if (_OVERWRITE) {
    console.log ("overwriting\n");

    // get the tags. Overwrite the original file with the fixed date flags.
    retag(fName);
    }
    else {

    // Do not overwrite the file. Instead name it "*.jgp.jpg"
    console.log ("not overwrite\n");

    // Start by copying the file where the new exif info will go
    // Pass the "retag" function as the callback, so once the copy
    // is complete, the flow will continue as normal
    //
    copyFile (fName, fName + ".jpg", retag);
    }
  3. glennschler revised this gist Dec 3, 2013. 2 changed files with 3 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion Notes.md
    Original file line number Diff line number Diff line change
    @@ -73,4 +73,4 @@ sudo apt-get install avahi-daemon avahi-utils
    ssh pi@hostname_pi.local
    ```
    * [Optional] Follow the [Adafruit instructions](http://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc) to setup and control with desktop UI using VNC.
    * [Optional] Follow the [Adafruit instructions](http://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc) to setup and control with desktop UI using VNC.
    3 changes: 2 additions & 1 deletion wpa_supplicant.conf
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,9 @@ ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1

    network={
    # Use the PSK string which was output by executing the wpa_passphrase utility!
    ssid="__SSID__"
    psk="__PSK__"
    psk= __PSK__

    # Protocol type can be: RSN (for WP2) and WPA (for WPA1)
    proto=WPA RSN
  4. glennschler revised this gist Dec 3, 2013. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Notes.md
    Original file line number Diff line number Diff line change
    @@ -59,9 +59,10 @@ sudo apt-get upgrade
    * Create the ```etc/network/interfaces``` file (shown below).
    * Create the ```/etc/wpa_supplicant/wpa_supplicant.conf``` file (shown below).
    * Avahi implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ```ping hostname_pi.local``` from OS X or other Zeroconf configured machine
    * Avahi-daemon implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ```ping hostname_pi.local``` from OS X or other Zeroconf configured machine. Secondly, avaih-utils will make it easy to find other RPis on the local network.
    ```
    sudo apt-get install avahi-daemon
    sudo apt-get install avahi-daemon avahi-utils
    ```
    * Connect using SSH over wifi.
  5. glennschler revised this gist Nov 21, 2013. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions Notes.md
    Original file line number Diff line number Diff line change
    @@ -41,6 +41,11 @@
    sudo apt-get update
    sudo apt-get upgrade
    ```
    * Optional
    ```
    sudo apt-get install vim
    sudo apt-get install htop
    ```
    * I have a few old USB Belkin F5D8053.v4 WiFi which work even if not on [the list](http://elinux.org/RPi_USB_Wi-Fi_Adapters)
    * If Wifi, do WiFi management using WpaSupplicant.
  6. glennschler revised this gist Nov 18, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    * One option is to download the latest nodeJs.org source tarball, and make the node binary. This is a different exercise which this gist file does not address.

    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name.
    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory to see if it is there.

    ```
    mkdir -p ~/tmp
  7. glennschler revised this gist Nov 18, 2013. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    * One option is to download the latest nodeJs.org source tarball, and make the node binary. This is a different exercise which this gist file does not address.

    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. First get the node version dir, and then find the only "arm-pi" HREF for the wget command.
    * To automate, copy and paste this entire code block into a RPi terminal session.
    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name.

    ```
    mkdir -p ~/tmp
    @@ -18,16 +17,18 @@ cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tm
    # Since not every release has an arm-pi binary, check before attempting to download
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && printf "\nVersion $nver arm-pi release is NOT available for download\n\n"
    ```

    * If there is a arm-pi distrubution, download and unzip

    ```
    # If so, Download and unzip
    [ `stat -c %s tmp1.txt` -ne 0 ] \
    && ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && tar -zxvf node-v*arm-pi*.tar.gz )
    echo #nop
    ```

    * Move the node binaries and docs
    * Move the node binaries and docs to be available in the path.

    ```
    # Remove any old node version. Create the dir again
  8. glennschler revised this gist Nov 18, 2013. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -17,8 +17,7 @@ cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tm
    # Since not every release has an arm-pi binary, check before attempting to download
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && ( printf "\nVersion $nver arm-pi release is NOT available for download\n\n" ) \
    || ( printf "\nVersion $nver arm-pi release is available for download "`cat tmp1.txt`"\n\n" )
    && printf "\nVersion $nver arm-pi release is NOT available for download\n\n"
    # If so, Download and unzip
    [ `stat -c %s tmp1.txt` -ne 0 ] \
  9. glennschler revised this gist Nov 18, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ cd ~/tmp
    #nver=v0.10.21
    nver=latest
    # Download and unzip the requested Node.js for ARM-Pi which was built and distributed by NodeJs.org
    # Download the index.html of the requested version of the node.js directory
    wget -N http://nodejs.org/dist/$nver/
    cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tmp1.txt
    @@ -20,7 +20,7 @@ cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tm
    && ( printf "\nVersion $nver arm-pi release is NOT available for download\n\n" ) \
    || ( printf "\nVersion $nver arm-pi release is available for download "`cat tmp1.txt`"\n\n" )
    # If so, get it
    # If so, Download and unzip
    [ `stat -c %s tmp1.txt` -ne 0 ] \
    && ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && tar -zxvf node-v*arm-pi*.tar.gz )
  10. glennschler revised this gist Nov 18, 2013. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -17,16 +17,17 @@ cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tm
    # Since not every release has an arm-pi binary, check before attempting to download
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && ( printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ) \
    || ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && ( printf "\nVersion $nver arm-pi release is NOT available for download\n\n" ) \
    || ( printf "\nVersion $nver arm-pi release is available for download "`cat tmp1.txt`"\n\n" )
    # If so, get it
    [ `stat -c %s tmp1.txt` -ne 0 ] \
    && ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && tar -zxvf node-v*arm-pi*.tar.gz )
    echo #nop
    ```

    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && ( printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ) \
    || ( echo "hello" )

    * Move the node binaries and docs

    ```
  11. glennschler revised this gist Nov 18, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,6 @@ cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tm
    # Since not every release has an arm-pi binary, check before attempting to download
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && ( printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ) \
    # ElseIf there is an arm-pi binary then download it.
    || ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && tar -zxvf node-v*arm-pi*.tar.gz )
    echo #nop
  12. glennschler revised this gist Nov 18, 2013. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -17,15 +17,17 @@ cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tm
    # Since not every release has an arm-pi binary, check before attempting to download
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && printf "\nLatest release does not have an arm-pi binary distribution to download\n\n"
    && ( printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ) \
    # ElseIf there is an arm-pi binary then download it.
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    || ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && tar -zxvf node-v*arm-pi*.tar.gz )
    echo #nop
    ```

    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && ( printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ) \
    || ( echo "hello" )

    * Move the node binaries and docs

    ```
  13. glennschler revised this gist Nov 18, 2013. 1 changed file with 8 additions and 5 deletions.
    13 changes: 8 additions & 5 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -8,18 +8,21 @@ mkdir -p ~/tmp
    cd ~/tmp
    # Change to the version needed. The 'latest' version or a specific version.
    #lastest_node=v0.10.21
    #nver=v0.10.21
    nver=latest
    # Download and unzip the requested Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/$nver/
    cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tmp1.txt
    # Since not every release has an arm-pi binary, check before attempting to download
    if [[ `stat -c %s tmp1.txt` -eq 0 ]] ; \
    then printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ; \
    else wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` && \
    tar -zxvf node-v*arm-pi*.tar.gz; fi
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    && printf "\nLatest release does not have an arm-pi binary distribution to download\n\n"
    # ElseIf there is an arm-pi binary then download it.
    [ `stat -c %s tmp1.txt` -eq 0 ] \
    || ( wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` \
    && tar -zxvf node-v*arm-pi*.tar.gz )
    echo #nop
    ```

  14. glennschler revised this gist Nov 17, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Notes.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ sudo apt-get update
    sudo apt-get upgrade
    ```

    * I have a few old USB Belkin F5D8053.v4 WiFi which work even if not on [the list](elinux.org/RPi_USB_Wi-Fi_Adapters)
    * I have a few old USB Belkin F5D8053.v4 WiFi which work even if not on [the list](http://elinux.org/RPi_USB_Wi-Fi_Adapters)
    * If Wifi, do WiFi management using WpaSupplicant.
    ```
    sudo apt-get install wpasupplicant
  15. glennschler revised this gist Nov 17, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ mkdir -p ~/tmp
    cd ~/tmp
    # Change to the version needed. The 'latest' version or a specific version.
    #lastest_node=v0.10.20
    #lastest_node=v0.10.21
    nver=latest
    # Download and unzip the requested Node.js for ARM-Pi which was built and distributed by NodeJs.org
  16. glennschler revised this gist Nov 17, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    * One option is to download the latest nodeJs.org source tarball, and make the node binary. This is a different exercise which this gist file does not address.

    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. To automate downloading the latest version, first curl the directory, and grep to find the only "arm-pi" HREF for the wget command:
    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. First get the node version dir, and then find the only "arm-pi" HREF for the wget command.
    * To automate, copy and paste this entire code block into a RPi terminal session.

    ```
    mkdir -p ~/tmp
  17. glennschler revised this gist Nov 17, 2013. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -13,9 +13,13 @@ nver=latest
    # Download and unzip the requested Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/$nver/
    cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tmp1.txt
    if [[ `stat -c %s tmp1.txt` -eq 0 ]] ; then printf "\nLatest distro is missing arm-pi\n" ; \
    # Since not every release has an arm-pi binary, check before attempting to download
    if [[ `stat -c %s tmp1.txt` -eq 0 ]] ; \
    then printf "\nLatest release does not have an arm-pi binary distribution to download\n\n" ; \
    else wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` && \
    tar -zxvf node-v*arm-pi*.tar.gz; fi
    echo #nop
    ```

    * Move the node binaries and docs
  18. glennschler revised this gist Nov 17, 2013. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,20 @@
    * Get Node directly from the originating source at NodeJs.org (Joyent). They have a RPi binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. To automate downloading the latest version, first curl the directory, and grep to find the only "arm-pi" HREF for the wget command:
    * One option is to download the latest nodeJs.org source tarball, and make the node binary. This is a different exercise which this gist file does not address.

    * Get the Node binary directly from the originating source at NodeJs.org (Joyent). They often have a RPi binary distribution in their latest stable release. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. To automate downloading the latest version, first curl the directory, and grep to find the only "arm-pi" HREF for the wget command:

    ```
    mkdir -p ~/tmp
    cd ~/tmp
    # Download and unzip the latest Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/latest/
    # Change to the version needed. The 'latest' version or a specific version.
    #lastest_node=v0.10.20
    nver=latest
    # Download and unzip the requested Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/$nver/
    cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tmp1.txt
    if [[ `stat -c %s tmp1.txt` -eq 0 ]] ; then printf "\nLatest distro is missing arm-pi\n" ; \
    else wget -N "http://nodejs.org/dist/latest/"`cat tmp1.txt` && \
    else wget -N "http://nodejs.org/dist/$nver/"`cat tmp1.txt` && \
    tar -zxvf node-v*arm-pi*.tar.gz; fi
    ```

  19. glennschler revised this gist Nov 17, 2013. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,11 @@ mkdir -p ~/tmp
    cd ~/tmp
    # Download and unzip the latest Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/latest/`curl http://nodejs.org/dist/latest/ | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2`
    tar -zxvf node-v*arm-pi*.tar.gz
    wget -N http://nodejs.org/dist/latest/
    cat index.html | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 > tmp1.txt
    if [[ `stat -c %s tmp1.txt` -eq 0 ]] ; then printf "\nLatest distro is missing arm-pi\n" ; \
    else wget -N "http://nodejs.org/dist/latest/"`cat tmp1.txt` && \
    tar -zxvf node-v*arm-pi*.tar.gz; fi
    ```

    * Move the node binaries and docs
  20. glennschler revised this gist Nov 9, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    * Get Node directly from the originating source at NodeJs.org (Joyent). They have a RPi binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. To automate geting the latest version, first curl the directory, grep to find the only "arm-pi" HREF for the wget command:
    * Get Node directly from the originating source at NodeJs.org (Joyent). They have a RPi binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. To automate downloading the latest version, first curl the directory, and grep to find the only "arm-pi" HREF for the wget command:

    ```
    mkdir -p ~/tmp
  21. glennschler revised this gist Nov 9, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    * Get Node directly from the originating source at NodeJs.org (Joyent). They have a RPi binary distribution now. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. Just automate the wget by first curl-ing the directory, and grep to find the only "arm-pi" HREF.
    * Get Node directly from the originating source at NodeJs.org (Joyent). They have a RPi binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. To automate geting the latest version, first curl the directory, grep to find the only "arm-pi" HREF for the wget command:

    ```
    mkdir -p ~/tmp
  22. glennschler revised this gist Nov 9, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Notes.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,8 @@ sudo apt-get update
    sudo apt-get upgrade
    ```

    * If Wifi, try WiFi management using WpaSupplicant?
    * I have a few old USB Belkin F5D8053.v4 WiFi which work even if not on [the list](elinux.org/RPi_USB_Wi-Fi_Adapters)
    * If Wifi, do WiFi management using WpaSupplicant.
    ```
    sudo apt-get install wpasupplicant
    ```
  23. glennschler revised this gist Nov 9, 2013. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    * Get node.js directly from the NodeJs.org (Joyent) binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. Automate the wget by first curl-ing the directory, and grep to find the only "arm-pi" HREF.
    * Get Node directly from the originating source at NodeJs.org (Joyent). They have a RPi binary distribution now. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. Just automate the wget by first curl-ing the directory, and grep to find the only "arm-pi" HREF.

    ```
    mkdir -p ~/tmp
    @@ -25,4 +25,7 @@ sudo ln -s -f /opt/node/bin/npm /usr/bin/npm
    # test
    which node && node --version
    which npm && npm --version
    which npm && npm --version
    # Cleanup [optional]
    rm -r node-v*
  24. glennschler revised this gist Nov 9, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ sudo rm -r -f /opt/node
    sudo mkdir /opt/node
    # Move the expanded files
    sudo mv node-v\*arm-pi\*/* /opt/node
    sudo mv node-v*arm-pi*/* /opt/node
    # Symlink node and npm to somewhere already in the path. Debate where...
    sudo ln -s -f /opt/node/bin/node /usr/bin/node
  25. glennschler renamed this gist Nov 9, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions _raspberry pi node.js.md → {raspberry pi node.js}.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    * Get node.js directly from the NodeJs.org (Joyent) binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. Automate the wget by first curl-ing the directory, and grep to find the only "arm-pi" HREF.

    ```
    mkdir ~/tmp
    mkdir -p ~/tmp
    cd ~/tmp
    # Download and unzip the latest Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/latest/`curl http://nodejs.org/dist/latest/ | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2`
    tar -zxvf node-v\*arm-pi\*.tar.gz
    tar -zxvf node-v*arm-pi*.tar.gz
    ```

    * Move the node binaries and docs
  26. glennschler renamed this gist Nov 9, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions raspberry pi node.js.md → _raspberry pi node.js.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    * Get node.js directly from the NodeJs.org (Joyent) binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. Automate the wget by first curl-ing the directory, and grep to find the only "arm-pi" HREF.

    ```
    mkdir ~/tmp
    # Download and unzip the latest Node.js for ARM-Pi which was built and distributed by NodeJs.org
    @@ -7,6 +8,7 @@ tar -zxvf node-v\*arm-pi\*.tar.gz
    ```

    * Move the node binaries and docs

    ```
    # Remove any old node version. Create the dir again
    sudo rm -r -f /opt/node
  27. glennschler revised this gist Nov 9, 2013. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions raspberry pi node.js.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    * Get node.js directly from the NodeJs.org (Joyent) binary distribution. Review the [latest node distro](http://nodejs.org/dist/latest) directory, and then download the appropriate file name. Automate the wget by first curl-ing the directory, and grep to find the only "arm-pi" HREF.
    ```
    mkdir ~/tmp
    # Download and unzip the latest Node.js for ARM-Pi which was built and distributed by NodeJs.org
    wget -N http://nodejs.org/dist/latest/`curl http://nodejs.org/dist/latest/ | grep arm-pi | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2`
    tar -zxvf node-v\*arm-pi\*.tar.gz
    ```

    * Move the node binaries and docs
    ```
    # Remove any old node version. Create the dir again
    sudo rm -r -f /opt/node
    sudo mkdir /opt/node
    # Move the expanded files
    sudo mv node-v\*arm-pi\*/* /opt/node
    # Symlink node and npm to somewhere already in the path. Debate where...
    sudo ln -s -f /opt/node/bin/node /usr/bin/node
    sudo ln -s -f /opt/node/bin/npm /usr/bin/npm
    # test
    which node && node --version
    which npm && npm --version
  28. glennschler revised this gist Nov 7, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Notes.md
    Original file line number Diff line number Diff line change
    @@ -19,10 +19,10 @@
    * Connect a keyboard to the RPi USB port
    * Plug NTSC/PAL TV into RPi composite port or HDMI monitor to the HDMI Port.
    * Turn on when connected with RPi Micro USB port cable. Powered via a computer USB port, or a USB wall charger.
    2. Terminal Emulator with GPIO USB console cable
    2. Terminal Emulator with USB to TTL Serial Cable console cable connected to the RPi GPIO
    * [Install PL2303 driver on OS X](http://changux.co/osx-installer-to-pl2303-serial-usb-on-osx-lio/)
    * [Adafruit Connect instructions](http://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/connect-the-lead)
    * Do __NOT__ plug the micro USB to power on. It's already powered with the GPIO console cable.
    * Do __NOT__ plug the micro USB to power on. It's already powered with the console cable.


    * Follow these [Adafruit instructions](http://learn.adafruit.com/adafruits-raspberry-pi-lesson-2-first-time-configuration) for post boot setup using __Raspi_Config__. To summarize:
    @@ -59,7 +59,7 @@ sudo apt-get install avahi-daemon
    ```
    * Connect using SSH over wifi.
    * Disconnect GPIO cable.
    * Disconnect console cable which is connected to the RPi GPIO.
    * Disconnect external monitor and keyboard.
    * Power with the Micro USB cable.
    ```
  29. glennschler revised this gist Nov 7, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Notes.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@
    * [optional] Booting into Desktop when using external monitor
    * [optional] Change password
    * Choose menu item "Advanced Options"
    * Change Hostname e.g. ```hostname_pi``
    * Change Hostname e.g. ```hostname_pi```
    * Enable the SSH server
    * Update Raspi_Config

    @@ -53,7 +53,7 @@ sudo apt-get upgrade
    * Create the ```etc/network/interfaces``` file (shown below).
    * Create the ```/etc/wpa_supplicant/wpa_supplicant.conf``` file (shown below).
    * Avahi implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ping hostname_pi.local from OS X or other Bonjour configured machine
    * Avahi implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ```ping hostname_pi.local``` from OS X or other Zeroconf configured machine
    ```
    sudo apt-get install avahi-daemon
    ```
  30. glennschler revised this gist Nov 7, 2013. 1 changed file with 13 additions and 3 deletions.
    16 changes: 13 additions & 3 deletions Notes.md
    Original file line number Diff line number Diff line change
    @@ -31,8 +31,10 @@
    * Changing Timezone
    * [optional] Booting into Desktop when using external monitor
    * [optional] Change password
    * Configure to host the SSH server
    * Upadate the Raspi_Config
    * Choose menu item "Advanced Options"
    * Change Hostname e.g. ```hostname_pi``
    * Enable the SSH server
    * Update Raspi_Config

    * Start with any linux (raspbian) updates
    ```
    @@ -51,9 +53,17 @@ sudo apt-get upgrade
    * Create the ```etc/network/interfaces``` file (shown below).
    * Create the ```/etc/wpa_supplicant/wpa_supplicant.conf``` file (shown below).
    * Avahi implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ping hostname.local from OS X or other Bonjour configured machine
    * Avahi implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ping hostname_pi.local from OS X or other Bonjour configured machine
    ```
    sudo apt-get install avahi-daemon
    ```
    * Connect using SSH over wifi.
    * Disconnect GPIO cable.
    * Disconnect external monitor and keyboard.
    * Power with the Micro USB cable.
    ```
    ssh pi@hostname_pi.local
    ```
    * [Optional] Follow the [Adafruit instructions](http://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc) to setup and control with desktop UI using VNC.