Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Wednesday, June 26, 2019

The Raspberry Pi 4 is here!

In a surprising move, the Raspberry Pi foundation announced the much-anticipated Raspberry Pi 4. See why it matters.
Wow! The Raspberry Pi Foundation just announced the Raspberry Pi with awesome additions. With the new hardware, the desktop experience should be even smoother. Plus, it includes support for optionally more memory, 4k displays, USB-C, gigabit ethernet, Raspbian updates and more, much more.

UPDATE: The Raspberry Pi foundation just announced a Raspberry Pi 4 with 8GB of RAM! Read more here.

What's New

In summary, this is what stands out in this release:
  • Updated ARM Cpu. Now 1.5GHz Arm
  • Updated Ram size (1GB, 2GB, 4GB and 8GB)
  • Two new USB 3 ports
  • 4-bit BCM2711 quad-core A72 CPU @ 1.5GHz
  • VideoCore VI GPU
  • Gigabit Ethernet port
  • Support for 4k displays
  • Dual-band WiFi supporting both 2.4GHz and 5GHz
  • Double-HDMI - so now you can connect two monitors
  • Powered by a USB Type C
  • Bluetooth 5.0
  • Audio – 4-pole stereo audio and composite video port

Why the Raspberry Pi is matters

Before going forward, let's review why the Pi is important.
  • it runs Linux
  • it's super cheap
  • it's an excellent computer for kids
  • it's excellent for teaching computing kids
  • it's an excellent alternative to the Chrome OS
  • it can be a VPN server
  • it can be a gaming machine
  • it can be used for robotics
  • it can interface with Arduino trough its GPIO header
  • it's an excellent opportunity to learn Linux
  • And so much more!

Physical Computing

The PI allows us to interface with the external world (called physical computing) with its GPIO header. It's basically a standard 40 pin I/O that you can use to read/send electric signals to LEDs, motors, sensors, etc. With it we can build all sorts of things including robots.

It's perfect for kids

Either being their first PC (as in personal computer, not as in Windows) or an upgrade, I think that Pi's are perfect for kids.

Why? We could for example teach them:
  • basics of computing with MIT's Scratch language
  • linux - so they grow up used to the best OS in the world
  • python programming
  • game development using python and pydev
  • arts and image manipulation with GIMP

It's can be a gaming console

Yes, you could install Retropie on it and load your ROMs into it. Just plug some controllers and you're ready to go.

It can be a hub to learn computing

This is one my favourites. One could use the Pi to learn Python, programming, game development, physical computing and so much more. The Pi is also an excellent introduction to free/open source software and to Linux in general.

It can be a Media Center 

Speaking of sharing, you could use the Pi as your media center using Kodi for example.. So all your videos could be shared between devices connected on the same network.

It's could be for a personal VPN

The Pi has a very low power consumption which makes it a great always-on VPN server. Trough it you'll get secure access to your home network when you're on the go and can use it for secure web browsing when you're on public networks.

It could be a personal File server

You could turn your Pi into a file server to back up and share content from anywhere on your local network. That way, you could share with everyone connected to your home network access all your files potentially hosted on that old external drive.

It could be a Web Server

Yes! If you don't believe, check this article out on how the Raspberri Pi foundation built its website running on a cluster of Pi's handling record load. Very interesting read.

It runs Linux

This Raspberry Pi 4's operating system, Raspbian was updated from a major Debian release, Buster. Buster brings a few user interface tweaks and a whole host of software upgrades, including Python 3.7.

It could replace your old computer

Yes! We've been waiting for nice ARM computers for some time now. Turns out that the Pi 4 has enough specs to be considered as an entry-level computer. The Pi 4 also supports dual monitors and comes with USB 3.0 interface collaborating with faster external storage access.

Pricing and availability

This is the best part. The pricing for just the Raspberry Pi 4 board starts from $35 and depending on the choice of RAM (1-4 GB) as detailed below:
  • Raspberry Pi 4 with 1 GB RAM: $35 USD
  • Raspberry Pi 4 with 2 GB RAM: $45 35 USD
  • Raspberry Pi 4 with 4 GB RAM: $55 USD
  • Raspberry Pi 4 with 4 GB RAM: $75 USD (New!) - Read the official announcement

Performance

By the specs, it's clear that the Pi 4 is way better than the previous generations. But how much? This beautiful post from Gareth Halfacree provides a lot of details on it. Allow me to show what stood out to me:
Source
Source
Source

The official announcement

The announcement video from the Pi Foundation summarizing some of the changes can be seen below

Final Thoughts

The Pi has always amazed me. Being a fan of physical computing and having both a Pi and an Arduino, I'm so excited to see the recent improvements with the Pi that I'm planning to by one for my kids and one for me to test out different use cases. Plus, we the excellent performance, the Pi now not only serves as a small server but as a very capable GNU/Linux desktop system.

And you, have you considered the Pi yet?

References

See Also

For more posts about Linux on this blog, please click here.

Monday, November 12, 2018

Windows Subsystem for Linux, the best way to learn Linux on Windows

Want to learn Linux but don't know how/where to start? WSL may be a good option.
In 2018, Microsoft released the Windows Subsystem for Linux (WSL). WSL lets developers run the GNU/Linux shell on a Windows 10 PC, a very convenient way to access the beloved tools, utilities and services Linux offers without the overhead of a VM.
WSL is also the best way to learn Linux on Windows!

About WSL

Currently WSL supports Ubuntu, Debian, Suse and Kali distributions and can:
  • run bash shell scripts 
  • run GNU/Linux command-line applications including: vim, emacs, tmux
  • run programming languages like JavaScript, Node.js, Ruby, Python, Golang, Rust, C/C++, C# & F#, etc.
  • run background services like ssh shells, MySQL, Apache, lighttpd;
  • install additional software using own GNU/Linux distribution package manager.
  • invoke Windows applications.
  • access your Windows filesystem

Installing WSL on Windows 10

Installing WSL is covered by Microsoft on this article and is as easy is two steps.

Step 1 - Run a Powershell Command

On your Windows PC, you will need to run this PowerShell script as Administrator (shift + right-click):
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows -Subsystem-Linux
After the installation ends, restart your PC.

Step 2 - Install WSL from the Windows Store

After the reboot, WSL can be installed through the Windows Store. To open the Windows Store on your Windows 10, click:
Start -> Type Store -> Click on the Windows Store:
Then type "Linux" on the search box and you should get something similar results to this:

Click on the icon, accept the terms and Windows will download and install WSL for you.

Running WSL

After installation started, you will be prompted to enter your username and password. After done, you'll get a cool Linux terminal to start playing with. You can even have multiple Distros installed on your Windows 10 machine. On mine, I installed Debian and Ubuntu.

Using the Terminal

Okay, so now that we have access to our Linux shell, what to do next? Let's go through these use cases:
  • Accessing my Windows files
  • Access internet resources
  • I install software

Accessing Windows Files

WSL mounts your Windows files on the /mnt/c mount point. To verify on yours type mount on the command prompt and look for C: on it. Your windows files should be there.
In case you don't know Linux, listing files is done with   ls  . This is the content of my C drive as as seen from WSL:

Accessing the Internet

Your WSL instance should have access to the internet. Testing the internet is as simple as doing a ping to Google:
You can also verify your network info with ifconfig:
 

Installing Software

Installing software on Ubuntu/Debian is done by the apt command. For example, this is how we search packages:
To install packages, use apt-get install. For example, to install Ruby on the Ubuntu WSL, run the command below:
sudo apt-get install ruby-full

Using git

We can leverage apt and install git with:
sudo apt-get install git
... # apt installs git
git --help # to get help
And, I'd recommend learn to use it on the terminal. Atlassian has an excellent tutorial to learn git.

Getting Help

Need help? The man tool is there to help you. For example, we could run the commands below to get help on git for example:
man git

Additional tip: try the new Windows Terminal

And, if you want to invest more time on your WSL, I'd suggest that you install the new Windows Terminal. Download the last release from GitHub and install it on your box. It's very customizeable and contains shells for WSL, PowerShell, Azure CLI and the traditional Windows terminal.

What's next?

Now that you know how to locate your files, have access to the internet and installed some software, I'd recommend that you:

Conclusion

Congratulations! You have the WSL installed on your machine and now you have a Linux terminal to starting playing with. Now what? The first thing I'd recommend is to get comfortable with basic system commands, understand the filesystem, learn to add/remove software and run administrative tasks on the terminal. WSL is perfect for users who want to learn Linux and to those who spent a lot of time on Windows but need access to a Linux terminal.

If you want to know more about my setup, here's why I use Fedora Linux with the fantastic i3 window manager on the desktop and CentOS on servers. Happy hacking!

References

See Also

    About the Author

    Bruno Hildenbrand      
    Principal Architect, HildenCo Solutions.