Getting Started with AngularJS (pt 4): Form submits and two-way data binding

The trouble with learning something new and then not using it for a while is you tend to forget everything you learned a few weeks back.

So picking up again on learning AngularJS (see my previous posts here), I had completely forgot how to handle form submits using AngularJS.

The key is to use the directive ng-submit=”functionname()” on your form, where functionname() is some function defined in $scope in your controller for this form.

The values in your form are automagically bound to your model in your controller, and you can handle the user action of pressing a submit button to do whatever processing you need.

There’s a great explanation in this article here.

Raspbian fsck fails on boot

I used

sudo touch /forcefsck

to set my Pi to run a fsck at boot, but it failed with this message:

"An automatic check (fsck) of the root filesystem failed. A manual fsck must 
be performed, then the system restarted. The fsck should be performed in 
maintenance mode with the root filesystem mounted in read-only mode"

I ran  sudo fsck /dev/mmcblk0p2 – there was a couple of errors that required a ‘y’ to fix, and then it completed. Rebooted, and back to normal. Similar discussion on this message here.

Setting up an automated Raspberry Pi broadband speed monitor

Based on this Make article:

http://makezine.com/projects/send-ticket-isp-when-your-internet-drops/

Grab the scripts:

sudo apt-get install python-pip
sudo pip install speedtest-cli
git clone https://github.com/HenrikBengtsson/speedtest-cli-extras.git

Create an IFTTT account and add the ‘If Maker then Google Drive‘ recipe to your account. This step deserves further investigation… this is an incredibly easy way to integrate access to online accounts (Twitter, Facebook, Google etc) and trigger writing messages to them via a REST based api call. Very, very cool.

After you’ve done the above, while logged on to IFTTT, click Channels in the top right, find the Maker channel and click it, and you’ll find your secret key value to use in the next script.

Copy script from this Gist, modify to add your secret key from above setup:

https://gist.github.com/aallan/bafc70a347f3b9526d30

At this point you can follow the other steps in the Maker article to set up to run the script using cron, and you’re all set!