728x90

출처

Maven pom.xml 설정

    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>2.2.4.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
      <version>3.1.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper -->
    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-jasper</artifactId>
      <version>9.0.31</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>

Spring Boot main 소스

Spring Boot main 소스 하위 패키지만 자동으로 로딩(Controller, Service)

package com.bluexmas;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
//@ComponentScan(basePackages = {"com.bluexmas.controller"})
public class BluexmasApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(BluexmasApplication.class, args);
    }
    
}

Controller 소스

package com.bluexmas.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SampleController {
	
	@ResponseBody
	@RequestMapping("/sample")
	public String sample() {
		String data = "@ResponseBody 어노테이션을 통해 반환";
		return data;
	}

}

실행

728x90
728x90

출처

pom.xml

  <dependencies>
    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>2.2.4.RELEASE</version>
    </dependency>
  </dependencies>

SpringBootApplication

package com.bluexmas.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
public class BluexmasApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(BluexmasApplication.class, args);
    }
    
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //return super.configure(builder);
        return builder.sources(BluexmasApplication.class);
    }
}

resources\config\application-dev.properties

#http port
server.port=7070

Spring Profile 설정

-Dspring.profiles.active=dev

실행로그

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.4.RELEASE)

2023-06-04 15:34:47.637  INFO 13456 --- [           main] c.bluexmas.example.BluexmasApplication   : Starting BluexmasApplication on DESKTOP-F8HR1P3 with PID 13456 (D:\project2\phEMS\workspace.ems\spring-boot-example1\target\classes started by bluesanta in D:\project2\phEMS\workspace.ems\spring-boot-example1)
2023-06-04 15:34:47.640  INFO 13456 --- [           main] c.bluexmas.example.BluexmasApplication   : The following profiles are active: dev
2023-06-04 15:34:49.054  INFO 13456 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 7070 (http)
2023-06-04 15:34:49.064  INFO 13456 --- [           main] o.apache.catalina.core.StandardService   : 서비스 [Tomcat]을(를) 시작합니다.
2023-06-04 15:34:49.064  INFO 13456 --- [           main] org.apache.catalina.core.StandardEngine  : 서버 엔진을 시작합니다: [Apache Tomcat/9.0.31]
2023-06-04 15:34:49.299  INFO 13456 --- [           main] org.apache.jasper.servlet.TldScanner     : 적어도 하나의 JAR가 TLD들을 찾기 위해 스캔되었으나 아무 것도 찾지 못했습니다. 스캔했으나 TLD가 없는 JAR들의 전체 목록을 보시려면, 로그 레벨을 디버그 레벨로 설정하십시오. 스캔 과정에서 불필요한 JAR들을 건너뛰면, 시스템 시작 시간과 JSP 컴파일 시간을 단축시킬 수 있습니다.
2023-06-04 15:34:49.307  INFO 13456 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-06-04 15:34:49.307  INFO 13456 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1606 ms
2023-06-04 15:34:49.480  INFO 13456 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2023-06-04 15:34:49.644  INFO 13456 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 7070 (http) with context path ''
2023-06-04 15:34:49.648  INFO 13456 --- [           main] c.bluexmas.example.BluexmasApplication   : Started BluexmasApplication in 2.423 seconds (JVM running for 2.838)
728x90
728x90

출처

ChatGPT 플러그인 설치

Repository 정보 입력

Name : OpenAI
Location : https://www.micegroup.it/openai-site/site.xml

OpenAI API 키 입력

https://platform.openai.com/account/api-keys 에서 API Key 생성 하기

API Key 적용

예제 만들기

코드 생성용 질문 만들기

1. 이미지 파일을 파라미터로 입력받고 이 이미지파일의 썸내일 이미지를 생성해서 반환하는 generateThumbnail 함수 작성
2. 파일명을 상수로 사용해서 generateThumbnail 호출하고 BufferedImage로 반환 받아서 파일로 저장하는 main 함수 작성

ChatGPT에 Java 코드 생성 요청

자동으로 생성된 Java 코드

728x90
728x90

출처

jdk 설치

root@bluexmas:~# apt install openjdk-11-jdk-headless

tomcat 설치

root@bluexmas:~# cd /opt
root@bluexmas:/opt# wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.85/bin/apache-tomcat-8.5.85.tar.gz
root@bluexmas:/opt# tar xvfz apache-tomcat-8.5.85.tar.gz
root@bluexmas:/opt# mv apache-tomcat-8.5.85 tomcat

서비스 등록 파일 tomcat.service 생성

root@bluexmas:/opt# vi /etc/systemd/system/tomcat.service

tomcat.service 내용

[Unit]
Description=tomcat 8
After=network.target syslog.target

[Service]
Type=forking
Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
User=root
Group=root
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

tomcat 서비스 등록

root@bluexmas:/opt# systemctl enable tomcat.service
Created symlink /etc/systemd/system/multi-user.target.wants/tomcat.service → /etc/systemd/system/tomcat.service.

tomcat 서비스 실행

root@bluexmas:/opt# systemctl start tomcat.service

tomcat 서비스 상태 확인

root@hyukkwonweb:/opt# systemctl status tomcat.service
● tomcat.service - tomcat 8
     Loaded: loaded (/etc/systemd/system/tomcat.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-02-11 00:01:48 KST; 23s ago
    Process: 31828 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=0/SUCCESS)
   Main PID: 31847 (java)
      Tasks: 33 (limit: 3509)
     Memory: 97.1M
     CGroup: /system.slice/tomcat.service
             └─31847 /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/loggin>
 
Feb 11 00:01:48 hyukkwonweb.cafe24.com systemd[1]: Starting tomcat 8...
Feb 11 00:01:48 hyukkwonweb.cafe24.com startup.sh[31828]: Tomcat started.
Feb 11 00:01:48 hyukkwonweb.cafe24.com systemd[1]: Started tomcat 8.
lines 1-13/13 (END)
728x90
728x90

출처

리눅스 정보 조회

출처 : 리눅스 종류 확인, 리눅스 버전 확인 - 제타위키

# cat /etc/*-release | uniq
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.5 LTS"
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

리눅스 비트 확인

출처 : 리눅스 32비트 64비트 확인 - 제타위키

# getconf LONG_BIT
64

관련패키지 설치

# apt install gcc g++ libncurses5-dev libxml2-dev openssl libssl-dev curl libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libsasl2-dev autoconf libncurses5-dev

MySQL 계정 만들기

# groupadd mysql
# useradd -g mysql -s /bin/bash -m mysql

cmake 설치

# apt install cmake pkg-config

MySQL 소스 다운로드, 압축해제, 컴파일, 설치

# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.41.tar.gz 
# tar xvf mysql-boost-5.7.41.tar.gz 
# cd mysql-5.7.41
# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \
-DMYSQL_DATADIR=/usr/local/mysql57/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql57/mysql.sock \
-DSYSCONFDIR=/usr/local/mysql57 \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_USER=mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DDOWNLOAD_BOOST=0 -DWITH_BOOST=./boost
# make 
# make install

환경설정

# vi /usr/local/mysql57/my.cnf

my.cnf

[mysqld]
port=3306
event_scheduler = ON
basedir=/usr/local/mysql57
datadir=/usr/local/mysql57/data
# pid-file=/usr/local/mysql57/mysqld.pid
# log_error=/usr/local/mysql57/mysql_error.log
# lc-messages-dir=/usr/local/mysql57/share

init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
character-set-server=utf8
collation-server=utf8_general_ci
# table_cache=1024
max_connections=2048
max_user_connections=500
max_connect_errors=10000
wait_timeout=300
query_cache_type = 1
query_cache_size = 128M
query_cache_limit = 5M
slow_query_log
long_query_time=3
max_allowed_packet=16M
sort_buffer_size = 2M
# skip-innodb
skip-name-resolve
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
lower_case_table_names = 1

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

MySQL 설치 디렉토리 mysql 계정으로 권한 수정

# chown -R mysql:mysql /usr/local/mysql57

MySQL 데이터베이스 초기화 (mysql 계정으로 실행)

# su mysql
mysql@bluexmas:~$ cd /usr/local/mysql57
mysql@bluexmas:/usr/local/mysql57$ bin/mysql_install_db --no-defaults --user=mysql --datadir=/usr/local/mysql57/data --basedir=/usr/local/mysql57 -v
2022-01-22 13:35:54 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2022-01-22 13:35:54 [NOTE]    Creating data directory /usr/local/mysql57/data
2022-01-22 13:35:54 [NOTE]    Generating random password to /home/mysql/.mysql_secret...done.
2022-01-22 13:35:54 [NOTE]    Executing /usr/local/mysql57/bin/mysqld --no-defaults --bootstrap --datadir=/usr/local/mysql57/data --lc-messages-dir=/usr/local/mysql57/share --lc-messages=en_US --basedir=/usr/local/mysql57
2022-01-22 13:35:55 [NOTE]    Creating system tables...done.
2022-01-22 13:35:55 [NOTE]    Filling system tables with data...done.
2022-01-22 13:35:55 [NOTE]    Filling help table with data...done.
2022-01-22 13:35:55 [NOTE]    Creating user for internal session service...done.
2022-01-22 13:35:55 [NOTE]    Creating default user root@localhost
2022-01-22 13:35:55 [NOTE]    Creating default proxy root@localhost
2022-01-22 13:35:55 [NOTE]    Creating sys schema
2022-01-22 13:35:55 [NOTE]    done.
2022-01-22 13:35:57 [WARNING] The bootstrap log isn't empty:
2022-01-22 13:35:57 [WARNING] 2022-01-22T04:35:54.552623Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

MySQL 서비스 등록

서비스 mysqld 파일 복사

# cp /usr/local/mysql57/support-files/mysql.server /etc/init.d/mysqld57

mysqld 수정

# vi /etc/init.d/mysqld57

mysqld파일을 열어서 basedir에 mysql이 설치된 디렉토리와 데이터 디렉토리(datadir)를 설정한다.

basedir=/usr/local/mysql57
datadir=/usr/local/mysql57/data

mysqld 서비스 등록

# sudo update-rc.d mysqld57 defaults

mysqld 서비스 실행

# service mysqld57 start
# service mysqld57 status
● mysqld57.service - LSB: start and stop MySQL
     Loaded: loaded (/etc/init.d/mysqld57; generated)
     Active: active (exited) since Fri 2023-02-10 23:31:24 KST; 4s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 27530 ExecStart=/etc/init.d/mysqld57 start (code=exited, status=0/SUCCESS)
 
Feb 10 23:31:24 hyukkwonweb.cafe24.com systemd[1]: Starting LSB: start and stop MySQL...
Feb 10 23:31:24 hyukkwonweb.cafe24.com mysqld57[27530]: Starting MySQL
Feb 10 23:31:24 hyukkwonweb.cafe24.com mysqld57[27530]:  *
Feb 10 23:31:24 hyukkwonweb.cafe24.com systemd[1]: Started LSB: start and stop MySQL.
Feb 10 23:31:25 hyukkwonweb.cafe24.com mysqld57[27558]: 2023-02-10T14:31:25.132557Z mysqld_safe A mysqld process already
# service mysqld57 stop
2023-02-10T14:32:48.762831Z mysqld_safe mysqld from pid file /usr/local/mysql57/data/hyukkwonweb.cafe24.com.pid ended

root 암호 초기화

권한을 무시하고 mysql 서버 실행

mysql@bluexmas:/usr/local/mysql57$ bin/mysqld_safe --skip-grant-tables &
[1] 26618
mysql@bluexmas:/usr/local/mysql57$ 2023-02-10T14:22:37.960568Z mysqld_safe Logging to '/usr/local/mysql57/data/hyukkwonweb.cafe24.com.err'.
2023-02-10T14:22:37.976632Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql57/data

root 암호 설정

mysql@bluexmas:/usr/local/mysql57$ bin/mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.41-log Source distribution
 
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql> update user set authentication_string = password('sqldba') where user = 'root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit
Bye

ERROR 1820 (HY000) 오류 해결

mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> SET PASSWORD = PASSWORD('sqldba');
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql>

사용자 추가

mysql> create user 'user1'@'%' identified by 'userpw'; 
mysql> grant all privileges on *.* to 'user1'@'%' with grant option; 
mysql> flush privileges;

사용자 추가

mysql> create user 'terecal'@'%' identified by '****';
mysql> GRANT ALL privileges ON terecal_db.* TO 'terecal'@'%';
mysql> flush privileges;
728x90
728x90

출처

Python3 설치

orangepi@orangepi5:~$ sudo apt install python3 python3-pip
orangepi@orangepi5:~$ python3 --version
Python 3.10.6
orangepi@orangepi5:~$ pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

Jupyter Notebook 설치

orangepi@orangepi5:~$ sudo -H pip3 install jupyter
orangepi@orangepi5:~$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.9.0
ipykernel        : 6.20.2
ipywidgets       : 8.0.4
jupyter_client   : 8.0.2
jupyter_core     : 5.2.0
jupyter_server   : 2.2.0
jupyterlab       : not installed
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.9.0

Jupyter Notebook 환경 설정

orangepi@orangepi5:~$ jupyter notebook --generate-config
Writing default config to: /home/orangepi/.jupyter/jupyter_notebook_config.py

암호 생성

orangepi@orangepi5:~$ cd .jupyter/
orangepi@orangepi5:~/.jupyter$ ls
jupyter_notebook_config.py  migrated
orangepi@orangepi5:~/.jupyter$ python3
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from notebook.auth import passwd
>>> passwd()
Enter password: 
Verify password: 
'argon2:$argon2id$v=19$m=10240,t=10,p=8$Vl7CWpGCIIvCCE3xRc8fkw$IRE5DSzO6WDw/REgmYO7u08PFqHvGxQ0t9OA1jQ4jks'
>>> quit()

jupyter_notebook_config.py 편집

orangepi@orangepi5:~/.jupyter$ vi ~/.jupyter/jupyter_notebook_config.py
jupyter_notebook_config.py 파일
## Set the Access-Control-Allow-Origin header
#  
#          Use '*' to allow any origin to access your server.
#  
#          Takes precedence over allow_origin_pat.
#  Default: ''
c.NotebookApp.allow_origin = '*'

## The IP address the notebook server will listen on.
#  Default: 'localhost'
c.NotebookApp.ip = '0.0.0.0'

## Hashed password to use for web authentication.
#  
#                        To generate, type in a python/IPython shell:
#  
#                          from notebook.auth import passwd; passwd()
#  
#                        The string should be of the form type:salt:hashed-
#  password.
#  Default: ''
c.NotebookApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$Vl7CWpGCIIvCCE3xRc8fkw$IRE5DSzO6WDw/REgmYO7u08PFqHvGxQ0t9OA1jQ4jks'

작업 디렉토리 생성

orangepi@orangepi5:~$ cd ~
orangepi@orangepi5:~$ mkdir notebookDir

jupyter-notebook 실행 경로 확인

orangepi@orangepi5:~$ whereis jupyter-notebook
jupyter-notebook: /usr/local/bin/jupyter-notebook/pre>

서비스 등록

서비스(jupyter.service) 파일 생성

orangepi@orangepi5:/etc/systemd/system$ sudo vi /etc/systemd/system/jupyter.service
jupyter.service 파일
[Unit]
Description=Jupyter Notebook Server

[Service]
Type=test
PIDFile=/run/jupyter.pid
User=orangepi
ExecStart=/usr/local/bin/jupyter-notebook
WorkingDirectory=/home/orangepi/notebookDir

[Install]
WantedBy=multi-user.target

서비스 등록

orangepi@orangepi5:/etc/systemd/system$ sudo systemctl enable jupyter.service

서비스 시작

orangepi@orangepi5:/etc/systemd/system$ sudo systemctl start jupyter

서비스 실행 상태 확인

orangepi@orangepi5:/etc/systemd/system$ sudo systemctl status jupyter
● jupyter.service - Jupyter Notebook Server
     Loaded: loaded (/etc/systemd/system/jupyter.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-02-02 22:36:43 CST; 2s ago
   Main PID: 4537 (jupyter-noteboo)
      Tasks: 1 (limit: 18821)
     Memory: 67.2M
        CPU: 1.166s
     CGroup: /system.slice/jupyter.service
             └─4537 /usr/bin/python3 /usr/local/bin/jupyter-notebook
 
Feb 02 22:36:43 orangepi5 systemd[1]: Started Jupyter Notebook Server.
Feb 02 22:36:45 orangepi5 jupyter-notebook[4537]: [I 22:36:45.912 NotebookApp] Serving notebooks from local directory: /home/orangepi/notebo>
Feb 02 22:36:45 orangepi5 jupyter-notebook[4537]: [I 22:36:45.912 NotebookApp] Jupyter Notebook 6.5.2 is running at:
Feb 02 22:36:45 orangepi5 jupyter-notebook[4537]: [I 22:36:45.912 NotebookApp] http://orangepi5:8888/
Feb 02 22:36:45 orangepi5 jupyter-notebook[4537]: [I 22:36:45.912 NotebookApp] Use Control-C to stop this server and shut down all kernels (>
Feb 02 22:36:45 orangepi5 jupyter-notebook[4537]: [W 22:36:45.917 NotebookApp] No web browser found: could not locate runnable browser.
lines 1-16/16 (END)

Jupyter Notebook 실행

728x90
728x90

출처

리눅스 스토리지 디바이스 정보 확인

orangepi@orangepi5:~$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mtdblock0    31:0    0    16M  0 disk 
mmcblk1     179:0    0  59.5G  0 disk 
├─mmcblk1p1 179:1    0   256M  0 part /boot
└─mmcblk1p2 179:2    0  58.6G  0 part /var/log.hdd
                                      /
zram0       254:0    0   7.7G  0 disk [SWAP]
zram1       254:1    0   200M  0 disk /var/log
nvme0n1     259:0    0 238.5G  0 disk 
├─nvme0n1p1 259:1    0    16M  0 part 
└─nvme0n1p2 259:2    0 238.5G  0 part

기존 파티션 삭제

orangepi@orangepi5:~$ sudo gdisk
GPT fdisk (gdisk) version 1.0.8
 
Type device filename, or press <Enter> to exit: /dev/nvme0n1                      
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
 
Found valid GPT with protective MBR; using GPT.
 
Command (? for help): p
Disk /dev/nvme0n1: 500118192 sectors, 238.5 GiB
Model: SAMSUNG MZALQ256HBJD-00BL2              
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): AF6C9907-FDCE-4BA6-AD91-5233C180686B
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 32768, last usable sector is 8945670
Partitions will be aligned on 2048-sector boundaries
Total free space is 7 sectors (3.5 KiB)
 
Number  Start (sector)    End (sector)  Size       Code  Name
   1           32768         8421375   4.0 GiB     0700  vfat
   2         8421376         8945663   256.0 MiB   8300  userdata
 
Command (? for help): d
Partition number (1-2): 2
 
Command (? for help): d
Using 1
 
Command (? for help): w  
Warning! Secondary header is placed too early on the disk! Do you want to
correct this problem? (Y/N): Y
Have moved second header and partition table to correct location.
 
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
 
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/nvme0n1.
The operation has completed successfully.

Batocera.linux 업로드

orangepi@orangepi5:~$ sudo apt install lrzsz
orangepi@orangepi5:~$ rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring batocera-rk3588-36-20230116-orig-opi5.img.gz...
  100% 1585388 KB    18222 KB/sec    00:01:27       0 Errors

NVMe에 Batocera.linux 설치

orangepi@orangepi5:~$ gzip -d batocera-rk3588-36-20230116-orig-opi5.img.gz
orangepi@orangepi5:~$ sudo dd if=./batocera-rk3588-36-20230116-orig-opi5.img of=/dev/nvme0n1 bs=4M status=progress
4538236928 bytes (4.5 GB, 4.2 GiB) copied, 66 s, 68.7 MB/s
1092+1 records in
1092+1 records out
4580200448 bytes (4.6 GB, 4.3 GiB) copied, 69.8388 s, 65.6 MB/s
orangepi@orangepi5:~$ sync

NVMe에 bootloader 설치

orangepi-config 실행

orangepi@orangepi5:~$ sudo orangepi-config

NVMe에 bootloader 설치

Batocera.linux 실행화면

728x90
728x90

출처

Jenkins 도커 이미지 다운로드

orangepi@orangepi5:~$ docker pull jenkins/jenkins:lts
lts: Pulling from jenkins/jenkins
c3e6129b48b6: Pull complete 
Digest: sha256:f8b19176b7d4f62cc40ae8605fbbfb2abc6ed7aec9f36989fc7b3e616371b956
Status: Downloaded newer image for jenkins/jenkins:lts
docker.io/jenkins/jenkins:lts

Jenkins 도커 이미지 실행 (브릿지모드)

orangepi@orangepi5:~$ docker run --name jenkins-docker \
  -p 7979:8080 \
  -p 50000:50000 \
  -d -v /var/run/docker.sock:/var/run/docker.sock \
  -v jenkins_home:/var/jenkins_home \
  -u root jenkins/jenkins:lts
7892e850a3702ee25690e80a84ae661619cd459a116164d80d2874472526a199

Jenkins 실행 확인

orangepi@orangepi5:~$ docker ps -a
CONTAINER ID   IMAGE                       COMMAND                  CREATED         STATUS                 PORTS                                                                                      NAMES
7892e850a370   jenkins/jenkins:lts         "/usr/bin/tini -- /u…"   3 minutes ago   Up 3 minutes           0.0.0.0:50000->50000/tcp, :::50000->50000/tcp, 0.0.0.0:7979->8080/tcp, :::7979->8080/tcp   jenkins-docker

Jenkins 어드민 암호 확인

orangepi@orangepi5:~$ docker logs jenkins-docker
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
 
... 생략 ...
 
2023-01-24 09:51:37.750+0000 [id=40]    INFO    jenkins.install.SetupWizard#init: 
 
*************************************************************
*************************************************************
*************************************************************
 
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
 
6a5f9d0833fe467da39d124d93547dab
 
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
 
*************************************************************
*************************************************************
*************************************************************
 
2023-01-24 09:51:55.013+0000 [id=40]    INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization
2023-01-24 09:51:55.051+0000 [id=24]    INFO    hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
2023-01-24 09:51:55.947+0000 [id=58]    INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2023-01-24 09:51:55.948+0000 [id=58]    INFO    hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1

Jenkins 접속

접속주소 : http://192.168.1.26:7979/

728x90

+ Recent posts