当前位置:网站首页>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
边栏推荐
- 打新债注册开户有没有什么风险?安全吗?
- Introduction of classic wide & deep model and implementation of tensorflow 2 code
- 在哪个平台买股票开户最安全?求分享
- Detailed explanation of nmap parameters
- Is it safe to buy stocks and open accounts through the account QR code of the CICC securities manager? Want to open an account for stock trading
- LabVIEW Arduino TCP/IP远程智能家居系统(项目篇—5)
- random_ normal_ Initializer uses
- [fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]
- VB. Net class library to obtain the color under the mouse in the screen (Advanced - 3)
- Unity3D插件 AnyPortrait 2D骨骼动画制作
猜你喜欢
![leetcode:141. Circular linked list [hash table + speed pointer]](/img/19/f918f2cff9f831d4bbc411fe1b9776.png)
leetcode:141. Circular linked list [hash table + speed pointer]

WP collection plug-in tutorial no thanks for WordPress collection of rules

The latest 2022 research review of "continuous learning, CL"

YOLOv6:又快又准的目標檢測框架開源啦

Introduction of classic wide & deep model and implementation of tensorflow 2 code

WordPress collection plug-ins are recommended to be free collection plug-ins

Briefly describe the model animation function of unity

MATLAB与Mysql数据库连接并数据交换(基于ODBC)

Implementation of collaborative filtering evolution version neuralcf and tensorflow2

Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)
随机推荐
The sharp sword of API management -- eolink
[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]
leetcode:152. 乘积最大子数组【考虑两个维度的dp】
Different subsequence problems I
用C#通过sql语句操作Sqlserver数据库教程
如何写好测试用例以及go单元测试工具testify简单介绍
模块五作业
Netease Yunxin officially joined the smart hospital branch of China Medical Equipment Association to accelerate the construction of smart hospitals across the country
Weaving dream collection plug-ins are recommended to be free collection plug-ins
Is there any risk in registering and opening an account for stock speculation? Is it safe?
【BUG反馈】WebIM在线聊天系统发消息时间问题
Is it safe to open a stock account with the QR code given by the CICC securities manager? I want to open an account
Homebrew installation in MacOS environment [email protected]
线性模型LN、单神经网络SNN、深度神经网络DNN与CNN测试对比
Pass note 【 dynamic planning 】
Which platform is the safest for buying stocks and opening accounts? Ask for sharing
Système de distribution Unity Composants en tissu (y compris les dépendances d'appel dynamique)
WP collection plug-in tutorial no thanks for WordPress collection of rules
vulnhub之DC9
leetcode:710. Random numbers in the blacklist [mapping thinking]