当前位置:网站首页>Raspberry pie preliminary use
Raspberry pie preliminary use
2022-06-26 22:08:00 【weixin_ forty-seven million three hundred thousand four hundred】
List of articles
One 、 Create a new user
One 、 Create a new user
Create user :
sudo useradd -m user name
Set the password :
sudo passwd user name
Give users sudo jurisdiction ( The following file transfer needs ):
# Switch to root user
sudo su
# Edit profile
vi /etc/sudoers
# Increase the configuration ( Press i Start editing ,Esc Exit the editor ,:wq! Save forced exit ), In the open configuration file , find root ALL=(ALL) ALL, Add a line below
# among xxx Is the name of the user you want to join
xxx ALL=(ALL) ALL
Two 、C Program practice
1. Create a c Program
vi The program name .c
2. Get into vi Edit mode , Press i Start writing code
#include <assert.h>
#include <stdio.h>
int main()
{
int a;
char str[50];
printf(" Please enter an integer value : ");
scanf("%d", &a);
assert(a >= 10);
printf(" The integer entered is : %d\n", a);
printf(" Please enter the string : ");
scanf("%s", str);
assert(str != NULL);
printf(" The input string is : %s\n", str);
return(0);
}
3. Press Esc Exit edit mode , Input :wq( Means save and exit )
4. compiler gcc The program name .c -o The program name
3、 ... and 、assert() understand
brief introduction
C Standard library assert.h The header file provides a file named assert The macro , It can be used to verify the assumptions made by the program , And output the diagnostic message when it is assumed to be false .
Library macro
assert.h The header file defines a unique function :assert()
C Library macro - assert()
describe :C Library macro void assert(int expression) Allows diagnostic information to be written to the standard error file . let me put it another way , It can be used in C Add diagnostics to the program .
Statement :void assert(int expression);
expression : This can be a variable or anything C expression . If expression by TRUE,assert() Do nothing . If expression by FALSE,assert() Will be in standard error stderr An error message appears on the , And stop the program execution .
Return value : nothing
example :
Take the above code as an example
#include <assert.h>
#include <stdio.h>
int main()
{
int a;
char str[50];
printf(" Please enter an integer value : ");
scanf("%d", &a);
assert(a >= 10);
printf(" The integer entered is : %d\n", a);
printf(" Please enter the string : ");
scanf("%s", str);
assert(str != NULL);
printf(" The input string is : %s\n", str);
return(0);
}
If the entered integer is greater than or equal to 10, The input string is not empty , The program will continue to run ; If the conditions are not met, the program terminates
Four 、 Different Linux File transfer between systems
If in Ubuntu File transfer between system and raspberry pie system
scp Command Introduction
Linux scp The command is used for Linux Copy files and directories between .
scp yes secure copy Abbreviation , scp yes linux Based on ssh Log in for secure remote file copy command .
scp It's encrypted. ,rcp It's not encrypted ,scp yes rcp The enhanced .
grammar
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[[email protected]]host1:]file1 [...] [[[email protected]]host2:]file2
example
Copy from local to remote :
scp local_file [email protected]_ip:remote_folder
perhaps
scp local_file [email protected]_ip:remote_file
perhaps
scp local_file remote_ip:remote_folder
perhaps
scp local_file remote_ip:remote_file
The first 1,2 User name specified , After the command is executed, you need to enter the password , The first 1 Only remote directories are specified , The file name does not change , The first 2 Specified file name ;
The first 3,4 No user name specified , After the command is executed, you need to enter the user name and password , The first 3 Only remote directories are specified , The file name does not change , The first 4 Specified file name ;
application ( Will raspberry pie just created .c File transfer to Ubuntu Next )
:sudo scp assert.c [email protected]:/home/xjc/ 

5、 ... and 、 reference
边栏推荐
- leetcode:152. 乘积最大子数组【考虑两个维度的dp】
- JupyterLab 常用配置
- 网络爬虫终篇:向10万级网易云用户发送定向消息
- Leetcode (122) - the best time to buy and sell stocks II
- Yolov6: the fast and accurate target detection framework is open source
- Usage of MGrid in numpy
- [fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]
- Homebrew installation in MacOS environment [email protected]
- [bug feedback] the problem of message sending time of webim online chat system
- Introduction to dependency injection in SAP Spartacus
猜你喜欢

在Flutter中解析复杂的JSON

Leetcode (763) -- dividing letter ranges

【图像处理基础】基于matlab GUI图像直方图均衡化系统【含Matlab源码 1924期】

LabVIEW Arduino tcp/ip remote smart home system (project part-5)

VB. Net class library (advanced version - 1)

Vulnhub's DC8

协同过滤进化版本NeuralCF及tensorflow2实现
![[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]](/img/8a/f5847eef7318f3db54aa2d4405b06a.jpg)
[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]

模块五作业

Application and Optimization Practice of 100 million level monthly live national karaoke feed service in Tencent cloud mongodb
随机推荐
How to create an OData service with the graphical modeler on the sap BTP platform
如何用 SAP BTP 平台上的图形建模器创建一个 OData 服务
Which securities company is the most convenient, safe and reliable for opening an account
Is there any risk in registering and opening an account for stock speculation? Is it safe?
DAST black box vulnerability scanner part 5: vulnerability scanning engine and service capability
Yolov6: un cadre de détection de cibles rapide et précis est Open Source
leetcode:6107. 不同骰子序列的数目【dp六个状态 + dfs记忆化】
中金财富开户安全吗?我想开户炒股。
[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]
Unity3D插件 AnyPortrait 2D骨骼动画制作
【混合编程jni 】第十一篇之JNA详情
Flutter 中 ValueNotifier<List<T>> 监听问题解决
这个算BUG吗?乱填的字母是否可以关闭
Is there any risk in opening a new bond registration account? Is it safe?
Which platform is the safest for buying stocks and opening accounts? Ask for sharing
About appium trample pit: encountered internal error running command: error: cannot verify the signature of (solved)
Is there any risk for flush to register and open an account? Is it safe?
网络爬虫终篇:向10万级网易云用户发送定向消息
vulnhub之dc8
Are there any risks for the top ten securities companies to register and open accounts? Is it safe?