Skip to content

Blog

Oracle Database Base

Oracle database basic usage

Create Table TABLE_NAME (sequenceno NUMBER(19) not null, \
time TIMESTAMP(6) not null,\
alarmseverity NUMBER(10), \
alarmfield NUMBER(10), \
text VARCHAR2(1000), \
alarmevent NUMBER(19), \
activetype NUMBER(10), \
eventid VARCHAR2(1000), \
primary key(sequenceno) )
  • NUMBER(19): Integer type
  • VARCHAR2(1000): Char type
  • primary key(sequenceno): Set “sequenceno” as primary key
Insert Into H_ASMEvents(SequenceNo,Description) \
Values(1234, DescriptionText,)
UPDATE H_ASMEvents SET Description = description_text \
WHERE SequenceNo = 1234
SELECT * FROM H_ASMEvents WHERE SequenceNo = 1234

Deploy KMS Activation Server with Vlmcsd On DockerVlmcsd Project: [mydigitallife],[Github]

To install Vlmcsd Manually, refer to [Vlmcsd-on-Ubuntu-18.04] or [Centos7-Build KMS server and windows product key]## 1. Deploy Vlmcsd on Docker### (1). Compiledocker-compose.yaml, as below``` version: “3” services: kms-docker: image: teddysun/kms container_name: kms restart: always network_mode: “host” ports: - 1688:1688

### (2). Run docker container with docker-compose```
docker-compose up -d
[KMS]
type = tcp
local_ip = 127.0.0.1
local_port = 1688
remote_port = 1688
protocol = kcp

3. Activate WindowsRunCMDwith Administrator, then run the following scripts:

Section titled “3. Activate WindowsRunCMDwith Administrator, then run the following scripts:”
slmgr.vbs -upk
slmgr.vbs -ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
slmgr.vbs -skms xxx.xxx.xxx.xxx:1688
slmgr.vbs -ato
slmgr.vbs -dlv

4. Activate OfficeRunCMDwith Administrator, then run the following scripts:

Section titled “4. Activate OfficeRunCMDwith Administrator, then run the following scripts:”
cd C:\Program Files\Microsoft Office\Office16
cscript ospp.vbs /unpkey:xxxxx
cscript ospp.vbs /inpkey:xxxxx
cscript ospp.vbs /sethst:x.x.x.x
cscript ospp.vbs /act

Scripts above refer to [ospp.vbsactivateoffice]

Notes: KMS activation works for Office VOL version ONLY.> You can install VOL certificates with [OfficeTools].

5. Commonly used keys- ### Windows-10-Professional

Section titled “5. Commonly used keys- ### Windows-10-Professional”

W269N-WFGWX-YVC9B-4J6C9-T83GX

For more Activation Key, refer to [Office-Products-Information].

6. Download Link[Office-2021-Professional-Plus-English]

Section titled “6. Download Link[Office-2021-Professional-Plus-English]”

[Visio-2021-Professional-English] [Office-2021-Professional-Plus-Chinese-Simplified] [Visio-2021-Professional-Chinese-Simplified]

[2]. https://github.com/Wind4/vlmcsd

[3]. https://jalena.bcsytv.com/archives/1388/comment-page-1

[4]. https://blog.thirdechelon.org/2019/06/vlmcsd-on-ubuntu-18-04/

[5]. https://sxfblog.com/index.php/archives/137.html

[6]. Some-Operations-After-Installing-docker-and-podman [mydigitallife]:http://forums.mydigitallife.info/threads/50234-Emulated-KMS-Servers-on-non-Windows-platforms[Github]:https://github.com/Wind4/vlmcsd[ospp.vbs activate office]:https://ihacksoft.com/ospp-vbs.html[OfficeTools]:https://otp.landian.vip/en-us/[Vlmcsd-on-Ubuntu-18.04]:https://blog.thirdechelon.org/2019/06/vlmcsd-on-ubuntu-18-04/[Centos7-Build KMS server and windows product key]: https://sxfblog.com/index.php/archives/137.html[Office-2021-Professional-Plus-English]:https://officecdn.microsoft.com/db/492350F6-3A01-4F97-B9C0-C7C6DDF67D60/media/en-US/ProPlus2021Retail.img[Office-Products-Information]:https://github.com/YerongAI/Office-Tool/blob/main/doc/Tech%20Articles/Products.md[Visio-2021-Professional-English]:https://officecdn.microsoft.com/db/492350F6-3A01-4F97-B9C0-C7C6DDF67D60/media/en-US/VisioPro2021Retail.img[Office-2021-Professional-Plus-Chinese-Simplified]:https://officecdn.microsoft.com/db/492350F6-3A01-4F97-B9C0-C7C6DDF67D60/media/zh-CN/ProPlus2021Retail.img[Visio-2021-Professional-Chinese-Simplified]:https://officecdn.microsoft.com/db/492350F6-3A01-4F97-B9C0-C7C6DDF67D60/media/zh-CN/VisioPro2021Retail.img

A preliminary study on SELinux

Some operation commands about SELinux security context settings### 1. chcon- grammar ```

Section titled “Some operation commands about SELinux security context settings### 1. chcon- grammar ```”
chcon [选项]... 环境 文件...
chcon [选项]... [-u 用户] [-r 角色] [-l 范围] [-t 类型] 文件...
chcon [选项]... --reference=参考文件 文件...
```
  • Options ``` -h, –no-dereference:影响符号连接而非引用的文件。 –reference=参考文件:使用指定参考文件的安全环境,而非指定值。 -R, –recursive:递归处理所有的文件及子目录。 -v, –verbose:为处理的所有文件显示诊断信息。 -u, –user=用户:设置指定用户的目标安全环境。 -r, –role=角色:设置指定角色的目标安全环境。 -t, –type=类型:设置指定类型的目标安全环境。 -l, –range=范围:设置指定范围的目标安全环境。
restorecon [-iFnrRv] [-e excludedir ] [-o filename ] [-f filename | pathname...]
```
  • Options ``` -i:忽略不存在的文件。 -f:infilename 文件 infilename 中记录要处理的文件。 -e:directory 排除目录。 -R/-r:递归处理目录。 -n:不改变文件标签。 -o/outfilename:保存文件列表到 outfilename,在文件不正确情况下。 -v:将过程显示到屏幕上。 -F:强制恢复文件安全语境。

3. Semanage- Rules for automatically marking subsequent files under a certain path with security context

Section titled “3. Semanage- Rules for automatically marking subsequent files under a certain path with security context”
```
sudo semanage fcontext -a -t samba_share_t "/mnt/shared(/.*)?"
```
  • Delete the rule that automatically marks the security context of subsequent files under a certain path ``` sudo semanage fcontext - “/mnt/shared(/.*)?”

4. getebool- View all bool switches for SELinux

Section titled “4. getebool- View all bool switches for SELinux”
```
getsebool -a
```
```
setsebool -P <boolean_name> on/off
```

Among them,-Pis used for permanent modification.

6. Attention- It should be noted that any program running under SElinux needs to be supported by the corresponding SElinux security context, otherwise the operation will inevitably cause insufficient permissions.

Section titled “6. Attention- It should be noted that any program running under SElinux needs to be supported by the corresponding SElinux security context, otherwise the operation will inevitably cause insufficient permissions.”

[2].https://www.linuxprobe.com/chcon.html [3]. https://goto-linux.com/zh-cn/2020/6/13/%E5%A6%82%E4%BD%95%E5%9C%A8rhel-8-/-centos-8%E4%B8%8A%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AEsamba/

[4]. Reverse-Proxy-with-Nginx-on-RHEL [5]. Install-Samba-on-RHEL-CentOS-Fedora [6]. Podman-Volumes-and-SELinux

Introduction to OpenPGP

gpg --expert --full-gen-key

  • --expert: expert mode.
  • --full-gen-key: generate a key.

gpg --gen-revoke -so revoke.gpg USERID

gpg --list-secret-keys or the short form gpg -K

  • --keyid-format long: output long key IDs.
  • --fingerprint: output fingerprint information.

Import from a file:

gpg --import [file]

gpg -ao public-key.txt --export USERID

Export the primary private key:

gpg -ao secret-key --export-secret-key 99F583599B7E31F1!

Export a subkey:

gpg -ao sign-subkey --export-secret-subkeys FDB960B857D397F6!

  • ! means only that key is exported.

Delete a private key:

gpg --delete-secret-keys USERID

Delete a public key:

gpg --delete-keys USERID

Generate a binary signature file:

gpg --sign input.txt

Generate an ASCII armored signature:

gpg --clearsign input.txt

Generate a detached signature:

gpg --armor --detach-sign input.txt

  • Add --output to write the result to a file.

Verify a signature file:

gpg --verify demo.txt.asc demo.txt

gpg --recipient {keyid/uid} --output encrypt.txt --encrypt input.txt

gpg -se -o encrypt.txt -r {keyid/uid} input.txt

gpg --decrypt encrypt.txt --output decrypt.txt

gpg -d encrypt.txt

[1]. SSH-Authentication-with-GPG-Keys-on-Linux

[2]. GnuPG-Home-Configuration-on-Winodws

Build Git Server Using GitLab with Podman

Goals- Running GitLab Server on Linux with Podman

Section titled “Goals- Running GitLab Server on Linux with Podman”

1.Configgithub.rbConfiggithub.rbfile with following options

Section titled “1.Configgithub.rbConfiggithub.rbfile with following options”
external_url 'http://127.0.0.1:8929'
gitlab_rails['gitlab_ssh_host'] = 'gitlab.yourdomain.com'
gitlab_rails['gitlab_shell_ssh_port'] = 22
nginx['listen_addresses'] = ['*', '[::]']
nginx['listen_port'] = 8929

Change external_url starting withhttps://to enable HTTPS, working on port 443.

podman pull docker.io/gitlab/gitlab-ce:latest
podman run --detach --privileged \
--name gitlab \
--hostname gitlab.yourdomain.com \
--user $(id -u):$(id -g) \
--network bridge \
--net pod-net \
--health-cmd="/opt/gitlab/bin/gitlab-healthcheck" \
--health-retries=5 \
--health-interval=5m \
--health-start-period=5m \
-p 127.0.0.1:10443:443 \
-v ./config:/etc/gitlab:z \
-v ./logs:/var/log/gitlab:z \
-v ./data:/var/opt/gitlab:z \
--shm-size 256m \
--group-add keep-groups \
docker.io/gitlab/gitlab-ce:latest
  • 10443:443->Map the local 10443 port to 443 in the container

(1). BackUpBackup Repository with following command

Section titled “(1). BackUpBackup Repository with following command”
gitlab-rake gitlab:backup:create

[2]. Build-a-Git-Using-Gogs [3]. Podman-Volumes-and-SELinux [4]. Manage-Podman-Container-With-Systemd