반응형

그냥 이렇게 쓰면 됨, ``내부에 또 ``넣는 건 안되는듯

json.data[0].word
  ? `${json.data[0].word} (${json.data[0].reading})`
  : `${json.data[0].reading}`
반응형
반응형

react component에는 2가지 종류가 있다 - 클래스형, 함수형

  • 아래 예시에서 보다시피 클래스형은 함수형보다 코드 길이가 더 길고 복잡
  • 함수형은 클래스형보다 메모리 자원도 덜 차지한다고 함 (왜??)
  • 그렇지만 함수형은 별도의 state나 lifecycle 정의를 할 수 없었기 때문에 간단한 용도로만 사용되었으나,
  • 2019년 리액트 버젼16.8부터 추가된 hook으로 인해 함수형이 클래스형보다 많이 쓰이게 되었음
  • 클래스형은 안쓴지 오래되서 이제 어떻게 쓰는지도 잘 모르겠음 (클래스형 https://devowen.com/298 참고하자)

 

class component

class Classcomp extends React.Component {
    state = {...};
    render(){
    	return(
        	<div className="containter>...</div>
        );
    }
}

function component

function FunctionComp(props){

	return (<div>...</div>);

}
반응형
반응형
  • remote에 아직 안올리고 local내에서만 처리가능할 때
    • git commit --amend로 기존 커밋 수정
    • git reset
    • git checkout
    • 여기서 reset과 checkout의 차이를 알아보자
      • reset 명령은 HEAD가 가리키는 브랜치를 움직이지만(정확히는 브랜치 Refs), checkout 명령은 HEAD 자체를 다른 브랜치로 이동, 참고: https://readystory.tistory.com/150 

 

 

  • remote에 이미 push 했을 때
    • git revert - 특정 커밋만 취소, but 커밋한 기록이랑 그 커밋을 취소한 기록이 모두 남음
    • 기록안남기고 그냥 강제 덮어쓰기 하려면 local에서 reset이나 rebase등으로 원하는 상태로 만든후에 git push ---force, but 협업자가 많으면 멘붕올수 있음
      • 과거의 특정 커밋 수정하기
        • git push --force: 강제로 덮어쓰기
        • git push --force-with-lease: 덮어쓰기 전에 로컬의 remotes/브랜치A가 참조하고 있는 것과 현재 원격의 브랜치A가 참조하고 있는 내용이 동일할 경우에만, 즉, 다른 누군가가 원격의 브랜치A에 push를 하지 않은 상태에서만 git push --force를 실행
        • git push --force함으로 없어져 버린 commit은 어떻게 될까?
          • git show f65ff0737a0a935b67235aae20ec389db32e5240: 일단 git push --force한 당일에는 아래처럼 결과가 나옴
          • change userNo=null error action 5 (added in amazon-echo, naver-clova)
반응형
반응형
  • 테이블확인
    • select * from information_schema.tables where table_name='tb_rc_term_multi_lang';
  • foreign key, primary key, unique (idx) 등 테이블에 있는 constraint 이름과 타입 확인
    • select * from information_schema.table_constraints where table_name='tb_rc_term_multi_lang';
  • 각 constraint가 어떤 테이블, 컬럼, 순서로 구성되는지 확인
    • select * from information_schema.KEY_COLUMN_USAGE where referenced_table_name='tb_rc_term'
    • 특정 테이블을 사용하는 모든 foreign key 확인가능 -> 외래키때문에 테이블 삭제 안될 때 유용
  • index 상세정보 확인
    • select * from information_schema.STATISTICS where table_name='tb_rc_term_multi_lang';
반응형

'db' 카테고리의 다른 글

[postgresql] jsonb_to_recordset(...), 1 row -> n rows  (0) 2023.12.15
postgreSQL  (0) 2023.11.09
mysql change column error  (0) 2022.04.28
mysql aggregate function with group by  (0) 2022.04.27
mysql timezone setting  (0) 2022.04.26
반응형
  • GIT: author/commiter
    • 차이 
      • author: 특정 commit의 최초 저자
      • committer: 특정 commit에 commit --amend를 해서 여러개 쌓았을 때 마지막으로 쌓은 사람, 혹은 어떤 사람의 커밋을 cherry-pick해서 push했을 때 - author는 어떤사람이고 push한 내가 committer가 됨
    • author/committer로 남겨지는 이름을 변경하고 싶으면 git config로 세팅을 바꾸면 됨. 세팅 안되어 있으면 해당 컴퓨터내 사용자 이름이 자동으로 사용됨, 이렇게 자동으로 이름을 사용할 경우, warning 차원에서 커밋시 다음 메세지를 보여줌
      Your name and email address were configured automatically based
      on your username and hostname. Please check that they are accurate.
      You can suppress this message by setting 
      
          git config --global user.name "Your Name"
          git config --global user.email you@example.com
      
      After doing this, you may fix the identity used for this commit with:
      
          git commit --amend --reset-author
      Your name and email address were configured automatically based
      on your username and hostname. Please check that they are accurate.
      You can suppress this message by setting them explicitly. Run the
      following command and follow the instructions in your editor to edit
      your configuration file:
      
          git config --global --edit
      
      After doing this, you may fix the identity used for this commit with:
      
          git commit --amend --reset-author
  • GERRIT: owner/uploader/reviewer
    • 차이
      • owner: gerrit에서 code review를 생성한 최초 저자
      • uploader: gerrit에서 동일 code review에 여러개가 쌓였을 때 마지막으로 쌓은 사람
      • reviewer: 말그대로 review화면에서 보이도록 설정한 사람
    • gerrit code review에 남는 명칭
    • git config에 설정된 이름이 아니라 git ssh 계정을 따라 정보가 남음
    • hyungsub.song 데스크탑을 받아서 git까지 세팅된 것 그대로 사용하다가 review에 내이름이 아니라 hyungsub.song으로 잘못 남게 되는 것 발견함, 수정하기 위해서는 다음 과정을 거치면 됨
      • git remote -v
        • remote의 상세정보 확인, ssh://hyungsub.song@mod.lge.com:29450/rich-dev/cdp-web이었음
      • git remote remove origin
        • 기존 origin 삭제
      • git remote add origin ssh://sy919.kim@mod.lge.com:29450/rich-dev/cdp-web
        • origin 재등록
      • git remote show origin
        • origin 정상등록 확인, 권한이 없다느니 그런 에러가 남
        • 현재 이 로컬내 키 정보가 hyunsub.song의 계정에만 등록되어 있고 sy919.kim에는 없기 때문
        • 해결을 위해 /home/hyungsub/.ssh/id_rsa.pub내용을 카피해서 gerrit setting화면에 붙여넣자
        • 더 정확히 하기 위해 hyungsub.song계정 gerrit setting에 기존 등록된 id_rsa.pub는 삭제해면 여기로 더이상 남는 것 아예 방지가능함, 하지만 구지 여기까지는...

 

반응형
반응형

.gnb > ul > li > a {
  position: relative;
  display: block;
  width: 100%;
  font-size: 22px;
  line-height: 80px;
  color: #ffffff;
  text-align: center;
  font-weight: 500;
}

.sub_menu ul li a {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 15px;
  line-height: 35px;
  color: #756161;
}

@media only screen and (min-width: 1200px) and (max-width: 1366px) {
  .gnb > ul > li > a {
    font-size: 16px;
  }

  .sub_menu ul li a {
    font-size: 12px;
  }
}

반응형
반응형

app-ads.txt는 앱 개발자가 광고 요청이 발생한 앱을 소유하고 있다는 사실을 광고주에게 증명함으로써 인앱 광고 사기를 방지할 수 있는 파일

반응형

'etc' 카테고리의 다른 글

504 gateway time-out 에러 해결방법  (0) 2022.09.08
proxy/reverse proxy, web server, load balancer 개념  (0) 2022.09.08
character encoding  (0) 2022.07.11
헷갈리는 것들  (0) 2019.03.15
Web Application Architecture 교육 (2019/03/11~03/15)  (0) 2019.03.11
반응형

컬럼 변경쿼리에 문제가 없는 데도 컬럼속성 변경이 안되는 경우

* 이미 null 값이 들어있는데 not null 속성으로 바꾼다거나

* 0, 1 이외의 값이 들어있는데 bit으로 바꿘다거나

* 그 외 그타입으로 바꿀수 없는 값이 이미 그 컬럼에 있을 때는 먼저 컬럼 값을 바꾸고 컬럼속성을 바꿔야 한다

* change column 할 때에 꼭 생각하자! 삽질 그만 ㅠ.ㅠ

 

반응형

'db' 카테고리의 다른 글

postgreSQL  (0) 2023.11.09
mysql 모든 table, key, index...etc 확인  (0) 2022.05.19
mysql aggregate function with group by  (0) 2022.04.27
mysql timezone setting  (0) 2022.04.26
mysql 한글깨짐  (0) 2022.04.26
반응형

Group by

public List<RegionPayload> getAllRegions() {
  List<RegionPayload> result = new ArrayList<>();
  List<Region> allRegion = regionRepository.findAll();
  Map<String, List<Region>> regionMap =
      allRegion.stream().collect(Collectors.groupingBy(Region::getRegion));
  for (Map.Entry<String, List<Region>> elem : regionMap.entrySet())
    result.add(new RegionPayload(elem.getKey(), elem.getValue()));
  return result;
}
import com.lge.cdp.model.Region;
import java.util.List;
import lombok.AllArgsConstructor;
// import lombok.ToString;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
// @ToString
public class RegionPayload {

  private String region;
  private List<Region> countryList;
}
반응형
반응형
  • collection: 1:N관계 테이블 join시
  • association: 1:1관계 테이블 join시

실제테이블 아닌 view나 subquery로 join시에도 적용되는지?

반응형
반응형
  • count(), count(distinct)
  • group_concat()
  • json_arrayagg() -> json array aggregate
  • json_objectagg() -> json object aggregate
  • sum(), max(), min()

 

select 
device_type, region
,group_concat(ric_code,'-', country_code) 
,JSON_ARRAYAGG(JSON_OBJECT('cntry',country_code, 'ric',ric_code))
,JSON_OBJECTAGG('cntry',country_code)
from tb_rc_ha_region group by device_type, region

반응형

'db' 카테고리의 다른 글

mysql 모든 table, key, index...etc 확인  (0) 2022.05.19
mysql change column error  (0) 2022.04.28
mysql timezone setting  (0) 2022.04.26
mysql 한글깨짐  (0) 2022.04.26
mysql console 접속  (0) 2022.04.26
반응형
  • check timezone
    • select @@global.time_zone, @@session.time_zone,@@system_time_zone;
    • select current_time;
  • modify timezone
    • sudo vim /etc/mysql/mysql.conf.d/mysqld.conf
    • 아래 줄 추가
      • default-time-zone="+00:00"
    • 그리고 재기동
      • sudo service mysql restart
반응형

'db' 카테고리의 다른 글

mysql change column error  (0) 2022.04.28
mysql aggregate function with group by  (0) 2022.04.27
mysql 한글깨짐  (0) 2022.04.26
mysql console 접속  (0) 2022.04.26
mysql date/time  (0) 2022.04.22
반응형

대부분 characterSet이 utf8로 설정되지 않아서 생긴 문제라고 함

  • 현재 characterSet 확인
    • show variables like 'c%'
    • mysql console접속 후 status 명령어 입력
  • mysql.ini 혹은 my.cnf 파일에 아래 내용 추가
    [client]
    default-character-set=utf8
    
    [mysql]
    default-character-set=utf8
    
    
    [mysqld]
    collation-server = utf8_unicode_ci
    init-connect='SET NAMES utf8'
    character-set-server = utf8

    • mysql.ini 혹은 my.cnf의 위치확인
      • show variables like '%dir' : 각종 경로를 알수 있음
      • 위 결과로 나오는 것 중에 basedir or datadir에 mysql.ini가 있다고 하는데 우분투에서는 없었음
      • 대신 /etc/mysql/my.cnf가 있어서 여기에 추가함
    • .ini는 윈도우에서 .cnf는 리눅스에서 쓰이는 설정파일인 것 같음,
      • 우분투에 설치된 mysql 버젼은 5.7.37-0ubuntu0.18.04.1였음
  • database와 table의 chatacterSet도 바꿔야 한다고 해서 바꿔줌
    • ALTER SCHEMA `cdp`  DEFAULT CHARACTER SET utf8  DEFAULT COLLATE utf8_bin;
    • workbench GUI에서도 가능
    • 테이블 characterSet도 일일히 바꿔야 한다는 얘기가 있었으나 하지 않음
  • 변경후 mysql 재시작하니 한글 정상노출됨
    • service mysql restart

 

반응형

'db' 카테고리의 다른 글

mysql aggregate function with group by  (0) 2022.04.27
mysql timezone setting  (0) 2022.04.26
mysql console 접속  (0) 2022.04.26
mysql date/time  (0) 2022.04.22
우분투 18.04 MongoDB 설치 및 구성  (0) 2022.04.18
반응형
  • local에서 접속
    • mysql -u [account] -p: 입력하면 비밀번호 입력하도록 유도됨
    • mysql -u [account]: 비밀번호 없이
  • 외부접속
    • mysql -h [ip] -p [port] -u [account] -p [databaseName]
  • 접속후 상태확인
    •  status
  • 접속종료
    • exit
반응형

'db' 카테고리의 다른 글

mysql timezone setting  (0) 2022.04.26
mysql 한글깨짐  (0) 2022.04.26
mysql date/time  (0) 2022.04.22
우분투 18.04 MongoDB 설치 및 구성  (0) 2022.04.18
mysql remote 접속허용  (0) 2022.04.14
반응형

JDBC (Java Data Base Connectivity) 는 자바에서 Database 를 연결하기 위해 제공되는 Core API

MyBatis 는 SQL Mapper의 일종으로 JDBC를 이용해서 DB에 SQL을 실행하는 것에 대한 방식을 개발적인 관점에서 좀 더 편하고 관리하기 쉽게 만든 Wrapper LIB 개념

차를 운전할 때 핸들은 제조사에서 달려 나오지만 사람에 따라서 다양한 형태의 핸들 커버를 씌우기도 하고 손잡이도 달기도 

제조사에서 달려 나온 핸들을 JDBC 라고 생각하시면 MyBatis 같은 LIB들은 핸들커버나 손잡이 정도에 해당하겠네요.

중요한건 핸들만 가지고 운전을 할수는 있지만 핸들없이 핸들커버만 가지고 운전을 할 수는 없다는점을 생각해 보시면 될 것 같습니다.

반응형
반응형

resultType 은 리턴값이 List<?> 여도 DTO, VO, Map 으로 지정해줘야함

반환된 최종값이 아닌 반환될 객체의 타입으로 지정해줘야함

select A from B 같은 경우에는 List<String> 형태일테니 resultType 은 java.lang.String

select A,B from C의 경우,  따로 객체안만드려면 map

반응형

'java, mybatis' 카테고리의 다른 글

mybatis collection, association  (0) 2022.04.27
mybatis  (0) 2022.04.23
mybatis 사용이유  (0) 2022.04.23
mytabis: parameterType, resultType, resultMap  (0) 2022.04.23
mybatis 비교시 주의사항 (=="비교대상"로 써야함)  (0) 2022.04.23
반응형
  • 생산성 - 빠른개발
    • DBCP만 썻을 때 connection, resultSet, statement, transaction 관리도 해야되고 특히 운영하다 명시적인 connection, resultSet, statement, transaction 닫지 않고 잘못 써서 서버 죽는 경우 허다
    • resultSet의 데이터 매핑도 신경써야 하고 소스분석도 어려워짐
  • 보안: SQL injection공격에 신경안써도 됨 (DBCP경우 preparedStatement 쓰면 문제없지만...)
  •  oracle의 경우 blob, clob 치환에 신경안써도 됨
  • 디버깅 쉬워짐: ? => value로 매핑된 쿼리문으로 로그남겨서...
  • 데이터 캐싱(LIFO, FIFO, LRU) 가능
    • 조회용 데이터 성능 안나올때 성능개선 가능, xml 설정만으로 적용가능
  • resultType result class를 VO안쓰고 맵으로 받을 수 있음
반응형

'java, mybatis' 카테고리의 다른 글

mybatis collection, association  (0) 2022.04.27
mybatis  (0) 2022.04.23
mybatis resultType  (0) 2022.04.23
mytabis: parameterType, resultType, resultMap  (0) 2022.04.23
mybatis 비교시 주의사항 (=="비교대상"로 써야함)  (0) 2022.04.23
반응형
  • parameterType:  실제로 넘어오는 actual parameter로 유추가능하기 때문에 생략가능
  • resultType, resultMap
    • resultType: className or alias사용가능
      • java String class에 대한 alias는 string, 그래서 String, string이렇게 대소문자 모두 사용가능한듯
    • resultMap: mapper XML내부에서 정의해서 사용
      • 복잡한 구조로 변경이 필요할 때는   resultMap으로 변환해서 사용하면 좋음
      • 다음과 같이 3단구조로 된 복잡한 애도 아래처럼 매핑해서 사용가능
        • <resultMap id="homeAppTab" type="TabPayload">
              <id property="idx" column="idx"/>
              <result property="status" column="status"/>
              <result property="deviceType" column="device_type"/>
              <result property="region" column="region"/>
              <result property="tabCode" column="tab_code"/>
              <result property="tabName" column="tab_name"/>
              <collection property="tabMultiLangList" ofType="TabMultiLangPayload">
                <id property="idx" column="tabLangIdx"/>
                <result property="tabLangCode" column="tabLangCode"/>
                <result property="tabLangName" column="tabLangName"/>
              </collection>
              <collection property="categoryList" ofType="CategoryPayload">
                <id property="idx" column="categoryIdx"/>
                <result property="categoryCode" column="category_code"/>
                <result property="categoryName" column="category_name"/>
                <result property="categoryOrder" column="category_order"/>
                <collection property="categoryMultiLangList" ofType="CategoryMultiLangPayload">
                  <id property="idx" column="categoryLangIdx"/>
                  <result property="categoryLangCode" column="categoryLangCode"/>
                  <result property="categoryLangName" column="categoryLangName"/>
                </collection>
                <collection property="categoryResultList" ofType="CategoryResultPayload">
                  <id property="idx" column="categoryResultIdx"/>
                  <result property="countryCode" column="country_code"/>
                  <result property="providerId" column="provider_id"/>
                  <result property="contentType" column="result_content_type"/>
                  <result property="contentId" column="content_id"/>
                  <result property="resultOrder" column="result_order"/>
                </collection>
              </collection>
            </resultMap>

 

반응형

'java, mybatis' 카테고리의 다른 글

mybatis collection, association  (0) 2022.04.27
mybatis  (0) 2022.04.23
mybatis resultType  (0) 2022.04.23
mybatis 사용이유  (0) 2022.04.23
mybatis 비교시 주의사항 (=="비교대상"로 써야함)  (0) 2022.04.23
반응형

mybatis java.lang.numberformatexception for input string에러가 난데없이 발생

string을 number로 잘못 변환했다는 건데 그런적이 없는데 왜?? 알고보니 아래와 같은 이유였음 

<if test=status=='P' and status=='p'> -> 'p'를 char -> int로 변환하여 비교시 status도 int로 변환되어 에러남

<if test=status=="P" and status=="p"> ->"p"로 해줘야함

반응형

'java, mybatis' 카테고리의 다른 글

mybatis collection, association  (0) 2022.04.27
mybatis  (0) 2022.04.23
mybatis resultType  (0) 2022.04.23
mybatis 사용이유  (0) 2022.04.23
mytabis: parameterType, resultType, resultMap  (0) 2022.04.23
반응형

FTP

>ftp ftp1.xumo.com //정상적으로 연결되면 Name과 Password를 입력하라고 메세지가 뜸

>ftp 34.194.1.28 //IP로 요청해도 동일함

>quit //중지

> ls //정상적으로 연결되면 ls명령어 치면 Connection accepted 메시지 나오며 데이터를 받아오는데, EIC는 접속은 되지만 그후 실제 데이터 못 받아옴

227 Entering Passive Mode (34,194,1,28,86,75)
150 Connection accepted
drwxr-xr-x 1 ftp ftp 0 Jun 14 23:15 prod
drwxr-xr-x 1 ftp ftp 0 Jun 14 23:14 staging
226 Transfer OK

  • 연결은 정상적으로 되는데 방화벽때문에 그 이후 다운로드나 ls 등 명령어 수행에 에러가 날 수 있음 -> binary mode로 연결이 안되기 때문, FTP 접속포트인 21번과 20번도 같이 방화벽을 열어야함
반응형

'etc > linux' 카테고리의 다른 글

linux 압축  (0) 2022.04.23
chmod  (0) 2022.04.20
.bashrc (alias)  (0) 2022.04.20
linux 시간동기화  (0) 2022.04.18
ls -al 결과의 의미  (0) 2022.04.18
반응형
  • 압축하기
    • tar czvf conory.tar.gz /home/conory
  • 압축풀기
    • tar xzvf conory.tar.gz


반응형

'etc > linux' 카테고리의 다른 글

linux ftp  (0) 2022.04.23
chmod  (0) 2022.04.20
.bashrc (alias)  (0) 2022.04.20
linux 시간동기화  (0) 2022.04.18
ls -al 결과의 의미  (0) 2022.04.18
반응형
  • DB timezone설정이 utc이면 current_timestamp=utc_timestamp이지만, 아니면 다름, 즉, current_timestamp = now() != utc_timestamp
    • select current_timestamp; -- 2022-04-22 16:06:16
      select current_time; -- 16:06:08
      select current_date; -- 2022-04-22
      select utc_timestamp; -- 2022-04-22 07:06:38
      select utc_time; -- 07:06:52
      select utc_date; -- 2022-04-22
      select now(); -- 2022-04-22 16:07:17
  • date, time, timestamp 차이
    • date: 날짜만 보여주고 날짜 정보까지만 가짐
    • time: 시간만 보여주지만 날짜 + 시간정보 모두 가짐
    • timestamp: 시간 full로 보여줌
    • 다음과 같이 function으로도 사용가능
select current_date, date(current_date), time(current_date), timestamp(current_date);
select current_time, date(current_time), time(current_time), timestamp(current_time);
select current_timestamp, date(current_timestamp), time(current_timestamp), timestamp(current_timestamp);
  • 날짜 더하기빼기: +1로 일단위,초단위 가능, 시간단위로 하려면 date_add 써야함
    • select utc_timestamp -- 2022-04-22 07:17:22
      union all
      select utc_timestamp + 1 -- 20220422071651 (+ 1 second)
      union all
      select utc_time + 1 -- 71651 (+ 1 second)
      union all
      select utc_date + 1 -- 20220423 (+ 1 day)
    • select current_timestamp() -- 2022-04-22 16:21:07
      union all
      select current_timestamp + 1 -- 20220422162108 (+ 1 second)
      union all
      select current_time + 1 -- 162108 (+ 1 second)
      union all
      select current_date + 1 -- 20220423 (+ 1 day)
    • select DATE_ADD(current_timestamp, interval 20 hour) -- 2022-04-23 00:00:00
      select DATE_ADD(current_date, interval 1 day)-- 2022-04-23
      select DATE_ADD(now(), interval 1 day)-- 2022-04-23 16:10:08
반응형

'db' 카테고리의 다른 글

mysql 한글깨짐  (0) 2022.04.26
mysql console 접속  (0) 2022.04.26
우분투 18.04 MongoDB 설치 및 구성  (0) 2022.04.18
mysql remote 접속허용  (0) 2022.04.14
mysql numeric type  (0) 2020.11.05
반응형

사용법: chmod [option-생략가능] mode fileName

mode 작성법: read=4, write=2, execute=1

755 = (소유주) 4+2+1, (소유그룹) 4+0+1,  (others) 4+0+1
644 = (소유주) 4+2+0, (소유그룹) 4+0+0, (otehrs) 4+0+0

  • 7 read write execute 모두가능
  • 6 read write 가능하지만 execute불가능
  • 5 read execute 가능 write불가능
  • 4 read 만 가능

 

  • 디렉토리에 대한 execute는 어떤 의미? read write를 하기 위한 기본접근권한, execute없이는 read write도 안된다고 함 즉, 6(rw-)는 실질적으로 의미가 없고 0(---)과 같다는 의미인지??
  • 기본적으로 디렉토리는 755, 파일은 644인 것 같음,  why?

 

  • WAS에서 multipartFile받아서 임시로 내부 디렉토리에 저장하려고 하니 권한에러 발생
  • 권한찾아보니 755였음, 775로 고쳐도 계속 에러남, 777로 고쳐서 성공

 

반응형

'etc > linux' 카테고리의 다른 글

linux ftp  (0) 2022.04.23
linux 압축  (0) 2022.04.23
.bashrc (alias)  (0) 2022.04.20
linux 시간동기화  (0) 2022.04.18
ls -al 결과의 의미  (0) 2022.04.18
반응형

개인 ALIAS 생성

  • home directory의 .bashrc 파일을 vi로 열어서 아래와 같은 aliase 추가가능
  • alias goeic='ssh -i .ssh/key-ew1-sdp-qa2-was-sdpbat.pem sdpbat@10.150.33.137 -p 40022'
    alias goaic='ssh -i .ssh/key-uw2-sdp-qa2-was-sdpbat.pem sdpbat@10.150.33.129 -p 40022'
    alias gokic='ssh -i .ssh/key-an2-sdp-qa2-was-sdpbat.pem sdpbat@10.150.33.156 -p 40022'
  • 수정한뒤 wq로 저장하고 . .bashrc라는 명령어 수행해야 적용됨

alias : 모든 사용가능한 alias확인
alias추가 .bashrc(또는 .bash_aliases파일 만들어서 그안에) 에 alias ()=''로 추가 -> source .bashrc (또는 source ~/.bashrc) [옛날에 정리해놓을 거 보니 ..bashrc도 된다함, 이게 더 간단하니 좋네]-> 이제 사용가능
참고: https://ojava.tistory.com/153

ssh접속시 원하는 디렉토리로 바로 이동
ssh -t x.x.x.x "cd /xx ; bash"로 하면 된다고 하는데 alias로는 안됨 뭔가 더해야하나봄
참고: https://outofgreed.tistory.com/313 https://stackoverflow.com/questions/626533/how-can-i-ssh-directly-to-a-particular-directory

etc/profile ./profile /etc/bashrc .bashrc차이는 뭘까
etc/xx는 전체공통 .xx는 그 계정에서만 유효
profile-system wide environment and startup progams for login setup (환경설정)
bashrc-system wide function and alias (함수나 alias)
각각의 용도에 대해서 vim으로 열어보면 처음에 comment로 나와있음 - 친절하군ㅋ

반응형

'etc > linux' 카테고리의 다른 글

linux 압축  (0) 2022.04.23
chmod  (0) 2022.04.20
linux 시간동기화  (0) 2022.04.18
ls -al 결과의 의미  (0) 2022.04.18
linux 사양확인  (0) 2022.04.18
반응형
  • 장점
    • DB기반으로 스케쥴러간 clustering 기능제공 -> ???
    • system fail-over와 random방식 로드분산처리 지원 -> ???
    • in-memory job scheduler 제공
    • 여러 기본 plugin 제공
    • shutdownHookPlugin - JVM 종료 이벤트를 캐치해서 스케줄러에게 종료를 알려줌
    • LoggingJobHistoryPlugin - job실행에 대한 로그를 남겨 디버깅할 때 유용함
  • 단점
    • clustering을 제공하지만 단순한 랜덤방식이라서 완벽한 cluster간의 로드 분산은 안됨
    • 어드민 UI제공안됨
    • 스케쥴링 실행에 대한 history보관안함
    • fixed delay 타입 보장하지 않으므로 추가작업 필요
  • how to manually trigger job
    • update qrtz_triggers set next_fire_time = 0 (이전보다 작은 시간으로 바꾸면 자동실행됨)
  • job삭제시 주의사항
    •  삭제하려는 job정보를 DB quartz 테이블에서 삭제하지 않고 소스만 삭제하고 돌리면 에러발생
      • qrtz_cron_triggers삭제후 -> qrtz_trigger삭제해야함
      • qrtz_job_details 삭제안해도 에러는 안났음
      • Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'schedulerFactoryBean'; nested exception is org.springframework.scheduling.SchedulingException: Could not start Quartz Scheduler; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't store trigger 'DEFAULT.Sync_ibs_channel_map_data_batch_trigger' for 'DEFAULT.BATCH_IBS_CHANNEL_MAP_SYNC' job:Couldn't retrieve job because a required class was not found: com.lge.cdp.batch.CollectIbsChMapJob [See nested exception: org.quartz.JobPersistenceException: Couldn't retrieve job because a required class was not found: com.lge.cdp.batch.CollectIbsChMapJob [See nested exception: java.lang.ClassNotFoundException:
반응형

'java, spring' 카테고리의 다른 글

400Bad Request: 필수파라미터 누락 등의 에러, 삽질방지위해서는 에러메세지 잘보자!  (0) 2024.01.19
java stream  (0) 2022.04.28
Tomcat's directories  (0) 2021.03.03
Java Web Application  (0) 2021.03.02
tomcat  (0) 2021.03.02
반응형
반응형

'db' 카테고리의 다른 글

mysql console 접속  (0) 2022.04.26
mysql date/time  (0) 2022.04.22
mysql remote 접속허용  (0) 2022.04.14
mysql numeric type  (0) 2020.11.05
mysql error - Invalid use of NULL value (이미 null들어간 column not null로 만들때 에러)  (0) 2020.05.25
반응형
  • 현재시간 확인명령어: date
  • 시간, timezone등 자세히 확인: timedatectl
  • 시간동기화 명령어: rdate -s time.bora.net (시간 동기화 서버는 다른 서버이용해도 됨, 검색시 나옴)
  • rdate가 알수 없는 명령어라든지 설치안되었다는 메세지가 뜨면 apt-get install rdate 실행해서 설치 
  • 10.186.119.102 서버에서는 root 권한(sudo)으로만 설치 및 실행 가능했음
반응형

'etc > linux' 카테고리의 다른 글

chmod  (0) 2022.04.20
.bashrc (alias)  (0) 2022.04.20
ls -al 결과의 의미  (0) 2022.04.18
linux 사양확인  (0) 2022.04.18
linux 원격접속  (0) 2022.04.07
반응형

ls -al 결과의 의미

drwxr-xr-x 3(하드링크 수) sdpbat sdpadm 4096 Jun 8 05:10 crawlego
-rw-r--r-- 1(하드링크 수) sdpbat sdpadm 257976 Jun 22 06:06 let-it-go.log

1) 디렉토리인지 파일인지, 디렉토리는 d
2) 소유주에 대한 권한 rwx
3) 소유그룹에 대한 권한 rwx
4) others에 대한 권한 rwx
5) 하드링크의 수, 이 문서에 연결된 하드링크의 수, 윈도우의 바로가기 개념과 비슷하다고 함
6) 소유주
7) 소유그룹 
8) 용량(Byte단위)
9) 생성날짜
10) 이름

참고: http://www.incodom.kr/Linux/%EA%B8%B0%EB%B3%B8%EB%AA%85%EB%A0%B9%EC%96%B4/ls (매우 친절하게 설명해줌)

반응형

'etc > linux' 카테고리의 다른 글

.bashrc (alias)  (0) 2022.04.20
linux 시간동기화  (0) 2022.04.18
linux 사양확인  (0) 2022.04.18
linux 원격접속  (0) 2022.04.07
linux java process 찾기, java 실행  (0) 2020.01.31
반응형
  • 우분투 버젼확인: lsb_release -dc

Description: Ubuntu 18.04.5 LTS
Codename: bionic


cpu는 제조사에 따라, intel cpu, amd cpu, arm cpu로 나누어 집니다. 

* cisc구조 - intel cpu, amd cpu (보통 intel 호환 cpu라고 함)

* risc 구조 - arm cpu

그리고 cpu 명령어 구조에 따라 실행할 수 있는 바이너리가 달라집니다.

x86, 86-32bit, x86-64bit, x64 등은 intel (호환) cpu의 bit 수를 부를 때 사용하는 말입니다. 전통적으로 intel cpu용 바이너리는 x86, x64 라는 이름을 사용합니다. 

* x86, x86-32bit : 32bit intel (호환) cpu

* x86-64bit, x64 : 64bit intel (호환) cpu

arm cpu는 비트수를 부를 때는 보통 아래와 같이 사용하는 듯 합니다.
* arm : 32bit arm cpu

* arm64: 64bit arm cpu

리눅스는 운영체제이고 소프트웨어 입니다. 리눅스를 설치하기 위해서는 설치할 컴퓨터가 intel cpu이면, intel 32bit(or 64bit) 바이너리를 다운로드 받아야 하고, arm cpu이면 arm 32bit(or 64bit) 바이너리를 다운받아야 합니다.

그래서 x86인지, arm인지, 32bit인지 64bit인지 이해하고 본인의 컴퓨터에 맞는 리눅스를 설치하면 됩니다.

반응형

'etc > linux' 카테고리의 다른 글

linux 시간동기화  (0) 2022.04.18
ls -al 결과의 의미  (0) 2022.04.18
linux 원격접속  (0) 2022.04.07
linux java process 찾기, java 실행  (0) 2020.01.31
리눅스 PC에 백업  (0) 2019.07.26
반응형
  • 계정추가
    • select * from mysql.user로 현재 모든 user확인
    • create user 'root'@'%' identified by 'password'로 외부접속 가능한 계정을 추가
    • root@127.0.0.1만 있으면 localhost에서만 접속이 가능, root@%로 해서 외부접근 가능하도록 해줌
    • show grants for root@'%'로 권한확인
    • grant all privileges of *.* fo root@'%'로 권한추가해줌
  • mysql port 변경, 외부접속 허용
    • sudo vi /etc/mysql/mysql.conf.d/mysqld.conf로 설정파일 확인 (경로는 다를수 있음)
    • vi sudo로 안열면 readonly라서 안고쳐짐
    • 기본포트는 3306, port찾아서 변경가능
    • bind-address=127.0.0.1이거 있으면 외부접속 안됨, 주석처리해줌
    • 변경후 sudo service mysql restart로 재시작

 

반응형

+ Recent posts