I have a Raspberry Pi 2B+ that has been collecting dust for quite a while. Due to frequent power outages at school, I haven’t used it for running scripts or downloads. However, recently, the SSH connection to the VPS has been dropping due to power/network issues, which has been quite frustrating. So I’ve decided to turn the Raspberry Pi into a portable compiling environment.
Even though my laptop has a dual-boot system with Windows 7 x64 and Linux Mint, it can be annoying when I need both environments. For example, while studying operating systems recently, I mainly needed to test and experiment in Linux. However, it’s undeniable that doing other tasks in Windows is more efficient. Sometimes, I used SecureCRT to connect to a VPS to compile code. But as mentioned earlier, the school frequently experiences power outages, and once the power goes out, there’s no internet—how can I connect to the VPS then? Later, I had a lightbulb moment: I still have a Raspberry Pi that I can use as a compiling environment for some simple code.
More importantly, am I the only one who finds the Linux man command really useful?
The idea is to use the Raspberry Pi to connect to a computer via Wi-Fi, or have the computer connect to the Raspberry Pi’s AP hotspot, and then use an SSH tool to connect. There’s not much technical challenge here; it’s just quite convenient to use that I’ve decided to jot it down.
Let’s get started.
- First, you’ll need a Raspberry Pi (obviously).
- You need a pre-installed system on a memory card. For specific configuration, check Getting Started with Raspberry Pi.
- You need a USB-WIFI or an Ethernet cable (I prefer using USB-WIFI).
The Wi-Fi I’m using is TP-WN823N, with a chip RT8192eu. This Raspberry Pi is plug-and-play, which means you’ll need to compile the driver yourself.
You can first connect via Ethernet cable or use a router to connect the Raspberry Pi and the computer within the same local area network, then use Mstsc to connect to the Raspberry Pi, after which you can set it up in X.
1 | # Install xrdp to enable mstsc connection |
Connect to the AP created by the computer on the Raspberry Pi:
I recommend creating an AP hotspot on the computer and connecting the Raspberry Pi to it because it allows you to clearly see the Raspberry Pi’s IP, making it easier to connect.
Then, use SecureCRT to connect to the Raspberry Pi:
The Raspberry Pi username is pi, and the default password is raspberry.
Connection successful:
Now, install the compiler and editor:
1 | sudo apt-get install gcc |
Use SecureFX to manage the Raspberry Pi’s files to conveniently upload code:
Let’s compile some code to test fork:
Use the man manual:
Note: When using SecureCRT, you must change the character encoding to UTF-8 in Options - Session Options; otherwise, Chinese characters will become garbled.
ScreenFetch Screenshot: