- There are some really good instructions here: http://elinux.org/RPi_Email_IP_On_Boot_Debian
- In order for it to work I had to set up an application password for gmail since I'm using two-factor authentication to login
- Reboot and it sent me an email. That was painless!
Monday, 5 May 2014
Making the Raspberry Pi Email IP on Boot
I needed my Raspberry Pi to email its IP address to me when it booted in order to ease finding the IP address when running headless. Here's how I did it:
Twilio Interface for the Rube Goldberg Machine
Here's how I built the Twilio interface to the Rube Goldberg machine...
- Install the Twilio python libraries: sudo pip install twilio
- Set up a feature branch for Twilio: git checkout -b twilio-plugin
- Set up tests and code to load credentials from twilio.secret file
- From the secret file load the account_sid and auth_token
- Write the update_state() method to send an SMS with Twilio
- Decided not to unittest the SMS sending as this is just simple interface code with no logic
- Used the python code documented at: https://www.twilio.com/user/account/developer-tools/api-explorer/message-create
- With a bit of Blu Tack, and some dominoes the system worked: http://youtu.be/Vj7IvwIN0r4
Sunday, 4 May 2014
Fixing Anki Flashcard Dates
I've been using Anki for a while to learn things. Recently I made the mistake of editing some existing cards to have a new meaning. The problem was that the algorithm for when the card would be next presented to me did not reset itself on the edit. I was left wanting to see the edited card, but Anki telling me that I'd have to wait for three months first.
Here's how I fixed it:
Here's how I fixed it:
- Installed the full PC version of Anki: sudo apt-get install anki
- Connect the full PC version and sync up the deck in question
- Realise that the Debian stable version of Anki is out of date to work with the server
- Set up Apt-Pinning for Anki:
- Add a testing entry to /etc/apt/sources.list
- Edit /etc/apt/preferences and set it up like this
- Run aptitude, update
- Find the anki package in the aptitude UI
- Pick the 2.0... version of Anki and install it -- being careful to make sure aptitude picks the correct version
- With the PC client running click "browse"
- Select the required deck
- Select all the cards
- Do Edit->Reschedule then set the schedule for zero days
- Close the browser and reopen the deck, all the cards are now ready for review
- Sync back up to the server and back down the phone again
Package: * Pin: release a=stable Pin-Priority: 900 Package: * Pin: release a=testing Pin-Priority: 600
Subscribe to:
Posts (Atom)