Technology
The Ultimate Raspberry Pi Commands Cheat Sheet
The Raspberry Pi is the most popular single-board computer (SBC) available. Just $35 gets you a powerful, fully-fledged Linux computer with Wi-Fi, Bluetooth, and 40 connected general-purpose input/output (GPIO) pins. It’s no surprise that the Raspberry Pi is equally popular between professional engineers, computer hobbyists, makers, and in the education sector.
While the Raspberry Pi runs on Linux, there are a few more features that you’d find in a common Linux distribution. The addition of GPIO pins, along with the two main libraries supporting them, means much more to remember!
That’s why we’ve prepared this handy cheat sheet for day-to-day Raspberry Pi usage.
FREE DOWNLOAD: This cheat sheet is available as a downloadable PDF from our distribution partner, TradePub. You will have to complete a short form to access it for the first time only. Download The Ultimate Raspberry Pi Commands Cheat Sheet.
The Ultimate Raspberry Pi Commands Cheat Sheet
Command | Result |
---|---|
Raspbian OS Terminal | |
cat [name] | Show the contents of the file [name] |
cd .. | Change to parent directory |
cd [path] | Move to the directory at [path] |
cd / | Change to root directory |
cd ~ | Change to your home directory - usually “/home/” |
chmod [who][+,-,=][permissions] [name] | Change the permissions for a file |
chmod 777 [name] | Allow all users to read, write and execute the file [name] |
chmod u+x [name] | Allow the user to execute [name] |
cp -r [from] [to] | Copy all files and subdirectories from source [from] to destination [to] |
cp [from] [to] | Copy a file from source [from] to destination [to] |
find | Search for files and their contents |
grep ‘string’ [name] | Search inside one or more files for occurrences of ‘string’ |
head [name] | Return all occurrences of ‘string’ within file [name] |
ls | List the contents of the current directory |
ls -a | List all files including hidden files |
ls -l | List the contents of the current directory with more file information |
ls [path] | List the contents of the directory found at [path] |
man [command] | Open the manual/help page for [command] |
man man | Open the manual/help page for the ‘man’ command (helpception) |
mkdir [name] | Create a directory called [name] in the current working directory |
mv -r [from] [to] | Move all files and directories from source [from] to destination [to] |
mv [from] [to] | Move a file from source [from] to destination [to] |
pwd | Show the name of the current working directory |
python/python3 -version | Shows you what version of Python you currently have installed |
rm -r * | Remove all files and directories from the current working directory |
rm [name] | Remove the specified file |
rm * | Remove all files from the current working directory |
rmdir [name] | Remove the empty directory [name] from the current working directory |
sudo [command] | Superuser do. Execute [command] with elevated privileges (Allows you to do things you usually wouldn’t have access to) |
sudo apt-get install [package] | Install a package |
sudo apt-get update | Update the list of packages |
sudo apt-get upgrade | Upgrade the installed packages - must be run after sudo apt-get update |
sudo chown pi:root [name] | Change the owner of the file [name] to user ‘pi’ and set the group to ‘root’ |
sudo raspi-config | Launch the Raspberry Pi configuration menu |
sudo reboot | Safely restart your Pi |
sudo shutdown -h now | Safely shutdown your Pi immediately |
sudo su | Places you in the root directory with root user access - be careful with this! |
tail [name] | Show the end of file [name] |
tar -cvzf [name] [path] | Create compressed file [name] from the contents of [path] |
tar -xvzf [name] | Extract the contents of the compressed file [name] |
wget [uri] | Download the file found at [uri] on the internet |
RPi.GPIO Library | |
import RPi.GPIO as GPIO | Import the RPi.GPIO module into the python sketch |
GPIO.setmode(GPIO.BCM) | Use Broadcom pin numbers (GPIO 14, GPIO 15 etc) |
GPIO.setmode(GPIO.BOARD) | Use board pin numbers (4,5, 8 etc) |
GPIO.getmode() | Returns current pin numbering mode (BCM, BOARD, or None) |
GPIO.setup([pin number], GPIO.IN) | Set up the pin at [pin number] to be an input |
GPIO.setup([pin number], GPIO.IN, pull_up_down=GPIO.PUD_DOWN) | Set up the pin at [pin number] to be an input with internal pull down resistance |
GPIO.setup([pin number], GPIO.IN, pull_up_down=GPIO.PUD_UP) | Set up the pin at [pin number] to be an input with internal pull up resistance |
GPIO.setup([pin number], GPIO.OUT) | Set up the pin at [pin number] to be an output |
GPIO.setup([pin number], GPIO.OUT, initial=1) | Set up the pin at [pin number] to be an output with the initial value ‘1’ |
GPIO.output([pin number], 1) | Set [pin number]’s value to 1. Note that 1, GPIO.HIGH and True are the same thing |
GPIO.output([pin number], 0) | Set [pin number]’s value to 0. Note that 0, GPIO.LOW and False are the same thing |
i = GPIO.input([pin number]) | Set the variable i to the value of [pin number] |
if GPIO.input([pin number]): | Use the value of [pin number] as a boolean in code |
GPIO.cleanup() | Reset all GPIO pins (good practice to call before leaving any program) |
GPIO.VERSION | Returns current RPi.GPIO version |
GPIO Zero Library | |
LEDs | |
from gpiozero import LED | Import the LED section of the gpiozero library |
led = LED(17) | Assign the ‘led’ variable to an LED on pin GPIO 17 |
led.on() | Turn on the LED stored in the ‘led’ variable |
led.off() | Turn off the LED stored in the ‘led’ variable |
led.toggle() | Toggle the LED stored in the ‘led’ variable (if it’s off, turn it on and vice versa) |
Motors | |
from gpiozero import Motor | Import the Motor section of the gpiozero library |
motor = Motor(17, 18) | Assign the variable ‘motor’ to a Motor object containing the forward and backward drive pin numbers |
motor.forward() | Activate the forward pin of the variable ‘motor’ |
motor.backward() | Activate the backward pin of the variable ‘motor’ |
motor.reverse() | Reverse the current motor direction |
motor.stop() | Stop the motor |
Buzzer | |
from gpiozero import Buzzer | Import the Buzzer section of the gpiozero library |
bz = Buzzer(3) | Assign the variable bz to a Buzzer on pin GPIO3 |
bz.on() | Turn the buzzer on |
bz.off() | Turn the buzzer off |
bz.toggle() | Toggle the buzzer’s state (if it’s off, turn it on and vice versa) |
Servo | |
from gpiozero import Servo | Import the Servo section of the gpiozero library |
servo = Servo(17) | Assign the ‘servo’ variable to a Servo on GPIO 17 |
servo.min() | Move the servo to its minimum value |
servo.mid() | Move the servo to its middle value |
servo.max() | Move the servo to its maximum value |
servo.value = 0.5 | Move the servo to a set numerical point (min = -1, max = 1) |
Raspi Camera Image | |
raspistill | Command to take a still image with attached camera, modify with arguments below |
-width, -w | Set image width |
-height, -h | Set image height |
-quality, -q | Set JPEG quality (75 is most common) |
-raw, -r | Inserts raw Bayer data from the camera into the JPEG metadata |
-output, -o | Output filename (required for saving) |
-latest, -l | Add latest frame to filename |
-verbose, -v | Verbose debugging information during run |
-timeout, -t | Set a time to wait before capturing an image. |
-encoding, -e | Encoding to use for output file - jpg, gif, bmp, or png |
Raspi Camera Video | |
raspivid | Command to take a video using attached camera, modify with arguments below |
-width, -w | Set image width (between 64px - 1920px) |
-height, -h | Set image height (between 64px - 1080px) |
-bitrate, -b | Set bitrate in bits per second (i.e 15 Mbits/s = 15000000) |
-output, -o | Output filename (required for saving) |
-verbose, -v | Verbose debugging information during run |
-timeout, -t | Set a time to wait before capturing video |
-framerate, -fps | Specify the frames per second for recording |
Expand Your Knowledge With Linux
These commands will help you navigate the Pi’s terminal, and program its GPIO pins. That said, this cheat sheet doesn’t even begin to scratch the surface. There is a huge depth of support for hobby components, cameras and screens for the Raspberry Pi. Listing them in one place is almost impossible!
The good thing is, since the Raspberry Pi is a Linux computer, you can reference a cheat sheet for general Linux systems to expand your knowledge even further.
Read the full article: The Ultimate Raspberry Pi Commands Cheat Sheet
Technology
How Lifetime Access to Rosetta Stone Is Cheaper Than You Think
Social distancing means we’re all spending more time in the house than ever… But once you’ve played every board game you own, replayed the entire Halo series on Xbox, and turned your backyard into botanical gardens, what else are supposed to do with your time?
Perhaps this is the moment to spread your wings and learn something new? If you’re itching for some projects to get stuck into, check out our social distancing subscription bundle.
What’s Included?
We’ve teamed up with our partners to offer MUO readers a mega saving on three premium apps:
- Rosetta Stone
- KeepSolid VPN Unlimited
- 12min Premium Micro Book Library
Combined, the apps are worth nearly $850. As a MakeUseOf reader, you can pick up the entire bundle for just $199—a 76 percent discount on the regular price.
Why Use Rosetta Stone?
Rosetta Stone is one of the most comprehensive language-learning suites in the world. It caters for all levels and comes with a variety of learning aids. The program’s aim is to make you absorb your target language in the same way that you do when you’re a child.
In total, 24 languages are offered on the platform, including Spanish, French, German, Italian, Mandarin, and Russian.
This deal gives you lifetime access to all 24 languages on both desktop and mobile.
You’ll also be able to practice your pronunciation with Rosetta Stone’s TruAccent speech recognition technology and, when you feel comfortable enough, use the advanced speech engine to compare your accent with native speakers.
KeepSolid VPN Unlimited
The lockdown has meant we’ve all been binge-watching TV and movies more than ever. That’s where the next tool in the bundle—KeepSolid VPN Unlimited—is useful.
As any regular MakeUseOf reader knows, using a VPN lets you bypass geoblocking that streaming services put in place. It means you can access the Netflix catalog from another country, stream live TV from BBC iPlayer if you’re based outside the UK, and even sign up for paid subscriptions with video-on-demand providers from elsewhere in the world.
Of course, a VPN is also an essential security tool. You can protect yourself on public Wi-Fi, prevent your ISP and local government from seeing your web traffic, and encrypt all your internet data.
KeepSolid VPN Unlimited has servers in more than 80 countries and supports the major VPN protocols such as IKEv2, OpenVPN, and L2TP/IPSec.
Once again, this deal will bag you a lifetime subscription.
12min Premium Micro Book Library
The final lifetime subscription in our social distancing bundle is 12min Premium Micro Book Library.
One of the curious truths about 2020’s lockdown is that while we might all be spending more time in our homes, many of us also have less free time than ever. Anyone with kids knows what we’re talking about.
If you’re a book lover who’s not had time to read any new material in 2020, 12min Premium Micro Book Library might offer a solution. The app’s specialty is providing digestible overviews of long books. In theory, each overview only takes 12 minutes to read. Audio and text versions are available.
In total, more than 380 overviews are on the platform, with 30+ new titles added every month.
Make Social Distancing Fun!
More knowledge, more entertainment, more security. The perfect lockdown combination. If you’d like to get lifetime access to these three premium apps, make sure you grab the bundle while it’s still available—the deal expires on August 15th, 2020.
Read the full article: How Lifetime Access to Rosetta Stone Is Cheaper Than You Think
Technology
Software that monitors students during tests perpetuates inequality and violates their privacy
The coronavirus pandemic has been a boon for the test proctoring industry. About half a dozen companies in the US claim their software can accurately detect and prevent cheating in online tests. Examity, HonorLock, Proctorio, ProctorU, Respondus and others have rapidly grown since colleges and universities switched to remote classes.
While there’s no official tally, it’s reasonable to say that millions of algorithmically proctored tests are happening every month around the world. Proctorio told the New York Times in May that business had increased by 900% during the first few months of the pandemic, to the point where the company proctored 2.5 million tests worldwide in April alone.
I’m a university librarian and I’ve seen the impacts of these systems up close. My own employer, the University of Colorado Denver, has a contract with Proctorio.
It’s become clear to me that algorithmic proctoring is a modern surveillance technology that reinforces white supremacy, sexism, ableism, and transphobia. The use of these tools is an invasion of students’ privacy and, often, a civil rights violation.
If you’re a student taking an algorithmically proctored test, here’s how it works: When you begin, the software starts recording your computer’s camera, audio, and the websites you visit. It measures your body and watches you for the duration of the exam, tracking your movements to identify what it considers cheating behaviors. If you do anything that the software deems suspicious, it will alert your professor to view the recording and provide them a color-coded probability of your academic misconduct.
Depending on which company made the software, it will use some combination of machine learning, AI, and biometrics (including facial recognition, facial detection, or eye tracking) to do all of this. The problem is that facial recognition and detection have proven to be racist, sexist, and transphobic over, and over, and over again.
In general, technology has a pattern of reinforcing structural oppression like racism and sexism. Now these same biases are showing up in test proctoring software that disproportionately hurts marginalized students.
A Black woman at my university once told me that whenever she used Proctorio’s test proctoring software, it always prompted her to shine more light on her face. The software couldn’t validate her identity and she was denied access to tests so often that she had to go to her professor to make other arrangements. Her white peers never had this problem.
Similar kinds of discrimination can happen if a student is trans or non-binary. But if you’re a white cis man (like most of the developers who make facial recognition software), you’ll probably be fine.
Students with children are also penalized by these systems. If you’ve ever tried to answer emails while caring for kids, you know how impossible it can be to get even a few uninterrupted minutes in front of the computer. But several proctoring programs will flag noises in the room or anyone who leaves the camera’s view as nefarious. That means students with medical conditions who must use the bathroom or administer medication frequently would be considered similarly suspect.
Beyond all the ways that proctoring software can discriminate against students, algorithmic proctoring is also a significant invasion of privacy. These products film students in their homes and often require them to complete “room scans,” which involve using their camera to show their surroundings. In many cases, professors can access the recordings of their students at any time, and even download these recordings to their personal machines. They can also see each student’s location based on their IP address.
Privacy is paramount to librarians like me because patrons trust us with their data. After 9/11, when the Patriot Act authorized the US Department of Homeland Security to access library patron records in their search for terrorists, many librarians started using software that deleted a patron’s record once a book was returned. Products that violate people’s privacy and discriminate against them go against my professional ethos, and it’s deeply concerning to see such products eagerly adopted by institutions of higher education.
This zealousness would be slightly more understandable if there was any evidence that these programs actually did what they claim. To my knowledge, there isn’t a single peer-reviewed or controlled study that shows proctoring software effectively detects or prevents cheating. Given that universities pride themselves on making evidence-based decisions, this is a glaring oversight.
Fortunately, there are movements underway to ban proctoring software and ban face recognition technologies on campuses, as well as congressional bills to ban the US federal government from using face recognition. But even if face recognition technology were banned, proctoring software could still exist as a program that tracks the movements of students’ eyes and bodies. While that might be less racist, it would still discriminate against people with disabilities, breastfeeding parents, and people who are neuroatypical. These products can’t be reformed; they should be abandoned.
Cheating is not the threat to society that test proctoring companies would have you believe. It doesn’t dilute the value of degrees or degrade institutional reputations, and student’s aren’t trying to cheat their way into being your surgeon. Technology didn’t invent the conditions for cheating and it won’t be what stops it. The best thing we in higher education can do is to start with the radical idea of trusting students. Let’s choose compassion over surveillance.
Shea Swauger is an academic librarian and researcher at the University of Colorado Denver.
Technology
5 Reasons Why You Should Buy The New Maruti Suzuki S-Cross 2020
Ever since Maruti Suzuki discontinued diesel engines, its SUV S-Cross went off the sales chart as it only had a diesel variant. However, the 2020 Maruti Suzuki S-Cross is back with a powerful new hybrid petrol engine and better looks.
As reported in our previous article, the bookings for SUV are already open and you can book it from the nearest Nexa outlet or through online platforms. However, at that time we knew very little about the specifications of the new S-Cross. As the automaker confirms the details of the SUV, we can say the new S-Cross is quite impressive.
In fact, this SUV is worth considering before buying a new car in the compact SUV segment. Here are the reasons why we think you should check out the all-new 2020 Maruti Suzuki S-Cross.
5 Reasons Why Maruti Suzuki S-Cross
1. Improved Built Quality And Safety Standards
Unlike the reputation of the automaker for built quality, Maruti Suzuki S-Cross is quite impressive with its high-end safety standards. The SUV has a five-star safety rating in ASEAN NCAP crash test.
With an overall score of 15.48 out of 16 for adult occupant protection, S-Cross is one of the safest cars in its segment.
Poor safety standards are one of the major reasons why people switch away from Maruti cars. With this assurance, you can go for S-Cross without any hesitation.
2. Hybrid Powertrain
The new Maruti Suzuki S-Cross is one of the most affordable SUVs with a hybrid powertrain. The latest variant of this compact SUV is equipped with Suzuki’s Smart Hybrid Vehicle Technology (SHVS).
Under the hood is a combination of a K15B 1.5-liter BS6 compliant petrol engine and an electric motor. The electric motor gets power from two small lithium-ion battery packs.
With this powertrain, the SUV gets a total output of 103 BHP and 138 Nm of peak torque. The engine is available with both manual and automatic transmission.
Not only does the S-Cross have decent power delivery, but it also has very low carbon emissions due to the hybrid powertrain. Maruti Suzuki S-Cross is a very good option for masses who prefer eco-friendly cars.
Apart from this, Maruti Suzuki has provided features like Idle Start-Stop (ISS), Brake Energy Regeneration, and Torque assist during acceleration for a better experience.
3. Impressive Mileage
Being an SUV, S-Cross has quite an impressive fuel- efficiency. The automaker claims to provide a mileage of 18.55 km/l on MT and 18.43 km/l with AT. Generally, the SUVs in this segment offer a fuel-economy of under 15 km/l. However, with a mild-hybrid and idle Start-Stop (ISS) system, Maruti Suzuki S-Cross is providing impressive mileage.
The idle start-stop system turns off the engine when the vehicle is stationary, especially when waiting at red lights, and starts it again when the clutch is pressed. This way, it cuts off unnecessary fuel-consumption.
Looking at the fuel-efficiency we can say now you don’t have to worry about fuel-economy.
4. Improved Braking And Ride Quality
The new S-Cross comes with 4 disc brakes, which provides amazing stopping power, you can easily go into a corner with a higher speed without any worry. Well, it doesn’t mean you should over-speed, always ride within the safe speed limit.
The front disc brakes of S-Cross are ventilated for better heat dissipation. The braking force acts more on the front wheels, therefore the front wheels need to be better in all aspects than the rear one.
5. More Features, More Comfort
The 2020 Maruti Suzuki S-Cross features a smart infotainment system with Android Auto and Apple CarPlay connectivity. Additionally, this compact SUV is equipped with features like cruise control, autosensing rain wipers, push start, and much more.
Other than this, the rear seats of the car are made foldable that allows the user to have more cabin space. Foldable seats are very useful in putting extra luggage.
The best part is that, with all these features and a hybrid tag, the price of S-Cross starts at Rs 8.39 lakh (ex-showroom). On the other hand, there are no hybrid SUVs in this segment except the MG Hector hybrid which is almost twice in price than S-Cross. This also makes S-Cross a value for money car.
Finally, we would like to say that though it might not be the best selling car of Maruti, it’s much better than the other best selling cars of the company.
Do share your views in the comments section below.
The post 5 Reasons Why You Should Buy The New Maruti Suzuki S-Cross 2020 appeared first on Fossbytes.
-
Business3 weeks ago
Bernice King, Ava DuVernay reflect on the legacy of John Lewis
-
World News2 weeks ago
Heavy rain threatens flood-weary Japan, Korean Peninsula
-
Technology2 weeks ago
Everything New On Netflix This Weekend: July 25, 2020
-
Finance3 months ago
Will Equal Weighted Index Funds Outperform Their Benchmark Indexes?
-
Marketing Strategies7 months ago
Top 20 Workers’ Compensation Law Blogs & Websites To Follow in 2020
-
World News7 months ago
The West Blames the Wuhan Coronavirus on China’s Love of Eating Wild Animals. The Truth Is More Complex
-
Economy9 months ago
Newsletter: Jobs, Consumers and Wages
-
Finance8 months ago
$95 Grocery Budget + Weekly Menu Plan for 8