Posted
Filed under Computer/Linux
Backup your important data

Clone rocky-tools
# git clone https://github.com/rocky-linux/rocky-tools.git

# cd rocky-tools/migrate2rocky
Run rocky-tool
# chmod +x migrate2rocky.sh
# ./migrate2rocky.sh -r
...

Reboot the system
# reboot 

Select Rocky Linux kernel.
(Boot prompt show all existing kernel and rocky kernel)
2022/06/16 02:14 2022/06/16 02:14
[로그인][오픈아이디란?]
Posted
Filed under Computer/Linux
# yum update
Last metadata expiration check: 0:06:06 ago on Tue 14 Jun 2022 06:27:04 PM PDT.
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Error: 
 Problem: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-2.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-2.el8.noarch
  - package centos-linux-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-2.el8.noarch
  - package centos-linux-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-4.el8.noarch
  - package centos-stream-repos-8-4.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-2.el8.noarch
  - package centos-linux-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-6.el8.noarch
  - package centos-stream-repos-8-6.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-2.el8.noarch
  - cannot install the best update candidate for package centos-linux-release-8.3-1.2011.el8.noarch
  - problem with installed package centos-linux-repos-8-2.el8.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)



But can not remove centos-linux-repos-8-2.el8.noarch .
# yum erase --skip-broken --nobest centos-linux-repos-8-2.el8.noarch 
Error: 
 Problem: The operation would result in removing the following protected packages: setup

This time you can upgrade repo then automatically remove that repo.
# dnf swap centos-{linux,stream}-repos
Dependencies resolved.
======================================================================================================================================================================================================================================
 Package                                                         Architecture                                     Version                                               Repository                                               Size
======================================================================================================================================================================================================================================
Installing:
 centos-stream-release                                           noarch                                           8.6-1.el8                                             Stream-BaseOS                                            22 k
     replacing  centos-linux-release.noarch 8.3-1.2011.el8
     replacing  centos-release-stream.x86_64 8.1-1.1911.0.7.el8
 centos-stream-repos                                             noarch                                           8-6.el8                                               Stream-BaseOS                                            20 k
Upgrading:
 centos-gpg-keys                                                 noarch                                           1:8-6.el8                                             Stream-BaseOS                                            14 k
Removing:
 centos-linux-repos                                              noarch                                           8-2.el8                                               @BaseOS                                                  26 k
Transaction Summary
======================================================================================================================================================================================================================================
Install  2 Packages
Upgrade  1 Package
Remove   1 Package
Total download size: 57 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): centos-stream-release-8.6-1.el8.noarch.rpm                                                                                                                                                     118 kB/s |  22 kB     00:00    
(2/3): centos-stream-repos-8-6.el8.noarch.rpm                                                                                                                                                         105 kB/s |  20 kB     00:00    
(3/3): centos-gpg-keys-8-6.el8.noarch.rpm                                                                                                                                                              75 kB/s |  14 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                  96 kB/s |  57 kB     00:00     

and everything OK.
2022/06/15 11:11 2022/06/15 11:11
[로그인][오픈아이디란?]
Posted
Filed under 분류없음
I would like to introduce my idea that I have been thinking and testing for a long time. In general, software is bound to be developed according to one function or group functions. Of course, developer can't be made from the scratch, so we skip the already developed functions using things like libraries and modules, but we also have to compile the source or follow each fixed type of software format. Indeed, it seems difficult for AI to think on its own or develop on its own. So, I paid a lot of attention to flexible form of software development. Among the things I used, it was convenient for Shell script when I work computer engineer. But as I became more focused on Python, Python was able to implement most of the functions I had in mind, so I saw the possibility of porting and testing past my sources for years. The software I am currently developing and using is available in Linux, FreeBSD, Ubuntu, Raspberry PI, and iOS with almost all of the same commands. It also does not develop new software to incorporate new features. If you just put in a new idea code of your own, then it will be automatically build required code or module and executed my idea code. it can be easy and reduce coding stress. It's like finding the possibility codes in the human brain, and building them, and making the software. The software I made supports python code, shell code, and linux software, and includes software automation concept. If I find out something new, I think if I record it on this, I will gradually increase the ability of this one software to handle. Of course, it can reduce human mistakes, but in some ways, it can achieve slower results than humans due to algorithms that are weaker than jumping processes due to human cognitive abilities, but it also has the advantage of all remembered ideas instead human’s disadvantages to cannot remember all of them. Another advantage is code patches or upgrade functions with the software’s memory code. but they are usually inconvenient in software. if memory is corrected, all functions use the code of the changed memory, so the concept of patches is reduced a lot. otherwise it is hard to coding, because my mistakes to affect to others. so I made version control in the memory. so can be back to the code in the memory. the other hand is the memory code need to more general common and safety code. 
Anyway In the future, I think that flexible software with this concept will increase a lot in the future. Of course, there are many disadvantages of this, so it cannot be replaced, but I think we can create a new era of new concepts.

2022/04/18 02:04 2022/04/18 02:04
[로그인][오픈아이디란?]
Posted
Filed under Computer/Linux
Install CentOS 7 

Download Raspberry PI OS from 
http://mirror.keystealth.org/centos-altarch/7.9.2009/isos/armhfp/CentOS-Userland-7-armv7hl-RaspberryPI-GNOME-2009-sda.raw.xz

Download Raspberry PI Imager from https://www.raspberrypi.org/blog/raspberry-pi-imager-imaging-utility/

Select "CentOS-Userland-7-armv7hl-RaspberryPI-GNOME-2009-sda.raw.xz" file at Operating System button. ( "Use custom" at the bottom )

Insert SD Card at the USB reader then you can see the SD card at the "SD Card"

Click "Write" button.

This CentOS7 os defined 3.5GB filesystem at the SD Card. (partition 3 : / (3G) , 2: swap(500M), 1:/boot)
So, you can modify the filesystem as fit your own SD Card.

Insert your SD Card on your linux machine

If your SD Card device is /dev/sdb then.....
Make a extra partition at the free space
# fdisk /dev/sdb
n
9406464
wq

Format the new device (/dev/sdb4)
# mkfs.ext4 /dev/sdb4

Mount partitions
# mkdir /mnt/boot
# mkdir /mnt/root
# mkdir /mnt/new_root
# mount /dev/sdb1 /mnt/boot
# mount /dev/sdb3 /mnt/root
# mount /dev/sdb4 /mnt/new_root

Copy whole filesystems to new partition
# cd /mnt/root
# rsync -a --progress . /mnt/new_root

Modify the root device definition at the kernel parameter
# vi /mnt/boot/cmdline.txt
-----------------------------------------------------
console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=deadline rootwait
---------------Change to below-------------------
console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p4 rootfstype=ext4 elevator=deadline rootwait
------------------------------------------------------

Modify the root partition at the fstab
# vi /mnt/new_root/etc/fstab
-----------------------------------------------------
UUID=125a472a-16a7-4c65-af22-ca19632sc8fa  / ext4    defaults,noatime 0 0
UUID=F10D-3C64  /boot vfat    defaults,noatime 0 0
UUID=2fd27705-271d-4059-ae11-247ac8f2efde  swap swap    defaults,noatime 0 0
---------------Change to below-------------------
/dev/mmcblk0p4  / ext4    defaults,noatime 0 0
UUID=F10D-3C64  /boot vfat    defaults,noatime 0 0
UUID=2fd27705-271d-4059-ae11-247ac8f2efde  swap swap    defaults,noatime 0 0
-----------------------------------------------------

Disable selinux
# vi /mnt/new_root/etc/selinux/config
Change from enforcing to disabled

Unmount 
# umount /mnt/boot /mnt/new_root /mnt/root

Insert the SD Card to Raspberry PI.

You can now use the big root filesystem on your SD Card.

If you want increase the swap partition then change the old root partition to swap partition

Make a swap partition at the old root device
$ sudo fdisk /dev/mmcblk0

3
82
wq
$ sudo mkswap /dev/mmcblk0p3

Add a line at the /etc/fstab file with UUID information
$ sudo vi /etc/fstab
UUID=1251472a-16a7-4c25-af22-ca1964ac8fd0  swap swap    defaults,noatime 0 0

$ sudo swapon /dev/mmcblk0p3

Now you can use big swap and big filesystem.
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       113G  3.2G  104G   3% /
devtmpfs        430M     0  430M   0% /dev
tmpfs           463M     0  463M   0% /dev/shm
tmpfs           463M   13M  451M   3% /run
tmpfs           463M     0  463M   0% /sys/fs/cgroup
/dev/mmcblk0p1  286M   55M  231M  20% /boot
tmpfs            93M   12K   93M   1% /run/user/42
tmpfs            93M     0   93M   0% /run/user/1000
tmpfs            93M     0   93M   0% /run/user/1001

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/mmcblk0p2                          partition 499708 4352 -2
/dev/mmcblk0p3                          partition 3906556 0 -3

I tested many OS. but mine case, CentOS 7 is better than others.
2021/01/06 10:15 2021/01/06 10:15
[로그인][오픈아이디란?]
Posted
Filed under Computer/Linux
Already installed shellinabox and setup Google authenticator for your account.

Setup virtual network interface on your system.
(for example: tun0, kvm network)
(example ip : 10.0.0.2)

setup google authenticator access list file.
# vi /etc/security/access-local.conf
------------------------------------------------------------
+ : ALL : xxx.xxx.xxx.0/24  # your inside network
+ : ALL : LOCAL    # Local host 
- : ALL : ALL   # all other's IP need google Auth.
------------------------------------------------------------

Add above rule at the pam file.
# vi /etc/pam.d/sshd
------------------------------------------------------------
auth [success=1 default=ignore] pam_access.so accessfile=/etc/security/access-local.conf
auth required pam_google_authenticator.so
------------------------------------------------------------

Change shellinabox configuration using SSH at OPTS (virtual device ip: 10.0.0.2)
# vi /etc/sysconfig/shellinaboxd
-------------------------------------------------------------
OPTS="-s /:SSH:10.0.0.2"
-------------------------------------------------------------


restart daemon
# systemctl restart shellinaboxd

if you login with web then you can see asking google Auth. before password.
2020/12/11 03:53 2020/12/11 03:53
[로그인][오픈아이디란?]