20175327 "Information Security System Design Basics," the first week of learning summary

20175327 "Information Security System Design Basics," the first week of learning summary

Learning content summary

Familiar development environment under Linux

  • Why was Linux
    • Linux is an operating system, that is, the system calls and kernel that two
  • Linux command
    • command [options] [arguments]acting on the different command arguments, options distinction instruction
  • man command
    • man -kIt can be combined with grepmulti-keyword search
    • Equivalent commandapropos
    • man -f cmdView command of the basic functions, equivalent towhatis
  • cheat command
  • hot key
    • ctrl+cEnd program In
      Ctrl+da keyboard input or exit end terminal
      Ctrl+stentative current program, press any key to resume operation after a pause
      Ctrl+zthe current program running in the background, the command to return to the foreground fg
      Ctrl+amove the cursor to the first input line, is equivalent to the Home key
      Ctrl+eto move the cursor to the end of the input line, corresponding to the end key
      Ctrl+kto delete the line from the end of the cursor position
      Alt+Backspaceforward delete a word in
      Shift+PgUpthe terminal display scrolls up
      Shift+PgDnthe displays scroll down terminal
  • Shell used a wildcard
    • *Match zero or more characters
      ?match any one character
      [list]of any single character match list of
      [!list]matching characters other than any single character in the list of
      [c1-c2]any single character matches the c1-c2 as: [0-9] [az]
      {string1,string2,...}matches or sring1 string2 (or more) one string
      {c2..c2}matches all characters c1-c2 as in {1..10}
  • who am iView user command
    • who commands other commonly used parameters
      -aPrint can print all
      -dprint dead processes
      -mwith am i, mom likes
      -qto print the number of users currently logged on user name and
      -uprint the currently logged on user login information
      -rprint run level
  • su <user>Switch to the user user, su<cmd>to run the cmd command privilege level, su - <user>switch users while switching environment variables will follow
  • groups <user>Command that the user belongs to which group
  • usermodCommand for the user to add user groups, deluerdelete users
  • ls -lCheck the file permissions
  • cdCommand to switch directories: .the current directory, ..represent the parent directory, -a directory on said generally indicates the current user's "home" directory. Use pwdcommand to obtain the current location path (absolute path)
  • mkdir(make directories)Command creates an empty directory, create a directory can also be specified privilege attributes, and -pparameters, and create parent directory
  • cp(copy)Command to copy a file or directory to the specified directory, copy the directory additional parameters-r
  • Use rmthe command to delete a file or directory, delete the directory additional parameters-r
  • Use mvcommand, move file (shear),
    rename file, rename batch, to achieve the rename
  • Use cat, tacand the nlcommand to view files catfor the positive sequence display, tacreverse the display, nlcommand, add line numbers and print
  • Use moreand lesscommand tab to view the file, the default display only one screen contents opens, displaying the progress of the current reading (percentage) at the bottom end. You can use Enterthe key to scroll down one line, use the Spacekeys to scroll down a screen, press the hdisplay help, qquit
  • Use headand tailcommand to view the files, only to see the first few lines (the default is 10 lines, all less than 10 lines are displayed) and the end of a few lines, you can also add -n parameter, followed by the number of rows
  • fileCommand to view the type of file
  • declareCommand to create variables
  • Environment variables related commands: setdisplay all current Shell environment variables, including its built-in environment variables (related to Shell appearance, etc.), user-defined variables and export environment variables
    envdisplay environment variables associated with the current user, you can also make the specified command running in the environment
    exportdisplay derived from Shell environment variable to the variable, it can also be exported as environment variables custom variables
  • Variables Review: ${变量名#匹配字串}scratch backward match began, delete data in line with the shortest match string
    ${变量名##匹配字串}from scratch backward match began, delete data in line with the longest matching string of
    ${变量名%匹配字串}forward start from the tail match, delete data in line with the shortest match of the string
    ${变量名%%匹配字串}from the tail to before the start of matches, the longest match string data is deleted in line with
    ${变量名/旧的字串/新的字串}the first string in line with the old string is replaced with a new string
    ${变量名//旧的字串/新的字串}will comply with all the old string strings replaced with a new string
  • Linux file compression formats: *.zipZIP packaged compressed files
    *.rarrar program compressed file
    *.7z7zip program compressed files
    *.tartar packaged, uncompressed file
    *.gzthe gzip (GNU zip) compressed files
    *.xzxz program compressed files
    *.bz2bzip2 program compressed file
    *.tar.gztar package , gzip file compression program
    *.tar.xztar package, xz compressed program files
  • zipCompression packing procedure, zip -r -q -o shiyanlou.zip /home/shiyanlou-r parameter represents the recursive package contains the entire contents of subdirectories, -q parameter represents the quiet mode, which does not output information, -o to the screen, represents the output file, to be followed later in the package output file name. Use the du command to view the file size back pack, -e parameter to create an encrypted archive, -lparameter conversion formats to make them open without problems under Windows
  • unzipCommand unzip the zip file, -drepresents the path (does not exist will be created automatically), -lnot only extract the archive to view the content, -ospecify the encoding type
  • rarCompression packing command, rar a shiyanlou.rarcompressed files (using aparameter to add a directory ~ to an archive file, if the file does not exist it will be created automatically), rar d shiyanlou.rar .zshrcdelete a file from the specified archive file, rar l shiyanlou.rarview does not extract the files, unrar x shiyanlou.rarfull path decompression, unrar e shiyanlou.rar tmp/remove decompression path
  • tarPackaging tool, tar -cf shiyanlou.tar ~create a tar package, -cit represents the creation of a tar package file, -fused to specify the file name created, the file name must note immediately -fafter the parameters, -vthe parameters in a visual way output of packed files. The above will be automatically removed indicates an absolute path /, you can also use the -Preserved symbol absolute path, unpack a file ( -xparameter) to specify the path of an existing directory ( -Cparameters) to see only puzzling package file -tparameters
  • dfCommand to view disk capacity, plus -hconverted into a form able to read
  • duCommand to view the capacity -dparameter specifies the directory to see the depth (grade 0 ~ ~ 1 directory)
  • ddCommand is used to copy files and converting, bs(block size)to specify the block size (Default is Byte, may be assigned as 'K', 'M', 'G' units, etc.), countis used to specify the number of blocks
  • bs(block size)Is used to specify the block size (Default is Byte, may be assigned as 'K', 'M', 'G', and other units), count specifies the number of blocks
  • dd Command to create a virtual image file, dd if=/dev/zero of=virtual.img bs=1M count=256
  • mkfsCommand to format the disk, the command sudo mkfs.ext4 virtual.imgis formatted as ext4 file system
  • sudo mountView Host already mounted file system, the command format mount [options] [source] [directory], common operations mount [-o [操作选项]] [-t 文件系统类型] [-w|--rw|--ro] [文件系统源] [挂载点], umountcommand unload the mounted disksudo umount /mnt
  • fdiskPartitioning the disk, view the hard disk partition table information sudo fdisk -l, enter partition modesudo fdisk virtual.img
  • With a typeview, built-in command to
    xxx is a shell builtin
    the external command
    xxx is /usr/sbin/xxx
    command is the name of the alias command set
    xxx is an alias for xx --xxx
  • helpBuiltin command can only help information for display. It has a substantially external command parameters --helpso that it can help to give the corresponding
  • manNo built-in and external commands distinction
  • cutCommand, print a field of each line
  • grepCommand, find the matching string in the format in the text or in stdingrep [命令选项]... 用于匹配的表达式 [文件]...
  • wcCommand, simple little tool count
  • sortSort command
  • uniqTo re-order
  • trCommand can be used to delete some text in a text message
  • Use teecommand while redirected to a plurality of files, except that the addition to the need to redirect the output files need to print the information terminal
  • Permanent redirect, use the execcommand
  • Using a set / dev / null complete shielding mask command output command output

2. familiar with the basic operation of vi

Reference: https://blog.csdn.net/xie_xiansheng/article/details/78413306

3. be familiar with the basic principles of gcc compiler

Process GCC compiler program: source files (* .c) -> pretreatment (pre-processor) -> compiler (Compiler) -> Assembler (assembler) -> Link (Linker) -> executables
Consider a simple hello.c source file, i.e., the output code is a helloworld. To show through several different steps gcc compiler process:
The first step: ~ gcc -E hello.c -o hello.i This is about the source file preprocessor, which is mainly a number of macro substitution, not will check syntax, -E parameter allows the compilation process to stop gcc back at the end of the pretreatment.
Step two: ~ gcc -c hello.i -o hello.o This step does some syntax checking, .i file compiled into object files.
The third step: ~ gcc hello.o -o hello The third step is the final step, the target link to an executable file, the last hello is custom build the executable file name.
Modular GCC compiler program: Code: ~ gcc denpend.c hello.c -o hello

4. familiar with common gcc compiler options

Reference: https://blog.csdn.net/arackethis/article/details/43370307

The skilled use gdb debugger technology

1) Start GDB
GDB or Hello Hello gdbfile
2) display the program
list, or L
. 3) break point
break (b) main () // function entrance
break (b) 11 // line number
break (b) hello.c : 14 // specific file line number
after the break (b) 12 if i = 10 // if statement satisfies the break point at line number
4) acquires information of the breakpoint
info BREAK
. 5) remove the breakpoint
delete 13 (No break )
6) run a program
rUN (R & lt)
. 7) to step (not enter Functions)
Next (n-)
. 8) to step (entering subroutine)
sTEP (S)
. 9) and continue the
continue (C)
10) See variable
print ( p) i (variable name)
11) run the program to the end of the current function
Finish
12 is) monitoring variables
watch i (variable name)
13) exits GDB
quit (Q)

6. makefile familiar with the basic principles and Syntax Specification


7. grasp generation and invoke methods of static and dynamic libraries

Reference: https://blog.csdn.net/hua12134/article/details/88381929

8. Almost appreciated C program simulation module, the principle of the modular decomposition "high cohesion, low coupling"

高内聚:
如果类中的方法是一组相关的行为,则称该类是高内聚的,反之成为低内聚的。
高内聚便于类的维护,而低内聚不利于类的维护。
迭代器模式中,对于高内聚低耦合原则的使用会有很好的解释。
低耦合:
就是尽量不要让一个类有太多其他类的实例引用,以避免修改系统的其中一部分会影响到其他部分,
中介者模式中,就会体会到这个低耦合原则的必要性。

9.了解链接的概念

参考:https://blog.csdn.net/u011857683/article/details/81044856

教材学习中的问题和解决过程

xxx
xxx

代码调试中的问题和解决过程

xxx
xxx

课后作业中的问题和解决过程

XXX
XXX

本周代码托管截图

其他(感悟、思考等,可选)

xxx
xxx

Guess you like

Origin www.cnblogs.com/hollfull/p/12051304.html