I encountered an error and thought I’d post the solution here since it just might happen to you sometime! Here’s the scenario:
I was planning to take the winston npm module out for a spin to try out it’s awesome logging capabilities. I created a directory called
winston to create a project and conduct the test. What would be more logical than that? 🙂
Next, I ran
npm init to create a
package.json file hitting my Enter key as fast as it could go to accept all the defaults for this throwaway test project:
In preparing for my upcoming tutorial which is a beginner’s guide to installing Node.js on a Raspberry Pi 2, I ran into an issue. After getting the RasPi is up and running on the network, I was not able to ping its hostname (raspberrypi, by default) from another machine and find it so I could connect to it through Putty, xrdp, VNC, etc. After all, I wanted to be able to run headless and disconnect the monitor, USB keyboard/mouse, and still connect to it from another machine on my network.
One option was to run
ifconfig on the RasPi and take note of the IP address for
eth0 (if connected through Ethernet) or
wlan0 (if connected through Wi-Fi). I could then hard code this IP address in the hosts file on the Windows (or other) machine. The problem is that the RasPi retrieves its IP address through DHCP by default from my local router at home, and this IP address is not guaranteed to remain the same. I could log into my router and note the static IP address range and reconfigure the RasPi to use one of these static IP address rather than DHCP. However, I am preparing a beginner’s tutorial and not all of my readers want to become Linux TCP/IP networking experts.
I discovered an elegant solution if you are trying to ping and connect to the RasPi from another Windows machine on the same network. Samba to the rescue! Continue reading
Today we are kicking off our LTM (Learning through Making) series of tutorials to delve into the amazing world of Node.js. We’re going to do some fun projects along the way, but we first need to lay a foundation and get Node.js installed.
What is Node.js?
Here’s a handy Windows shortcut I use quite frequently for launching a Windows command prompt in a specific folder using Windows Explorer. Thanks to fellow San Diegan Jon Galloway for teaching me this shortcut in one of his Microsoft Virtual Academy classes.
Scenario: You are navigating through Windows Explorer to a folder of interest and realize that you need to drop down into a command prompt to run a specific command in that folder. For example, you want to launch Visual Studio Code from the command prompt using
code . in that folder.
I attended the monthly San Diego Hardware Hackers meeting earlier this week with one of my sons. The presentation was by a local Kickstarter-funded company, Robolink, who is building a device called CoDrone. The CoDrone (portmanteau of Code and Drone) is geared to help teach kids how to code. It can be programmed using the Arduino IDE, and can also be morphed into a Rover kit by replacing the propellers with wheels. Fun stuff! You will find the lessons plans here if you want to get a deeper view into how it is programmed. The goal is to teach computer science to kids as young as the fourth grade. Continue reading