\begin{document} \section*{The Wandering Star} \hspace{1em} \begin{paracol}{2} \begin{leftcolumn*} Soothsayer's lured to her star \\ Server of heaven's silent wanderers \\ Oh holy night, summon up the ghost \\ The hard of hearing always listen closest \\ The hard of hearing always listen closest \hspace{2em} Lo lo lo lo lo, lo lo and behold \\ It has been foretold lo lo lo lo long ago \\ Lo lo lo lo lo, lo lo and behold \\ I guess you never know what you never know \hspace{2em} Saturn, Jupiter confer, breaker of the wall in the morning \\ Aries, Pisces, either one \\ You will never know firsthand what day you're born on \hspace{2em} Lo lo lo lo lo, lo lo and behold \\ It has been foretold lo lo lo lo long ago \\ Lo lo lo lo lo, lo lo and behold \\ I guess you never know what you never know \hspace{2em} Wandering star\\ Wandering star\\ Wandering star\\ Wandering star \end{leftcolumn*} \switchcolumn % 右侧中文 \zhfont 被诱至她的星辰的预言家\\ 天堂的寂静漫游者的仆人\\ 哦,神圣的夜晚,召唤幽灵\\ 听力不佳的人总是最专注地倾听\\ 听力不佳的人总是最专注地倾听 \hspace{2em} 啦啦啦啦啦,啦啦看哪\\ 这早已被预言啦啦啦啦很久以前\\ 啦啦啦啦啦,啦啦看哪\\ 我猜你永远不会知道你从未知道的事情 \hspace{2em} 土星,木星交谈,清晨的墙壁破碎者\\ 白羊座,双鱼座,任何一个\\ 你永远不会亲自知道你是在哪一天出生的 \hspace{2em} 啦啦啦啦啦,啦啦看哪\\ 这早已被预言啦啦啦啦很久以前\\ 啦啦啦啦啦,啦啦看哪\\ 我猜你永远不会知道你从未知道的事情 \hspace{2em} 漫游的星星\\ 漫游的星星\\ 漫游的星星\\ 漫游的星星 \end{paracol} \end{document}
注:中文翻译来源于 GPT 翻译
The Wandering Star 中英文歌词
这里提供 The Wandering Star 中英文歌词,如果大家有更好的排版方案,可以使用如下的歌词进行排版
Soothsayer’s lured to her star Server of heaven’s silent wanderers Oh holy night, summon up the ghost The hard of hearing always listen closest The hard of hearing always listen closest
Lo lo lo lo lo, lo lo and behold It has been foretold lo lo lo lo long ago Lo lo lo lo lo, lo lo and behold I guess you never know what you never know
Saturn, Jupiter confer, breaker of the wall in the morning Aries, Pisces, either one You will never know firsthand what day you’re born on
Lo lo lo lo lo, lo lo and behold It has been foretold lo lo lo lo long ago Lo lo lo lo lo, lo lo and behold I guess you never know what you never know
Wandering star Wandering star Wandering star Wandering star
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/c2cb9645-dafc-11ed-aa26-6ec1e3b3f7b3/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996)
publicclassCalculatorDemo{ publicstaticvoidmain(String[] args){ //匿名内部类的实现方式 useCalculator(new Calculator() { @Override publicintcalc(int a, int b){ return a + b; } }); //Lambda表达式实现方式 useCalculator((int a, int b)->{ return a + b; }); useCalculator( (a,b) -> a + b ); } publicstaticvoiduseCalculator(Calculator calculator){ int result = calculator.calc(10,20); System.out.println(result); } } interfaceCalculator{ //带参数,带返回值 intcalc(int a, int b); }
我们可以看到,以上代码中,第二种 Lambda 的书写更加简练,关于省略规则请往下看
1 2 3 4 5 6 7 8
//Lambda表达式实现方式 useCalculator((int a, int b)->{ return a + b; });
-v html:/root/html :把 html 数据卷挂载到容器内的 /root/html 这个目录中
-p 8080:80:吧宿主机的 8080 端口映射到容器内的 80 端口
nginx:镜像名称
案例:给 nginx 挂载数据卷
需求:创建一个 nginx 容器,修改容器内的 html 目录内的 index.html 内容 分析:上个案例中,我们进入 nginx 容器内部,已经知道 nginx 的 html 目录所在位置 /usr/share/nginx/html ,我们需要把这个目录挂载到 html 这个数据卷上,方便操作其中的内容
0、查看容器是否在运行,并且已经提前创建好了 html 数据卷
1 2
# 检查容器是否在运行 docker ps -a
1、创建容器并挂载数据卷到容器内的 HTML 目录
1
docker run --name mn -v html:/usr/share/nginx/html -p 80:80 -d nginx
2、进入 html 数据卷所在位置,并修改 HTML 内容
1 2 3 4 5 6 7 8
# 查看html数据卷的位置 docker volume inspect html # 通过查看挂载点可知如下目录,进入该目录 cd /var/lib/docker/volumes/html/_data # 查看目录下有哪些文件 ls # 修改文件,此处可通过FinalShell使用本地的高级编辑工具来打开编辑 vi index.html
3、在做数据卷挂在时,如果要创建数据卷不存在,docker 会为我们自动创建数据卷
比如在我们使用如下命令前,docker 中是没有 html 数据卷的,一样可以正常使用如下命令,因为 docker 会为我们自动创建 html 数据卷
1
docker run --name mn -v html:/usr/share/nginx/html -p 80:80 -d nginx
[root@localhost docker-demo]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE javaweb 1.0 c94aff541e94 42 seconds ago 722MB nginx latest 605c77e624dd 12 months ago 141MB redis latest 7614ae9453d1 12 months ago 113MB ubuntu 16.04 b6f507652425 16 months ago 135MB mysql 5.7.25 98455b9624a9 3 years ago 372MB
5、将 cloud-demo 上传至虚拟机 (tmp 目录),利用 docker-compose up -d 来部署
1 2 3 4 5 6 7
cd / cd /tmp/
//上传cloud-demo文件夹
cd cloud-demo/ docker-compose up -d
up:表示创建并执行容器
down:停止并删除容器
其他命令可以通过 help 命令查看
6、查看打包好的镜像和运行的容器
1 2
docker images docker ps
1 2 3 4 5 6 7 8 9 10 11 12
[root@localhost cloud-demo]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE cloud-demo_gateway latest 3ce691e26939 About a minute ago 185MB cloud-demo_orderservice latest b81195944331 About a minute ago 187MB cloud-demo_userservice latest 2dc6d8c88bdc About a minute ago 184MB javaweb 1.0 c94aff541e94 3 hours ago 722MB nginx latest 605c77e624dd 12 months ago 141MB redis latest 7614ae9453d1 12 months ago 113MB ubuntu 16.04 b6f507652425 16 months ago 135MB nacos/nacos-server latest bdf60dc2ada3 17 months ago 1.05GB mysql 5.7.25 98455b9624a9 3 years ago 372MB java 8-alpine 3fd9dd82815c 5 years ago 145MB