继开 | 博客

热爱生活,努力学习,实现自己的价值


  • 短诗的序

  • 迷途自渡

  • 寒星三两

  • 林深见鹿

  • 记昨日书

  • 顾探往昔

Python 使用Python命令在pdf中增加代码

发表于 2023-07-29
字数统计: 536 字 | 阅读时长 ≈ 2 min

注意:本文仅供学习和研究网络安全技术。反对一切危害网络安全的行为。造成法律后果自行负责。

安装

1
pip install PyPDF2

若使用anconda则提前建好环境在执行,安装,防止python 相关模块冲突

1
conda create -n pdf python=3.7
1
activate pdf

使用

生成pdf

利用python创建一个含有XSS的PDF文件。
python 代码如下

1
2
3
4
5
6
7
8
9
10
from PyPDF2 import PdfReader, PdfWriter
# 创建一个新的 PDF 文档
output_pdf = PdfWriter()
# 添加一个新页面
page = output_pdf.add_blank_page(width=72, height=72)
# 添加js代码
output_pdf.add_js("app.alert('欢迎关注微信公众号 程序员实用技术分享');")
# 将新页面写入到新 PDF 文档中
with open("test_xss.pdf", "wb") as f:
output_pdf.write(f)

接着,将上诉代码保存为py文件。并运行。
会生成一个test_xss.pdf的文件。

和正常PDF绑定

可以利用Word等工具生成一个常见的PDF文件。利用下面代码进行写入

1
2
3
4
5
6
7
8
9
10
11
12
13
from PyPDF2 import PdfReader, PdfWriter
# 打开原始 testold.PDF 文件
input_pdf = PdfReader("testold.pdf")
# 创建一个新的 PDF 文档
output_pdf = PdfWriter()
# 将现有的 PDF 页面复制到新文档
for i in range(len(input_pdf.pages)):
output_pdf.add_page(input_pdf.pages[i])
# 添加 JavaScript 代码
output_pdf.add_js("app.alert('欢迎关注微信公众号 程序员实用技术分享');")
# 将新 PDF 文档写入到文件中
with open("test_xss2.pdf", "wb") as f:
output_pdf.write(f)

接着,将上诉代码保存为py文件。并运行。
会生成一个test_xss.pdf的文件。

验证

方法1:可以直接使用浏览器大可,则可以弹出相关提示

方法2:将其放到web服务器根目录,或者通过上传的形式上传到服务器。然后访问web服务下的该文件。http://127.0.0.1:8080/test_xss.pdf

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

Python 使用Python命令下载b站视频

发表于 2023-07-23
字数统计: 788 字 | 阅读时长 ≈ 4 min

注意:本文仅供学习和研究网络安全技术。反对一切危害网络安全的行为。造成法律后果自行负责。

安装

1
pip install you-get

若使用anconda则提前建好环境在执行,安装,防止python 相关模块冲突

1
conda create -n youget python=3.7
1
activate youget

使用

浏览器访问 b站找到需要下载的视频链接
直接复制,使用命令you-get 加视频地址下载

1
2
you-get https://www.bilibili.com/video/BV1hX4y1E73R/?spm_id_from=333.1007.tianma.1-3-3.click
```

(youget) C:\you-get>you-get https://www.bilibili.com/video/BV1hX4y1E73R/?spm_id_from=333.1007.tianma.1-3-3.click
site: Bilibili
title: 年轻人的第一台4060整机!3199!RTX4060+16G+512G+5500!开启2K光追游戏时代!
stream:
- format: flv360
container: flv
quality: 流畅 360P
size: 6.8 MiB (7102622 bytes)
# download-with: you-get –format=flv360 [URL]

Downloading 年轻人的第一台4060整机!3199!RTX4060-16G-512G-5500!开启2K光追游戏时代!.flv

```

其他视频网站支持

Site URL Videos? Images? Audios?
YouTube https://www.youtube.com/ ✓
Twitter https://twitter.com/ ✓ ✓
VK http://vk.com/ ✓ ✓
Vine https://vine.co/ ✓
Vimeo https://vimeo.com/ ✓
Veoh http://www.veoh.com/ ✓
Tumblr https://www.tumblr.com/ ✓ ✓ ✓
TED http://www.ted.com/ ✓
SoundCloud https://soundcloud.com/ ✓
SHOWROOM https://www.showroom-live.com/ ✓
Pinterest https://www.pinterest.com/ ✓
MTV81 http://www.mtv81.com/ ✓
Mixcloud https://www.mixcloud.com/ ✓
Metacafe http://www.metacafe.com/ ✓
Magisto http://www.magisto.com/ ✓
Khan Academy https://www.khanacademy.org/ ✓
Internet Archive https://archive.org/ ✓
Instagram https://instagram.com/ ✓ ✓
InfoQ http://www.infoq.com/presentations/ ✓
Imgur http://imgur.com/ ✓
Heavy Music Archive http://www.heavy-music.ru/ ✓
Freesound http://www.freesound.org/ ✓
Flickr https://www.flickr.com/ ✓ ✓
FC2 Video http://video.fc2.com/ ✓
Facebook https://www.facebook.com/ ✓
eHow http://www.ehow.com/ ✓
Dailymotion http://www.dailymotion.com/ ✓
Coub http://coub.com/ ✓
CBS http://www.cbs.com/ ✓
Bandcamp http://bandcamp.com/ ✓
AliveThai http://alive.in.th/ ✓
interest.me http://ch.interest.me/tvn ✓
ナナゴーゴー http://7gogo.jp/ ✓ ✓
ニコニコ動画 http://www.nicovideo.jp/ ✓
163网易视频,网易云音乐 http://v.163.com/
http://music.163.com/
✓ ✓
56网 http://www.56.com/ ✓
AcFun http://www.acfun.cn/ ✓
Baidu,百度贴吧 http://tieba.baidu.com/ ✓ ✓
爆米花网 http://www.baomihua.com/ ✓
bilibili,哔哩哔哩 http://www.bilibili.com/ ✓ ✓ ✓
豆瓣 http://www.douban.com/ ✓ ✓
斗鱼 http://www.douyutv.com/ ✓
凤凰视频 http://v.ifeng.com/ ✓
风行网 http://www.fun.tv/ ✓
iQIYI,爱奇艺 http://www.iqiyi.com/ ✓
激动网 http://www.joy.cn/ ✓
酷6网 http://www.ku6.com/ ✓
酷狗音乐 http://www.kugou.com/ ✓
酷我音乐 http://www.kuwo.cn/ ✓
乐视网 http://www.le.com/ ✓
荔枝FM http://www.lizhi.fm/ ✓
懒人听书 http://www.lrts.me/ ✓
秒拍 http://www.miaopai.com/ ✓
MioMio弹幕网 http://www.miomio.tv/ ✓
MissEvan
猫耳FM
http://www.missevan.com/ ✓
痞客邦 https://www.pixnet.net/ ✓
PPTV聚力 http://www.pptv.com/ ✓
齐鲁网 http://v.iqilu.com/ ✓
QQ,腾讯视频 http://v.qq.com/ ✓
企鹅直播 http://live.qq.com/ ✓
Sina,新浪视频,微博秒拍视频 http://video.sina.com.cn/
http://video.weibo.com/
✓
Sohu,搜狐视频 http://tv.sohu.com/ ✓
Tudou,土豆 http://www.tudou.com/ ✓
阳光卫视 http://www.isuntv.com/ ✓
Youku,优酷 http://www.youku.com/ ✓
战旗TV http://www.zhanqi.tv/lives ✓
央视网 http://www.cntv.cn/ ✓
Naver,네이버 http://tvcast.naver.com/ ✓
芒果TV http://www.mgtv.com/ ✓
火猫TV http://www.huomao.com/ ✓
阳光宽频网 http://www.365yg.com/ ✓
西瓜视频 https://www.ixigua.com/ ✓
新片场 https://www.xinpianchang.com/ ✓
快手 https://www.kuaishou.com/ ✓ ✓
抖音 https://www.douyin.com/ ✓
TikTok https://www.tiktok.com/ ✓
中国体育(TV) http://v.zhibo.tv/
http://video.zhibo.tv/
✓
知乎 https://www.zhihu.com/ ✓

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

Docker Docker-compose搭建Uptime Kuma监控网站是否正常运行

发表于 2023-07-22
字数统计: 302 字 | 阅读时长 ≈ 1 min

Uptime Kuma 是什么

Uptime Kuma 是一个易于使用的自托管的监控工具

Uptime Kuma 搭建

uptimekuma.yml 文件如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
# 1.新建文件夹 uptimekuma 和 子目录
# mkdir -p /data/uptimekuma/{uptime-kuma,logs}
# 2.进入 uptimekuma 目录
# cd /data/uptimekuma
# 3.将 uptimekuma.yml 放入当前目录
# 4.启动
# docker-compose -f uptimekuma.yml up -d

version: '3'
services:
uptimekuma:
image: louislam/uptime-kuma:1
container_name: uptimekuma
restart: unless-stopped
ports:
- 13001:3001
volumes:
- ./uptime-kuma:/app/data

按照uptimekuma.yml 内的步骤逐步执行

Uptime Kuma.md 使用

浏览器访问:http://ip:3001/

注册账号,然后登录, 有中文,所以非常方便的按照说明增加监控

其他问题解决

部分浏览器兼容性不好,可能打不开,也可能新建不了分类,可尝试更换浏览器操作

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

Centos7 忘记Root密码如何操作

发表于 2023-07-02
字数统计: 275 字 | 阅读时长 ≈ 1 min

centos7 忘记root密码如何操作

在Linux运维过程中难免遇到忘记root超级管理员密码的问题

CentOS 7重置root密码

1)启动系统,在启动菜单

1
2
Cent0S Linux (3.1.-957.el7.x86 64) 7 (Core)
CentOS Linux (0-rescue-5e121dcgfe9e44e983f23f51f337a8fc) 7(Core)

2)选中第一行,按 e 字母键进入 编辑菜单

3)定位到linux16 行,在行尾追加参数: init=/bin/sh

1
linux16 /ymlinuz-3.10.0-g57.el7.x86 64 root=/dev/mapper/centos-root rocrashkerneleauto rd.luv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en US.UTF-8  init=/bin/sh

4)按下ctrl+x启动系统,进入switch_root模式

5)在重启系统后输入 mount -o remount, rw /

1
mount -o remount, rw /
1
2
sh-4.2# mount -o remount, rw
sh-4.2#

6)修改root密码,无需输入原root密码,直接修改掉。

1
passwd root

7)自动重置/etc/passwd SELinux文件上下文

1
touch /.autorclabcl

8)exit退出shell

1
exec /sbin/init

注意:最后一定要等待系统自动重启完成,此过程要耐心点。一定要让系统自动重启完成,千万不要关闭系统或者硬重启。

Docker 快捷搭建万能文件在线预览kkFileView

发表于 2023-07-01
字数统计: 541 字 | 阅读时长 ≈ 3 min

概述

kkFileView,一款成熟且开源的文件文档在线预览项目解决方案

官网及文档
地址:https://kkfileview.keking.cn

搭建

docker直接启动

1
docker run -it -p 8012:8012 keking/kkfileview:4.1.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 [root@localhost ~]# docker run -it -p 8012:8012 keking/kkfileview:4.1.0


_ _ ______ _ _ __ __ _
| | | | | ____| (_) | | \ \ / / (_)
| | __ | | __ | |__ _ | | ___ \ \ / / _ ___ __ __
| |/ / | |/ / | __| | | | | / _ \ \ \/ / | | / _ \ \ \ /\ / /
| < | < | | | | | | | __/ \ / | | | __/ \ V V /
|_|\_\ |_|\_\ |_| |_| |_| \___| \/ |_| \___| \_/\_/

=> Spring Boot :: 2.4.2
=> kkFileView :: 4.1.0
=> Home site :: https://kkfileview.keking.cn
=> Github :: https://github.com/kekingcn/kkFileView
=> Gitee :: https://gitee.com/kekingcn/file-online-preview
=> kk opensource community :: https://t.zsxq.com/09ZHSXbsQ

2023-07-01 07:43:24.905 INFO 1 --- [ main] org.eclipse.jetty.util.log : Logging initialized @2408ms to org.eclipse.jetty.util.log.Slf4jLog

...
...
...

2023-07-01 07:43:28.744 INFO 1 --- [ main] cn.keking.ServerMain : kkFileView 服务启动完成,耗时:5.903266556s,演示页请访问: http://127.0.0.1:8012

docker-compose 启动

kkfileview.yml 文件如下

1
2
3
4
5
6
7
8
9
10
11
#docker network create --subnet=172.100.0.0/16 kingmed-net
#docker-compose -f kkfileview.yml up -d
#kkfileview.yml 配置文件如下
version: "3"
services:
kkfileview:
image: keking/kkfileview:4.1.0
ports:
- "8012:8012"
restart: always
container_name: kkfileview

启动命令

1
docker-compose -f kkfileview.yml up -d

使用

当您的项目内需要预览文件时,只需要调用浏览器打开本项目的预览接口,并传入须要预览文件的url,示例如下:

1
2
3
4
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"></script>

var url = 'http://127.0.0.1:8080/file/test.txt'; //要预览文件的访问地址
window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(previewUrl)));

2.x.x 及以下版本

1
2
var url = 'http://127.0.0.1:8080/file/test.txt'; //要预览文件的访问地址
window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(previewUrl));

更多使用说明参照:https://kkfileview.keking.cn/zh-cn/docs/usage.html

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

Linux Ubuntu上有意思的linux命令

发表于 2023-06-18
字数统计: 810 字 | 阅读时长 ≈ 4 min

环境

使用的是ubuntu22

1
2
root@ ubuntu22:/# uname -a 
Linux ubuntu22 5.19.0-32-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

命令1:sl

安装

1
apt install sl

执行

1
sl

效果

终端输入sl,就会有一辆小火车跑过来啦

命令2:cowsay

安装

1
apt install cowsay

执行

1
cowsay hello Linux

效果

终端执行cowsay hello Linux就会打印一个牛和hello Linux

1
2
3
4
5
6
7
8
9
root@ubuntu22:/# cowsay hello Linux
_____________
< hello Linux >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

命令3:boxes

安装

1
apt install boxes

执行

1
echo "Hello  Linux" | boxes -d cat

效果

可以打印猫的头像,注意其实前面”Hello Linux”是它输出的话,后面boxes -d cat才是打印猫.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@ ubuntu22:/# echo "Hello  Linux" | boxes -d cat
/\ /\
|`\\_,--="=--,_//`|
\ ." :'. .': ". /
==) _ : ' : _ (==
|>/O\ _ /O\<|
| \-"~` _ `~"-/ | jgs
>|`===. \_/ .===`|<
.-"-. \===' | '===/ .-"-.
.---{'. '`}---\, .-'-. ,/---{.'. '}---.
) `"---"` `~-===-~` `"---"` (
( Hello Linux )
) (
'---------------------------------------'

命令4:linuxlogo

安装

1
apt install linuxlogo

执行

1
linux_logo

效果

可以打印Linux的logo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
root@ ubuntu22:/etc/apt# linux_logo


.-.
.-'``(|||)
,`\ \ `-`. 88 88
/ \ '``-. ` 88 88
.-. , `___: 88 88 88,888, 88 88 ,88888, 88888 88 88
(:::) : ___ 88 88 88 88 88 88 88 88 88 88 88
`-` ` , : 88 88 88 88 88 88 88 88 88 88 88
\ / ,..-` , 88 88 88 88 88 88 88 88 88 88 88
`./ / .-.` '88888' '88888' '88888' 88 88 '8888 '88888'
`-..-( )
`-`


Linux Version 5.19.0-32-generic, Compiled #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2
One 2.21GHz Intel i7 Processor, 2GB RAM, 4416.00 Bogomips Total
ubuntu22

命令5:elinks

安装

1
apt install elinks -y

执行

1
elinks www.baidu.com

效果

执行elinks www.baidu.com 就可以百度的网页了,就是终端上网用的

命令6:bc

安装

1
apt install bc

执行

1
bc

效果

这是一个计算器,直接在终端输入bc,然后输入要计算的结果,计算除法只会得出整数结果,没有余数。
quit 进行退出

1
2
3
4
5
6
7
root@ ubuntu22:/etc/apt# bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
34*4
136

命令7:history

安装

1
apt install history

执行

1
history

效果

这个命令可以查看你以前所输入的命令,这里最多显示300个

1
2
3
4
5
6
root@ ubuntu22:/etc/apt# history
1 docker ps
2 cd /
3 ll
4 apt install sl
5 sl

命令8:fortune

安装

1
apt install fortune -y

执行

1
fortune

效果

输出一句英文名言,有笑话,诗词等

1
2
root@ ubuntu22:/etc/apt# fortune
You will be awarded the Nobel Peace Prize... posthumously.

命令9:cmatrix

安装

1
apt install cmatrix

执行

1
cmatrix

效果

生成非常酷炫的黑客代码雨

命令10: toilet

安装

1
apt install toilet

执行

1
toilet hello

效果

是艺术字

1
2
3
4
5
6
7
root@ ubuntu22:/etc/apt# toilet hello

# ""# ""#
# mm mmm # # mmm
#" # #" # # # #" "#
# # #"""" # # # #
# # "#mm" "mm "mm "#m#"

命令11:oneko

安装

1
apt install oneko

执行

1
oneko

效果

终端输入 oneko
桌面上出现一只喵喵人,它会跟着你的鼠标跑
按 ctrl+c 结束

仅在桌面模式下生效

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

Docker-compose限制CPU和内存

发表于 2023-06-17
字数统计: 478 字 | 阅读时长 ≈ 2 min

原因

使用docker的过程中, CPU和内存经常占满,导致其它服务都不能正常使用。

内存和CPU限制

yml文件添加 service.deploy内容如下:

1
2
3
4
5
6
7
deploy:
resources:
limits:
cpus: "2.00"
memory: 5G
reservations:
memory: 200M

注意:reservations中不支持cpus,仅支持内存。

以nginx为例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
version: '3.7'
services:
nginxtest:
image: nginx:1.9.0
container_name: nginxtest
ports:
- "10080:80"
deploy:
resources:
limits:
cpus: "2.00"
memory: 5G
reservations:
memory: 200M
volumes:
- /data/kingmed-nginx/html:/usr/share/nginx/html
- /data/kingmed-nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- /data/kingmed-nginx/conf.d:/etc/nginx/conf.d
- /data/kingmed-nginx/logs:/var/log/nginx
restart: always

启动容器

限制指令为deploy.resources.limits这部分,注意节点位置,
上面这部分限制的含义是:nginx服务的CPU使用被限制在最多200%的CPU能力,内存使用被限制在最多5GB。
同时,这个服务至少需要200MB的内存。

启动的时候命令需要发生一些变化,否则不会生效:

原本的启动命令为

1
docker-compse up -d

需要添加一个参数–compatibility表示以兼容模式来运行

1
docker-compose --compatibility up -d

这里的关键在于添加–compatibility参数以兼容模式来运行,否则限制不会生效。

验证

通过上述方法限制容器CPU和内存后,可以使用命令:docker stats查看容器资源使用情况.

总结

docker-compose.yml限制内存需要添加deploy.resources.limits节点

docker-compose命令启动的时候需要添加–compatibility参数以兼容模式来运行,否则限制不会生效

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

Docker 在Docker中快速使用各个版本(从10g到23c)的Oracle数据库

发表于 2023-06-04
字数统计: 1,120 字 | 阅读时长 ≈ 6 min

各个版本的Oracle数据库环境,下载地址如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# oracle
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle23cfree:1.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle21c_ee_db_21.3.0.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle19clhr_asm_db_12.2.0.3:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle18clhr_rpm_db_12.2.0.2:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_12cr2_ee_lhr_12.2.0.1:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_12cr1_ee_lhr_12.1.0.2:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_10g_ee_lhr_10.2.0.5:2.0 &
nohup docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_10g_ee_lhr_10.2.0.1:2.0 &


# 23c免费开发者版本
docker run -itd --name lhroracle23c -h lhroel87 \
-p 1530:1521 -p 38389:3389 \
-v /sys/fs/cgroup:/sys/fs/cgroup \
--privileged=true lhrbest/oracle23cfree:1.0 \
/usr/sbin/init

docker exec -it lhroel87 bash



# 21c 二进制安装
docker run -d --name lhroracle21c -h lhroracle21c \
-p 5510:5500 -p 55100:5501 -p 1530:1521 -p 3400:3389 \
-v /sys/fs/cgroup:/sys/fs/cgroup \
--privileged=true lhrbest/oracle21c_ee_db_21.3.0.0 \
/usr/sbin/init



# 19c ASM
docker run -itd -h lhr2019ocpasm --name lhr2019ocpasm \
-p 1555:1521 -p 5555:5500 -p 55550:5501 -p 555:22 -p 3400:3389 \
--privileged=true \
lhrbest/oracle19clhr_asm_db_12.2.0.3:2.0 init

# 对于ASM,① ASM磁盘脚本:/etc/initASMDISK.sh,请确保脚本/etc/initASMDISK.sh中的内容都可以正常执行
# ② 需要在宿主机上安装以下软件
yum install -y kmod-oracleasm
wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
rpm -ivh *.rpm

systemctl enable oracleasm.service
oracleasm init
oracleasm status



# 19c rpm方式安装
docker run -itd -h lhrora19c --name lhrora19c \
-p 1529:1521 -p 5509:5500 -p 55090:5501 -p 229:22 -p 3399:3389 \
--privileged=true \
lhrbest/oracle19clhr_rpm_db_12.2.0.3:2.0 init

# 18c rpm方式安装
docker run -itd -h lhrora18c --name lhrora18c \
-p 1528:1521 -p 5508:5500 -p 55080:5501 -p 228:22 -p 3398:3389 \
--privileged=true \
lhrbest/oracle18clhr_rpm_db_12.2.0.2:2.0 init

# 12.2.0.1 二进制安装
docker run -itd --name lhrora1221 -h lhrora1221 \
-p 1526:1521 -p 5526:5500 -p 55260:5501 -p 226:22 -p 3396:3389 \
--privileged=true \
lhrbest/oracle_12cr2_ee_lhr_12.2.0.1:2.0 init

# 12.1.0.2 二进制安装
docker run -itd --name lhrora1212 -h lhrora1212 \
-p 1525:1521 -p 5525:5500 -p 55250:5501 -p 225:22 -p 3395:3389 \
--privileged=true \
lhrbest/oracle_12cr1_ee_lhr_12.1.0.2:2.0 init

# 11.2.0.4 二进制安装
docker run -itd --name lhrora11204 -h lhrora11204 -p 3394:3389 \
-p 1524:1521 -p 1124:1158 -p 224:22 \
--privileged=true \
lhrbest/oracle_11g_ee_lhr_11.2.0.4:2.0 init

# 11.2.0.3 二进制安装
docker run -itd --name lhrora11203 -h lhrora11203 -p 3393:3389 \
-p 1523:1521 -p 1123:1158 -p 223:22 \
--privileged=true \
lhrbest/oracle_11g_ee_lhr_11.2.0.3:2.0 init

# 10.2.0.5 二进制安装,-h参数不能变
docker run -itd --name lhrora10205 -h lhrora10g -p 3380:3389 \
-p 1512:1521 -p 212:22 \
--privileged=true \
lhrbest/oracle_10g_ee_lhr_10.2.0.5:2.0 init


# 10.2.0.1 二进制安装,-h参数不能变
docker run -itd --name lhrora10201 -h lhrora10g -p 3379:3389 \
-p 1511:1521 -p 211:22 \
--privileged=true \
lhrbest/oracle_10g_ee_lhr_10.2.0.1:2.0 init

使用方法
之前也详细说明过一些镜像的使用方法,例如:11.2.0.

23c:

1
https://www.xmmup.com/zaidockerzhongkuaisutiyanoracle-23cmianfeikaifazheban.html

21c:

1
https://www.xmmup.com/dbbao76zaidockerzhongzhixu2bujikeyongyouoracle-21chuanjing.html

19c ASM:

1
2
3
https://www.xmmup.com/dbbao4zhixu2bujikeyongyouoracle19cdeasmdbhuanjing.html

https://www.xmmup.com/dbbao4zhixu2bujikeyongyouoracle19cdeasmdbhuanjing.html

如何在Docker容器中一步一步安装配置Oracle19c的ASM+DB环境

在Docker中使用rpm包的方式安装Oracle 19c

只需2步即可拥有Oracle19c的ASM+DB环境

18c:

1
https://www.xmmup.com/dbbao10zaidockerzhongzhixu2bujikeyongyouoracle-18chuanjing.html

在Docker中只需2步即可拥有Oracle18c环境

11g:

1
2
3
https://www.xmmup.com/dbbao14zaidockerzhongzhixu2bujikeyongyouoracle-11gqiyebanhuanjing11-2-0-4.html

https://www.xmmup.com/dbbao11zaidockerzhongzhixu2bujikeyongyouoracle-11gqiyebanhuanjing11-2-0-3.html

在Docker中只需2步即可拥有Oracle 11g企业版环境(11.2.0.3)

在Docker中只需2步即可拥有Oracle 11g企业版环境(11.2.0.4)

12.2.0.1:

1
https://www.xmmup.com/dbbao12zaidockerzhongzhixu2bujikeyongyouoracle-12cr212-2-0-1qiyebanhuanjing.html

在Docker中只需2步即可拥有Oracle 12cR2(12.2.0.1)企业版环境

12.1.0.2:

1
https://www.xmmup.com/dbbao13zaidockerzhongzhixu2bujikeyongyouoracle-12cr112-1-0-2qiyebanhuanjing.html

在Docker中只需2步即可拥有Oracle 12cR1(12.1.0.2)企业版环境

一辈子很短,努力的做好两件事就好;
第一件事是热爱生活,好好的去爱身边的人;
第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱;

1…567…38

继开

一辈子很短,努力的做好两件事就好:第一件事是热爱生活,好好的去爱身边的人;第二件事是努力学习,在工作中取得不一样的成绩,实现自己的价值,而不是仅仅为了赚钱。

303 日志
171 标签
RSS
gitee E-Mail
0%
鲁ICP备18007712号
© 2025 继开 | 站点字数统计: 262.2k
博客使用 Hexo 搭建
|
主题 — NexT.Mist v5.1.4
人访问 次查看