[컴] Galera 에서 Primary Component 란?

갈레라 /

Galera 에서 Primary Component 란?

from : The Primary Component in Galera Cluster — Galera Cluster Documentation

The Primary Component is that set of Galera nodes that can communicate with each other over the network and contains the majority of the nodes. In case of a network partition, it is those nodes that can safely commit a transaction. A cluster can only have one such set of nodes, as there can only be one majority. No other set of nodes will commit transactions, thus removing the possibility of two parts of the cluster committing different transactions and thus diverging and becoming inconsistent.

The Primary Component는 네트워크를 통해 서로 통신할 수 있고, majority of nodes를 포함하는 Galera 노드들의 집합이다. 네트워크 파티션에서는, 트랜잭션을 안전하게 commit할 수 있는 노드들이다. 클러스터에 과반수(majority)는 하나만 있을 것이기에 Primary Component 도 하나뿐이다. 다른 노드들의 집합은 트랜잭션을 commit 하지 않는다. 그렇게 해서, 클러스터의 두 부분이, 서로 다른 트랜잭션을 commit하여 diverging되고, inconsistent될 가능성을 제거한다.

See Also

  1. 쿠…sal: [컴][db] Galera Replication
  2. 쿠…sal: [컴][db] MariaDB Galera cluster 설정

[컴] open api key 얻는법

무료 / 테스트 / 개발용/chatgpt / gpt

open api key 얻는법

처음 가입하면, 무료로 일정기간 사용해 볼 수 있다. 바로 아래 page 로 접근해서 sign up 을 하고, login 을 하자.

[컴] espanso, text 확장기, 내설정

 

copilot / 코딩 / suggest / candidate / 예상 / text expander

espanso, text 확장기, 내설정

  • path: %appdata%\espanso\match\base.yml
# espanso match file

# For a complete introduction, visit the official docs at: https://espanso.org/docs/

# You can use this file to define the base matches (aka snippets)
# that will be available in every application when using espanso.

# Matches are substitution rules: when you type the "trigger" string
# it gets replaced by the "replace" string.
matches:
  # NOTE: espanso uses YAML to define matches, so pay attention to the indentation!

  # But matches can also be dynamic:

  # Print the current date
  - trigger: ":now"
    replace: "{{mydate}}"
    vars:
      - name: mydate
        type: date
        params:
          format: "%Y-%m-%d %H:%M"

  # Print the output of a shell command
  - trigger: ":shell"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "echo 'Hello from your shell'"

  # Print the output of a shell command
  - trigger: ":s2"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "dir"

  - trigger: ":ip"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "curl https://api.ipify.org"
          shell: cmd

  - trigger: ":dq"
    replace: "\\x22"

  - trigger: ":dbdump"
    replace: "mysqldump.exe -h localhost -u userid -P 7307 -p --single-transaction mydb table1 table2 table3 > mydb-1212.sql"
  - trigger: ":db_realdb_snapshot"
    replace: "-- created_at은 UTC\n\x22d:\\a\\appss\\MariaDB 10.5\\bin\\mysqldump.exe\x22 -h localhost -u foodpang -P 7317 -p --single-transaction foodpang snapshot_product --where=\x22created_at >= '2023-02-20' AND created_at < '2023-02-21'\x22 --no-create-info > snapshot-20230220.sql"
  - trigger: ":db_testdb_insert"
    replace: "chcp 65001\n\x22d:\\a\\appss\\MariaDB 10.5\\bin\\mysql.exe\x22 -u foodpang -P 7307 -p foodpang < snapshot-20230220.sql"
  - trigger: ":db_delete_all"
    replace: "DELETE FROM product_purchase where id > 0;\nALTER TABLE product_purchase AUTO_INCREMENT=1;"

  - trigger: ":dbinsert"
    replace: "chcp 65001 && \"d:\\a\\appss\\MariaDB 10.5\\bin\\mysql.exe\" -u root -P 3306 -p foodpang_analysis < d:\\a\\prog\\foodpang\\purchase\\rds-mydb.sql"
  - trigger: ":dbtimezone"
    replace: "SET @original_time_zone = @@session.time_zone;SET time_zone = 'Asia/Seoul';"

  - trigger: ":cutf"
    replace: "chcp 65001"

  - trigger: ":git-flow-feature"
    replace: "git flow feature"
  - trigger: ":git-undo-commit-to-stage"
    replace: "git reset --soft HEAD~1"
  - trigger: ":git-checkout"
    replace: "git checkout"
  - trigger: ":git-commit"
    form: |
      'git commit -m "[[message]]"'
  - trigger: ":git-branch-name-copy"
    replace: |
              for /f "delims=" %a in ('git --no-pager branch ^| d:\a\apps\fzf\fzf.exe +m') do @set branch=%a && echo !branch:~2,-1! | clip
  - trigger: ":git-checkout-branch"
    replace: |
              for /f "delims=" %a in ('git --no-pager branch ^| d:\a\apps\fzf\fzf.exe +m') do @set branch=%a && git checkout !branch:~2,-1!
  - trigger: ":git-delete-branch"
    replace: |
              echo need cmd /v && for /f "delims=" %a in ('git --no-pager branch ^| d:\a\apps\fzf\fzf.exe +m') do @set branch=%a && git branch !branch:~2,-1! -d
  - trigger: ":git-cbranch2"
    replace: |
              "d:\a\appss\TortoiseGit\bin\TortoiseGitProc.exe" /command:switch
  # markdown
  - trigger: ":img"
    replace: "![]('{{clipboard}}')"
    vars:
      - name: "clipboard"
        type: "clipboard"
  # markdown
  - trigger: ":ref"
    replace: "## References\n"


  # And much more! For more information, visit the docs: https://espanso.org/docs/

[컴] 카톡 오픈채팅 해킹 관련 정보 모음, 2023-03

 

kakao kakaotalk / open chat profile id to real profile id /

카톡 오픈채팅 해킹 관련 정보 모음, 2023-03

[단독]카톡 오픈채팅 해킹…1명당 단가 7000원·2시간 만에 ‘뚝딱’

전문가들은 추출한 유저아이디를 통해 해커가 이용자의 ‘실제 프로필 아이디’ 또는 ‘전화번호’ 정보에 접근했을 가능성에 주목했다. 실제 개발자 커뮤니티 ‘깃허브’ 등에서는 오픈채팅 유저아이디와 실제 프로필 아이디를 연결하는 로직(규칙성)을 추정하는 연구가 오랫동안 이뤄졌다.

from: [단독]카톡 ‘오픈채팅’ 보안 구멍 뚫렸다

위조 클라이언트를 이용해 특정 오픈채팅방에 접속하면 숫자로 구성된 유저아이디를 추출할 수 있다. 최근 이 유저아이디와 연결된 카카오톡 이용자의 프로필 정보를 캐낼 수 있는 보안 취약점이 발견됐다. 이용자가 카카오톡에 등록한 이름, 전화번호, 이메일도 이와 같은 경로로 유출됐다.

… 카카오는 이용자 신상정보를 유출하는 열쇠로 추정되는 ’유저아이디’를 오픈채팅방에서 더 이상 추출할 수 없도록 12일 조치를 취했다고 입장을 알려왔다. 신상이 유출된 오픈카톡방과 불법이용자에 대해서도 이를 특정하는데 성공했다고 설명했다.

카카오 관계자는 “해당 어뷰징 행위를 인지한 직후, 해당 채팅방 및 어뷰저에 대한 조치를 진행했다”며 “다만 오픈 채팅 상에서 참여자 전화번호나 이메일, 대화내용 등을 확인하는 것은 불가능한 사안으로, 오픈 채팅 외의 다른 수단이 함께 활용한 것으로 판단하고 있다”고 말했다.

from: https://www.hankyung.com/it/article/202303148352i

14일 정보기술(IT)업계에 따르면 지난 1월 카카오 플랫폼 서비스 관련 개발자 커뮤니티인 ’카카오 데브톡’에는 ’카카오톡 오픈채팅방의 보안 허점과 개인정보 누출’이라는 제목의 글이 올라왔습니다.

카카오톡 메시지 전송에 쓰이는 ’로코 프로토콜’을 악용해 오픈채팅방 참여 이용자의 카카오톡 프로필 ID, 카카오톡 로그인에 쓰이는 이메일 주소, 전화번호까지 추출 할 수 있다는 경고를 담은 글입니다. 데브톡은 카카오톡, 카카오맵, 카카오페이 등 카카오 각종 서비스의 API(응용프로그램 인터페이스)와 SDK(소프트웨어 개발 도구) 등 정보를 나누는 커뮤니티입니다.

글을 올린 개발자는 해커로 추정되는 이들이 오픈채팅방에서 채팅방 익명 이용자의 실제 카카오톡 아이디와 메일주소, 전화번호를 뽑아내는 과정을 담은 스크린샷을 글에 첨부했습니다.

from: 카카오, 오픈채팅 개인정보 유출 정황에 수사기관 신고 | 아주경제

카카오가 카카오톡 오픈채팅 이용자 개인정보가 유출된 정황과 관련해 수사기관에 신고했다고 13일 밝혔다. 개인정보 유출 통로로 의심되는 카카오톡의 취약점을 이미 수년 전 보완해 기술적으로는 더 조치할 게 없다는 입장이다. 다만 내부 조사를 통해 신규 어뷰징 방식으로 인한 개인정보 유출 건이라고 판단, 별도 보안 조치를 완료했다.

from: 정부 ‘카카오톡 오픈채팅’ 보안 취약점 조사 - 전자신문

과기정통부 관계자는 13일 “카카오톡 오픈채팅방의 취약점과 그로 인한 개인정보 유출 가능성이 제기된 만큼 바로 조사를 시작했다”고 밝혔다.

from: 오픈 프로필 id와 실제 프로필 id · storycraft/node-kakao · Discussion #652 · GitHub

2020년 8월 이전에 생성된 채팅방에서는 오픈 프로필 id와 실제 프로필 id의 로직이 확실히 존재한다는 것을 알았고 이 로직을 똑같이 2021년 이후에 생성된 채팅방에서 적용 해보았으나 전혀 구해지지 않았습니다.

References

  1. [단독]카톡 오픈채팅 해킹…1명당 단가 7000원·2시간 만에 ‘뚝딱’
  2. GitHub - storycraft/node-kakao: Loco protocol compatible library
  3. Facebook 5th Analysis Guide
  4. LOCO 프로토콜 분석과 구현
  5. 익명 오픈채팅방도 다 털려…카카오는 이미 알고 있었다 선한결의 IT포커스 | 한국경제
  6. [단독]카톡 '오픈채팅' 보안 구멍 뚫렸다

[컴] windows batch 의 EnableDelayedExpansion

왜 한줄 command 에서 set 이 동작하지 않는가 / doskey 설정시 주의할 점 / 문제점 / windows batch programming 문제

windows batch 의 EnableDelayedExpansion

  • EnableDelayedExpansion 은 기본적으로 cmd 에서 Disabled 되어 있다.
  • cmd /v 로 활성화 될 수 있다.
  • SETLOCAL DisableDelayedExpansion 로 끌 수 있다.(다만 .bat file 내에서 가능한 듯 하다. cmd 창에서 실행하면 유지 되지 않는 것 처럼 보인다.)
  • registry 로 활성화 할 수 있다. 그런데 추천하지 않는다. 기본값을 변경하면, 기존의 script 가 break 될 수 있다.
  • 그리고 ! 를 바로 사용할 수 없다. (참고)

Why this behaviour? The SET command was first introduced with MS-DOS 2.0 in March 1983, at that time memory and CPU were very limited and the expansion of variables once per line was enough. Delayed Expansion was introduced some 16 years later in 1999 by which time millions of batch files had been written using the earlier syntax. Retaining immediate expansion as the default preserved backwards compatibility with existing batch files.

This is not how anyone would design a language if starting from scratch, indeed PowerShell behaves like this:

PS C:> $demo = “First” PS C:> $demo = “Second” ; echo $demo Second

See Also

  1. 쿠…sal: [컴] windows batch programming 관련 글

Reference

  1. EnableDelayedExpansion - Windows CMD - SS64.com

[컴][웹] web 용 end-to-end test tool

테스트 / 웹 테스트 / 웹화면 테스트 / 자동화 / unittest / test / behavior test

web 용 end-to-end test tool

See Also

  1. 쿠…sal: [컴][nodejs] mocha, chai, sinon

[컴][웹] js runtime

 

javascript engine / 자바스크립트 런타임 /

js runtime

js runtime 이 여러개인 이유는 서버쪽에서의 사용을 위해서이다. client 쪽에서는 browser 에 포함되어(embeded) 있기 때문에 다른 runtime 을 쓰는 것이 어렵지만, 서버쪽은 그렇지 않다.

이것은 이전의 다른 언어에서 비슷한 특징을 찾는다면 java의 jvm 이나, python 의 interpreter 들이 있을 듯 하다. jvm 도 여러회사에서 각자의 jvm 버전을 가지고 있으며, python 의 pypy 같은 다른 interpreter 가 있다.

How does Bun work?

Bun uses the JavaScriptCore engine, which tends to start and perform a little faster than more traditional choices like V8. Bun is written in zig, a low-level programming language with manual memory management.

Most of Bun is written from scratch including the JSX/TypeScript transpiler, npm client, bundler, SQLite client, HTTP client, WebSocket client and more. Why is Bun fast?

An enormous amount of time spent profiling, benchmarking and optimizing things. The answer is different for every part of Bun, but one general theme: ’s low-level control over memory and lack of hidden control flow makes it much simpler to write fast software.

deepl 번역:

Bun은 어떻게 작동하나요?

Bun은 JavaScriptCore 엔진을 사용하는데, 이는 V8과 같은 기존 엔진보다 시작과 실행 속도가 조금 더 빠릅니다. Bun은 수동 메모리 관리 기능을 갖춘 저수준 프로그래밍 언어인 zig로 작성되었습니다.

JSX/TypeScript 트랜스파일러, npm 클라이언트, 번들러, SQLite 클라이언트, HTTP 클라이언트, 웹소켓 클라이언트 등 Bun의 대부분은 처음부터 새로 작성되었습니다. Bun이 빠른 이유는 무엇인가요?

프로파일링, 벤치마킹, 최적화에 엄청난 시간을 투자하기 때문입니다. Bun의 각 부분마다 답은 다르지만 한 가지 일반적인 주제가 있습니다: 메모리에 대한 낮은 수준의 제어와 숨겨진 제어 흐름이 없기 때문에 빠른 소프트웨어를 훨씬 더 간단하게 작성할 수 있다는 것입니다. Zig 소프트웨어 재단을 후원하세요.