Problem 0. Briefly and clearly report what you have done for Homework Assignment
#4.
Problem1
Sudo fdisk –l >after.txt Sudo fdisk –l >before.txt Diff after.txt before.txt
We can find it mount on /dev/sdb1
Problem2
Hostname 查看主机名字 Hostnamectl 可用于查询和更改系统主机名和相关设置
sudo hostnamectl set-hostname linuxconfig
修改文件/etc/hosts, 这样重启也依旧是更改后的名字
Problem3
Ssh 连接服务器, 我把 demo_x.c 传输上去. 然后修改成雨伞或者其他图标,display 一下就 可以了.
scp -P 11189 -r demo_x.c root@117.93.33.92:/home/data
不用登录 ssh 也可以用 scp 把 demo_x.c 传输到 117.93.33.92 的/home/data/文件夹下,用户 名为 root
gcc -o main demo_x.c -lX11 编译 修改服务器和客户端的 ssh 配置文件
xhost + //允许服务器的的 x11 界面连接过来
ssh -P 11189 -X root@117.93.33.92 //-X 参数表示转发 X11 数据 然后就可以运行程序
xclock
修改代码如下,即可显示雨伞
Problem4
the purpose of the result program. : turn the input into hexadecimal number and count how many bits of this number is 1;
problem5
make and display
the reasons for compiling warnings 1. don’t have the header file
2. don’t have correct number of arguments
Problem 1. Build 'demo_fork.c' and run it, then try to change the red eyes to 'browse.tcl' and run it again.
通过 C 代码启动 tcl?
错误 1 Gcc demo_fork.c 不能执行 a.out
解决方法:
终端中打开,成功
成功把红眼睛改为 browse.tcl'
错误 2 : bash: ./browse.tcl:/usr/bin/wish:解释器错误: 没有那个文件或目录 解决方法: apt-get install -y wish ,就可以了.
Invoke more directory browsers from browse.tcl. Use 'pstree' to see the process hierarchy for all of them,
再点击一个目录就可以了 and show the hierarchy with a screenshot.如下图
Problem 2. Run Python scripts of demo_8queen.py and demo_showqueens.py, read the source code, comments and their outputs.
输出到 8queen.out 即可
Then (OPTIONALLY) write a Perl or Python script to analyze the solutions in 8queen.out, and show how many kinds of the solutions are unique.
(symmetrical solutions are not considered as unique, for example, one solution being mirrored or rotated should be eliminated from the unique list)