Get Stock Quote from Yahoo using Node-RED

[ { "id": "d5d3c55c.ff8808", "type": "debug", "z": "3b163621.c03b8a", "name": "", "active": true, "console": "false", "complete": "false", "x": 930, "y": 180, "wires": [] }, { "id": "39834827.c17818", "type": "http request", "z": "3b163621.c03b8a", "name": "Yahoo Stock", "method": "GET", "ret": "txt", "url": "http://download.finance.yahoo.com/d/quotes.csv?s=^IXIC&f=nsl1opc1p2&e=.csv", "tls": "", "x": 510, "y": 180, "wires": [ [ "247647e3.b30f88", "5db14531.5fb30c" ] ] }, { "id": "5aba260a.74be08", "type": "inject", "z": "3b163621.c03b8a", "name": "Click me to request a stock quote...", "topic": "", "payload": "", "payloadType": "date", "repeat": "", "crontab": "", "once": true, "x": 210, "y": 180, "wires": [ [ "39834827....

October 17, 2017

Install Docker and Compose on Debian 9 Stretch

#!/bin/bash apt-get update apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg2 \ software-properties-common curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/debian \ $(lsb_release -cs) \ stable" apt-get update apt-get install -y \ docker-ce \ docker-compose If you plan on using the –memory flag when creating containers, you may need to enable memory and swap accounting in the Kernel. Log into the Ubuntu host as a user with sudo privileges....

October 3, 2017

Sonic Pi Coding Class 003

Last week we wrote a function to set the volume based on musical dynamics like ‘ppp’ or ‘fff’ Functions can also be used to return information to us. An example of a function that returns a value is below. Type it in and see how it works. define :get_volume do |music_notation| # Write your code here to work out volume level # corresponding to music_notation like 'ppp' # Return the volume level like this # return volume_level # Or we could just return a number for this # example to see how it works return 0....

September 14, 2017

Choosing a Random Synth in Sonic Pi

Towards the end of our coding class at school today, one of the children asked me how they would choose a random synth in their code. I couldn’t give them the answer off of the top of my head so I came home and have placed two different solutions below: # Choosing a Random Synth in Sonic Pi # Solution 1 10.times do use_synth [:beep, :blade, :cnoise, :dpulse].choose play :C3 sleep 1 end # Solution 2 10....

August 10, 2017

Get Spell Checking Working in Libre Office on a Raspberry Pi

Spell checking never seems to work, by default, in Libre Office on a Raspberry Pi. To get it working: # Go to: https://extensions.libreoffice.org/extensions/english-dictionaries/ # Click on the Current Release or go to the below URL which # is current as of now! https://extensions.libreoffice.org/extensions/english-dictionaries/2017-01.01 # Download the .oxt file # In Libre Office go to Tools / Extension Manager # Add the .oxt file # Spell checking now works!

February 19, 2017

Mount a Network Drive on a Raspberry Pi

This has been tested on Jessie with the PIXEL Desktop. I haven’t tested it in previous versions. Substitute the IP address in fstab and the share name, as appropriate! # Make a directory in /mnt sudo mkdir /mnt/DataDisk # Edit fstab: sudo nano /etc/fstab # Add a line with a similar format as below //192.168.178.240/DataDisk /mnt/DataDisk cifs guest,iocharset=utf8,_netdev,x-systemd.automount 0 0 # Reboot and check that things mount OK after a reboot sudo shutdown -r now

February 19, 2017

Good Friend

Source: War and Peas 🙂

January 31, 2017

Show Docker Stats with Container Name Instead of Container ID

docker stats $(docker ps --format={{.Names}}) More details in the Docker CLI Reference

January 14, 2017

Spot the International Space Station in New Plymouth

If you don’t live in New Plymouth, choose your location, below:

January 10, 2017

Run a Bash Shell in a Running Docker Container

There was a time when I could never remember this… but now I’ve typed it so often! docker exec -it container_name /bin/bash More details in the Docker CLI Reference

November 24, 2016