<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.3">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-03-16T13:48:51+09:00</updated><id>/feed.xml</id><title type="html">Seunghyun Yoo</title><entry><title type="html">The importance of a good data structure</title><link href="/2024/09/09/the-importance-of-a-good-data-structure.html" rel="alternate" type="text/html" title="The importance of a good data structure" /><published>2024-09-09T00:00:00+09:00</published><updated>2024-09-09T00:00:00+09:00</updated><id>/2024/09/09/the-importance-of-a-good-data-structure</id><content type="html" xml:base="/2024/09/09/the-importance-of-a-good-data-structure.html"><![CDATA[<p>Posting in Korean:</p>

<p>Linus Torvalds가 한 말이라고 한다. 최근 내 경험과도 맞닿아 있어 이 글을 써본다.</p>

<blockquote>
  <p>“Bad programmers worry about the code. Good programmers worry about data structures and their relationships.”</p>
</blockquote>

<p>위 말은 요약된 버전같고, 조금 더 구체적인 맥락은 git의 설계 철학과 관련이 있다.</p>

<blockquote>
  <p>“git actually has a simple design, with stable and reasonably well-documented data structures. In fact, I’m a huge proponent of designing your code around the data, rather than the other way around, and I think it’s one of the reasons git has been fairly successful […] I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important.”</p>
</blockquote>

<p>git은 commit이 정점(node)가 되는 tree 구조로 볼 수 있는데, 변화들을 추적해나간다는 관점에서 commit에는 hash가 붙어 불변성이 부여된다. 뜬금없는 예시일 수 있지만, blockchain에서의 block (transactions의 모음으로)이 git의 commit에 대응되고, transaction들은 코드 상의 변화에 해당하는 delta, 그리고 각 commit간의 관계는 hash chain으로 parent의 hash를 참조하는 구조다. 데이터 구조 관점에서 보면 전체적인 형태는 거의 같다. git과 blockchain이 다른 문제를 풀고자 했던 것이 아니라, 결국은 분산된 환경에서  consensus를 형성하는 것이 중요했고, 과거 내용이 변경되면 굉장한 혼란을 초래할 수 있기 때문에 둘 다 필연적으로 append-only 구조로 수렴하게 되었다.</p>

<p>내가 진행하는 프로젝트도 크게 두-세 가지 정도의 추상화를 적용하고 나면, 핵심은 몇십 줄 안으로 압축되고, 나머지는 추상적 대상의 구체화 역할만 맡게 된다. 이후에는 집중적으로 노력을 들여야할 부분과 그렇지 않은 부분들을 구분할 수 있어 구현 비용을 크게 줄일 수 있다.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Posting in Korean:]]></summary></entry><entry><title type="html">How AI tools are affecting me</title><link href="/2024/09/07/how-ai-tools-are-affecting-me.html" rel="alternate" type="text/html" title="How AI tools are affecting me" /><published>2024-09-07T00:00:00+09:00</published><updated>2024-09-07T00:00:00+09:00</updated><id>/2024/09/07/how-ai-tools-are-affecting-me</id><content type="html" xml:base="/2024/09/07/how-ai-tools-are-affecting-me.html"><![CDATA[<p>Posting in Korean:</p>

<p>내가 ‘AI’를 바라보는 관점은 다음과 같다.</p>

<p>방대한 파라미터와 이를 효과적으로 담을 수 있는 네트워크 구조를 통해 ‘무언가’를 학습한다.
비정형 입력과 출력을 처리할 수 있는 네트워크 구조는 상호 작용이 가능하다. 이는 마치 지식 그래프에서 방향을 제시하는 지도처럼 보이기도 한다.
무생물이기 때문에, 사람이 지닌 한계에 제약받지 않는다.</p>

<p>비정형 데이터의 입출력이 가능해지면서 다양한 가능성을 마주하게 된다.
학부 시절, “화학 구조식을 그림으로 입력해서 검색할 수 있었으면 좋겠다”거나 “전자 회로도를 입력하면 유사한 회로도나 그에 대한 설명을 찾아줬으면 좋겠다”라는 생각들이 있었다.
이제는 이런 바람들이 어느 정도 현실화되고 있다. 예를 들어 OP Amp 741의 회로도를 입력하고 각 트랜지스터와 캐패시터의 기능을 물으면 즉시 그 역할과 설명을 찾아볼 수 있다. 대상의 이름이나 기능을 정확히 몰라도 어디서부터 시작해야 하는지 방향을 제시해 주는 것이다. 또한 비정형 데이터를 정형 데이터로 변환하는 것도 당연히 가능한데, 데이터를 정형화할 수 있다면 기존에 연역적 로직들을 그대로 적용할 수 있게 된다. 초창기 GPT 버전은 계산도 제대로 못한다는 비판이 있었지만, 빈칸들을 찾아내서 연역적 로직을 붙이는 것만으로도 계산 오류들에서 벗어날 수 있게 된다. 귀납적인 방식으로 (머신러닝) 근사적인 해결책을 찾을 수 있기도 하다.</p>

<p>AI를 자동 완성 도구처럼 사용할 때는, 큰 그림을 그리고 그 안에서 세부적인 요소들을 채워나가는 과정에서 유용하게 활용하게 된다. 지도처럼 사용할 때는 새로운 분야를 탐색할 때 어떤 키워드부터 시작해야할지 시작 node들을 쉽게 파악할 수 있게 된다. 내가 놓칠 수 있는 부분들을 점검하게 하면서 그래프에서 예상치 못한 곁가지를 확인해볼 수도 있다. 이런 작업들을 AI 도구들을 통해 수행하면서 필연적으로 느꼈던 피로감이나 심리적인 장벽들이 상당히 내려온 상태. 글을 쓸 때 자주 겪었던 <a href="https://en.wikipedia.org/wiki/Writer%27s_block">Writer’s block</a>도 해결하는데 도움이 많이 된다. 하다못해 현재 홈페이지에 올린 고양이도 Dalle-E가 그려준 것이다. 그래서 생산성이 10-100x 정도 올라간다고 다소 과장 섞인 말들이 나오기도 하는 것 같다. 개인적으로는 100x가 나오게 되면 그건 원래 방식에 심각한 문제가 있었다고 생각하긴 하지만… 🤣</p>

<p>다만 이 도구로 인해 무언가를 생성하는데도 비용이 확 내려가면서 필연적으로 발생하는 Feedback loop는 우려스럽다. AI 도구로 생성해내는 것들을 어디까지 신뢰할 수 있을지, 교차검증에 드는 비용, 처음부터 다시 만들어야 하는 잠재적인 비용들이 얼마나 될지는 잘 모르는 상태다. 하지만 개인 한 명이 이뤄낼 수 있는 일의 규모가 확 커졌기 때문에 예전으로 돌아갈 수 있을 것 같지는 않다.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Posting in Korean:]]></summary></entry><entry><title type="html">Amazon Linux 2023 and WebDAV</title><link href="/2024/03/31/amazon-linux-2023-and-webdav.html" rel="alternate" type="text/html" title="Amazon Linux 2023 and WebDAV" /><published>2024-03-31T00:00:00+09:00</published><updated>2024-03-31T00:00:00+09:00</updated><id>/2024/03/31/amazon-linux-2023-and-webdav</id><content type="html" xml:base="/2024/03/31/amazon-linux-2023-and-webdav.html"><![CDATA[<p>서지 관리 프로그램인 Zotero에서 사용하기 위해 WebDAV를 Amazon Linux 2023에서 활성화시키려 했으나, 아래와 같은 에러가 발생했다.</p>

<p><code class="language-plaintext highlighter-rouge">[dav_fs:crit] [pid 2987220:tid 2987330] (20019)DSO load failed: AH00576: The DBM driver could not be loaded</code></p>

<p>결론적으로 문제를 직접 해결하기보다는 AL2023 대신에 Ubuntu를 쓰는 것으로 합의를 보려고 한다. <a href="https://packages.fedoraproject.org/pkgs/apr-util/apr-util-bdb/index.html">apr-util-bdb</a> 패키지가 있어야 하는 것으로 보이는데 모종의 이유로 제거된 것 같고, Apache2를 직접 빌드하면 가능해보이긴 하나… AL2023을 현재 내가 반드시 써야하는 이유는 없기 때문이다. (<del>귀찮다</del>)</p>

<p>AWS는 최대한 경량 버전의 리눅스를 배포하는 것이 중요한지 이런 부분까지는 지원하지 않는 정책을 택한 것으로 보인다.</p>

<ul>
  <li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=1491151">Link 1: bugzilla-redhat</a></li>
  <li><a href="https://github.com/amazonlinux/amazon-linux-2023/issues/393">Link 2: github-amazonlinux</a></li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[서지 관리 프로그램인 Zotero에서 사용하기 위해 WebDAV를 Amazon Linux 2023에서 활성화시키려 했으나, 아래와 같은 에러가 발생했다.]]></summary></entry><entry><title type="html">Jupyter Notebook</title><link href="/2024/03/24/jupyter-notebook.html" rel="alternate" type="text/html" title="Jupyter Notebook" /><published>2024-03-24T00:00:00+09:00</published><updated>2024-03-24T00:00:00+09:00</updated><id>/2024/03/24/jupyter-notebook</id><content type="html" xml:base="/2024/03/24/jupyter-notebook.html"><![CDATA[<p>파이썬을 활용하여 데이터를 다뤄보려는 사람들 중에서 주피터 노트북을 써보지 않은 사람은 아마 없을 것이다. 나 역시도 처음에 주피터 노트북을 접했을 때 Interactive한 작성 과정이 신선하고 편하게 느껴졌다. 파이썬에서 어떤 데이터를 코드를 통해서 처리하게 되었을 때 어떤 형태로 변환되는지를 눈으로 바로 확인할 수 있기 때문이다.</p>

<p>하지만 주피터 노트북으로 작성된 코드들에는 다음과 같은 문제점들이 자주 관찰된다.</p>

<ul>
  <li>사용이 되지 않는 변수 등이 제거되지 않아 혼란을 준다.</li>
  <li>실행 순서가 순방향이 아닌 경우도 있고, 중간에 스킵해야 하는 경우도 있다. 잘 동작하지 않는 셀을 건너뛰는 것은 작성자는 아는데, 다른 사람들은 알기 어렵다.</li>
  <li>모듈화에 대한 개념이 약해지고, Copy-and-paste 코드들이 늘어나는 경향</li>
  <li>전역 변수 사용이 빈번해진다.</li>
  <li>버전 관리가 잘 되기 어렵다. JSON 뭉치이기 때문이다.</li>
</ul>

<p>REPL의 장점이 분명히 있으므로 높은 자유도를 즐기지만 한 두번 정도의 리팩토링을 시도해보는 것이 적절한 타협선이라 생각한다.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[파이썬을 활용하여 데이터를 다뤄보려는 사람들 중에서 주피터 노트북을 써보지 않은 사람은 아마 없을 것이다. 나 역시도 처음에 주피터 노트북을 접했을 때 Interactive한 작성 과정이 신선하고 편하게 느껴졌다. 파이썬에서 어떤 데이터를 코드를 통해서 처리하게 되었을 때 어떤 형태로 변환되는지를 눈으로 바로 확인할 수 있기 때문이다.]]></summary></entry><entry><title type="html">pypiserver on Apache2 + WSGI</title><link href="/2024/02/25/pypiserver-on-apache2-plus-wsgi.html" rel="alternate" type="text/html" title="pypiserver on Apache2 + WSGI" /><published>2024-02-25T00:00:00+09:00</published><updated>2024-02-25T00:00:00+09:00</updated><id>/2024/02/25/pypiserver-on-apache2-plus-wsgi</id><content type="html" xml:base="/2024/02/25/pypiserver-on-apache2-plus-wsgi.html"><![CDATA[<h3 id="개요">개요</h3>

<p>pypiserver는 Python 패키지를 업로드할 수 있는 인덱스 구현체 중 하나다. <code class="language-plaintext highlighter-rouge">pip3 install &lt;package name&gt;</code>을 실행하면 어딘가에서 패키지를 다운로드할 수 있는데, 이 과정에서 패키지 인덱스에서 검색하고 다운로드할 수 있게 된다. 패키지 개발자들은 보통 개발한 패키지를 공용 패키지 인덱스인 <a href="https://pypi.org">pypi.org</a> 에 올린다. 그러나 개인이나 조직에서 개발한 패키지들을 공용 패키지 인덱스에 올릴 수는 없으므로 사설 패키지 인덱스를 설정하려고 한다. 또한 이 과정에서 발생한 사소한(?) 문제들에 대한 troubleshooting을 다룬다.</p>

<h3 id="설치-환경">설치 환경</h3>

<p>여러 가지 방식으로 설치할 수 있는데 Ubuntu 22.04 + Apache2 + WSGI 환경으로 설정하려고 한다. Apache2는 HTTPS를 사용해야 한다.</p>

<h4 id="apache2--mod_proxy는-어떤가요">Apache2 + mod_proxy는 어떤가요?</h4>

<p>ProxyPass와 ProxyPassReserved Directives를 사용하면 동작은 한다. pypiserver에서 자체적으로 HTTPS를 지원하지는 않는다. HTTPS 연결이 들어오면 HTTP로 Reverse Proxy를 설정하게 된다. 그런데 pypiserver에서 만들어내는 HTML 출력에는 http:// 로 들어가기 때문에 이 출력을 https:// 로 변환해야 하는 문제가 생긴다. pypiserver에서 링크마다 base url을 설정할 수 있는 기능은 지원하지 않는 것으로 보인다. 그래서 이 방법은 비추천한다.</p>

<h3 id="디렉토리-구성">디렉토리 구성</h3>

<p>디렉토리 구성에는 정답은 없으나, 대략적으로</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/srv/pypiserver/wsgi/pypiserver.wsgi
/srv/pypiserver/auth/.htpasswd
/srv/pypiserver/data/ &lt;- 여기에 패키지 파일이 업로드 된다.
/srv/pypiserver/virtualenv/
</code></pre></div></div>

<p>네 개의 디렉토리로 나눌 수 있다. WSGI와 auth, data와 파이썬 실행 환경이 있는 virtualenv (!=venv)는 서로 섞지 않는 원칙을 정했다. 적어도 상대경로 참조를 통한 구닥다리 공격은 방지되었을 것이라는 가정하에…</p>

<h3 id="설정-방법">설정 방법</h3>

<h4 id="apache2-설정">Apache2 설정</h4>

<p><code class="language-plaintext highlighter-rouge">/etc/apache2/sites-enabled/default-ssl.conf</code>을 수정할 것이다.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>WSGIScriptAlias / /srv/pypiserver/wsgi/pypiserver.wsgi
WSGIDaemonProcess pypisrv user=pypisrv group=pypisrv umask=0007 \
                  processes=1 threads=5 maximum-requests=500 \
                  display-name=wsgi-pypisrv inactivity-timeout=300 \
                  python-home=/srv/pypiserver/virtualenv

&lt;Directory /srv/pypiserver/wsgi &gt;
	Require all granted
	WSGIProcessGroup        pypisrv
    WSGIApplicationGroup    %{GLOBAL}
	# Required for authentication (https://github.com/pypiserver/pypiserver/issues/288)
	WSGIPassAuthorization On
&lt;/Directory&gt;
</code></pre></div></div>

<p>의 내용을 <code class="language-plaintext highlighter-rouge">&lt;VirtualHost *:443&gt;...&lt;/VirtualHost&gt;</code> 에 끼워넣었다. WSGI에서 프로세스를 실행시키는 사용자와 그룹은 pypisrv:pypisrv로 정했다. (adduser 명령어를 참조하면 된다)</p>

<h4 id="wsgi-설정">WSGI 설정</h4>

<p>사실 이 포스팅을 하게 된 이유기도 하다. <a href="https://github.com/pypiserver/pypiserver">공식 문서</a> 에는</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import pypiserver

conf = pypiserver.default_config(
	root =          "/yoursite/packages",
	password_file = "/yoursite/htpasswd", )

application = pypiserver.app(**conf)
</code></pre></div></div>

<p>로 되어 있는데, pypiserver 2.0.1 버전에서는 default_config 가 존재하지 않는다. 문서가 업데이트되지 않은 것이다. 🫠</p>

<h4 id="pypiserverwsgi-내용">pypiserver.wsgi 내용</h4>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import pypiserver
application = pypiserver.app(roots=["/srv/pypiserver/data"], 
                             authenticate=["update", "download", "list"], 
                             password_file="/srv/pypiserver/auth/.htpasswd", 
                             overwrite=False)
</code></pre></div></div>

<ul>
  <li>authenticate의 기본값은 업로드 시에만 암호를 물어보는 <code class="language-plaintext highlighter-rouge">["update"]</code> 이나, 여기서는 비공개 패키지이므로 <code class="language-plaintext highlighter-rouge">["update", "download", "list"]</code> 까지 해서 조회, 다운로드, 업로드 시 모두 암호를 물어보도록 설정했다.</li>
  <li>한번 업로드한 패키지에 대해서는 덮어쓰는 것을 불가능하도록 하였다. 실제로 내용이 다른데, 같은 버전 넘버를 사용하지 않는다.</li>
  <li>다음으로 “roots”인데, 여기서 str의 배열을 사용하지 않고 <code class="language-plaintext highlighter-rouge">roots="/srv/pypiserver/data"</code>를 입력하게 되면 파일 시스템 전체를 훑게 된다. 따라서 503 Internal Server Error가 발생하게 되고, Apache2 로그를 살펴보면 엉뚱한 파일들을 접근하고 있는 것을 본다.</li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>return self._accessor.stat(self, follow_symlinks=follow_symlinks)[Sun Feb 25 20:56:38.478903 2024] [wsgi:error]
[pid 2407370:tid 140154756912704] [remote ***]
PermissionError: [Errno 13] Permission denied: '/opt/gitlab/embedded/service/gitlab-rails/config/redis.yml'
</code></pre></div></div>

<p>왜 이런 현상이 발생했을까? <code class="language-plaintext highlighter-rouge">"/srv/pypiserver/data"</code> 를 <code class="language-plaintext highlighter-rouge">["/", "s", "r", "v", ..., "d", "a", "t", "a"]</code> 처럼 쪼개버려 첫 <code class="language-plaintext highlighter-rouge">"/"</code> 에서 전체 파일 시스템을 읽어버리게 되는 것이다. <code class="language-plaintext highlighter-rouge">roots=["/srv/pypiserver/data"]</code> 와 같이 str 배열을 사용해야 의도한대로 동작한다. 이건 파이썬에서 duck typing이 일상이기 때문에 발생하는 문제다.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[개요]]></summary></entry><entry><title type="html">When Ctrl + W doesn’t work on Windows</title><link href="/2024/01/12/when-ctrl-w-doesnt-work-on-windows.html" rel="alternate" type="text/html" title="When Ctrl + W doesn’t work on Windows" /><published>2024-01-12T00:00:00+09:00</published><updated>2024-01-12T00:00:00+09:00</updated><id>/2024/01/12/when-ctrl-w-doesnt-work-on-windows</id><content type="html" xml:base="/2024/01/12/when-ctrl-w-doesnt-work-on-windows.html"><![CDATA[<p>Ctrl + W은 브라우저 현재 탭을 끄거나 아니면 탐색기에서 현재 창을 끄는 등의 동작을 하는 단축키다. 내게는 굉장히 사용빈도가 높은 단축키다. 그런데 언제부턴가 이러한 단축키 동작이 먹지 않는 현상이 있었다. 이런 것들은 원인을 알기 어려워 윈도우를 다시 시작하거나 했었는데, 오늘도 재발하여 하나하나 확인해본 결과…</p>

<p>Samsung Magician에서 뭔가 잘못된 것. 윈도우를 재시작하지 않고, 이 프로그램을 끄는 것만으로 Ctrl + W 동작이 되기 시작했다. Reddit에서도 유사 제보 (<a href="https://www.reddit.com/r/samsung/comments/18wdg8e/samsung_magician_breaks_controlw_in_windows/">link</a>). 댓글을 보니 v8.0.1에서는 고쳐졌다고 한다.</p>

<p>Global hotkey는 여러 프로그램이 경쟁할 수 있기 때문에, 사용자가 단축키를 설정할 수 있도록 해야한다. Shell overlay icons도 유사한 현상이 있는데 이 경우는 아예 15개로 제한이 되어 있어서 치열한 우선순위 경쟁이 벌어지는 곳이다… (<a href="https://stackoverflow.com/questions/4411336/shelliconoverlayidentifiers-why-so-few">stack overflow link</a>)</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Ctrl + W은 브라우저 현재 탭을 끄거나 아니면 탐색기에서 현재 창을 끄는 등의 동작을 하는 단축키다. 내게는 굉장히 사용빈도가 높은 단축키다. 그런데 언제부턴가 이러한 단축키 동작이 먹지 않는 현상이 있었다. 이런 것들은 원인을 알기 어려워 윈도우를 다시 시작하거나 했었는데, 오늘도 재발하여 하나하나 확인해본 결과…]]></summary></entry><entry><title type="html">Is email forwarding service safe?</title><link href="/2024/01/01/is-email-forwarding-service-safe.html" rel="alternate" type="text/html" title="Is email forwarding service safe?" /><published>2024-01-01T00:00:00+09:00</published><updated>2024-01-01T00:00:00+09:00</updated><id>/2024/01/01/is-email-forwarding-service-safe</id><content type="html" xml:base="/2024/01/01/is-email-forwarding-service-safe.html"><![CDATA[<p>Firefox Relay나 애플의 “Hide My Email”과 같은 서비스들이 요즘에 눈에 띈다. 이는 유저의 이메일 주소가 여러 군데 사이트에 사용되면서 유저의 활동 내역을 추적할 수 있기 때문에, 프라이버시를 강화하기 위해 랜덤의 이메일 주소를 발급해주고, 그 이메일 주소로 보내진 메일을 유저의 원래 이메일 주소로 포워딩해주는 방식이다.</p>

<p>결론부터 말하자면, 이메일 포워딩 서비스는 안전하지 않다고 생각한다. 아이디어 자체는 나쁘지 않지만, 이메일은 기본적으로 종단간 암호화가 적용되지 않는다. 메일을 전달하는 과정에서 유저가 어떤 이메일을 웹사이트와 주고 받는지 중간에서 볼 수 있다는 점이 문제가 된다. 정말 우려스럽다면 PGP email을 사용하면 되긴 하지만 여기는 키관리 practice부터 잘 신경써야한다.</p>

<p>비슷한 원리인 VPN은 괜찮을까? TLS와 같은 보안 프로토콜을 사용하지 않으면 마찬가지 문제를 겪을 수 있다. 하지만 요즘에는 대부분 HTTPS를 사용하기 때문에 중간에 데이터가 탈취될 위험성이 적다.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Firefox Relay나 애플의 “Hide My Email”과 같은 서비스들이 요즘에 눈에 띈다. 이는 유저의 이메일 주소가 여러 군데 사이트에 사용되면서 유저의 활동 내역을 추적할 수 있기 때문에, 프라이버시를 강화하기 위해 랜덤의 이메일 주소를 발급해주고, 그 이메일 주소로 보내진 메일을 유저의 원래 이메일 주소로 포워딩해주는 방식이다.]]></summary></entry><entry><title type="html">No bootable devices found on an old Dell laptop</title><link href="/2023/09/24/no-bootable-devices-dell-laptop.html" rel="alternate" type="text/html" title="No bootable devices found on an old Dell laptop" /><published>2023-09-24T00:00:00+09:00</published><updated>2023-09-24T00:00:00+09:00</updated><id>/2023/09/24/no-bootable-devices-dell-laptop</id><content type="html" xml:base="/2023/09/24/no-bootable-devices-dell-laptop.html"><![CDATA[<p>Dell E6530 모델을 아직까지 현역으로 굴리고 있다. 메모리 용량도 16GB 정도고 성능도 나쁘지 않아서 그럭저럭 잘 쓰고 있다. 언제부턴가 시스템을 재부팅하면 No bootable devices, strike F1 to retry boot … (생략) … 메세지가 나왔다.F1을 누르면 부팅은 정상적으로 잘 진행되었다. 이렇게 되면 서버 용도로 사용하기 곤란해지는데, 원격으로 재부팅하면 반드시 물리적으로 F1키를 눌러줘야 하기 때문이다.</p>

<p>OS는 Ubuntu 18.04 LTS 버전이고 설치할 때 UEFI 모드로 설치한 기억이 난다. Gparted 를 열어보면 /boot/efi 파티션이 FAT32로 512 MB 가량 잡혀있고, boot, esp 플래그가 붙어있다. esp 플래그는 EFI system partition임을 나타내고, /sys/firmware/efi 디렉토리도 있는 것으로 보아 우분투 설치 문제는 아니었을 것 같다.
 </p>

<p>한편 BIOS(…) 설정 문제도 아니었음. 들어가서 보면 UEFI 모드로 잘 활성화되어 있고, Secure boot enable/disable 껐다 켰다 해보면서 테스트를 해보거나, 아니면 UEFI 시작점들을 다시 세팅해보고 했는데 변화가 없었다. Legacy mode를 활성화하고 들어가면 파티션 테이블부터 잘못되었다는 메세지가 뜸.. Dell에서 제공하는 테스트 프로그램도 돌려보았으나 특별한 문제는 발견되지 않아 미궁으로 빠지려던 찰나에..
 </p>

<p>SATA mode가 RAID모드로 되어 있는 것을 발견하고 AHCI로 변경하였다. 노트북이니까 RAID 모드로 돌릴 이유가 없다. 이후 Dell 로고가 두번 표시되기는 하지만 No bootable devices 오류가 발생하지는 않는다. :D</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Dell E6530 모델을 아직까지 현역으로 굴리고 있다. 메모리 용량도 16GB 정도고 성능도 나쁘지 않아서 그럭저럭 잘 쓰고 있다. 언제부턴가 시스템을 재부팅하면 No bootable devices, strike F1 to retry boot … (생략) … 메세지가 나왔다.F1을 누르면 부팅은 정상적으로 잘 진행되었다. 이렇게 되면 서버 용도로 사용하기 곤란해지는데, 원격으로 재부팅하면 반드시 물리적으로 F1키를 눌러줘야 하기 때문이다.]]></summary></entry><entry><title type="html">How to fix issues when Ubuntu won’t install on older Asrock desktops</title><link href="/2023/09/24/how-to-fix-ubuntu-install-issues-on-asrock.html" rel="alternate" type="text/html" title="How to fix issues when Ubuntu won’t install on older Asrock desktops" /><published>2023-09-24T00:00:00+09:00</published><updated>2023-09-24T00:00:00+09:00</updated><id>/2023/09/24/how-to-fix-ubuntu-install-issues-on-asrock</id><content type="html" xml:base="/2023/09/24/how-to-fix-ubuntu-install-issues-on-asrock.html"><![CDATA[<h4 id="증상">증상</h4>

<p>윈도우는 정상적으로 부팅됨. Ubuntu 최신 버전이나 혹은 하다못해 CentOS 7을 깔려고 해도 진행이 되지 않음. AHCI controller unavailable이나 ATAPI 관련해서 뭔가 에러메세지가 발생함. 주로 timeout 계열의 로그 메세지</p>

<h4 id="삽질">삽질</h4>

<p>UEFI 관련 설정 재점검. UEFI firmware 업데이트 (2018년 버전이 마지막…) Ubuntu 22.04 LTS 대신에 Lubuntu나 CentOS 7로 USB 다시 만들어봄. 그래픽카드 &amp; 메모리 분해 후 먼지 제거…</p>

<h4 id="이유-및-해결">이유 및 해결</h4>

<p>Asrock 2013년 메인보드 칩셋 버그가 있어 생기는 문제. 메인보드는 <a href="https://www.asrock.com/mb/Intel/B75%20Pro3-M/">B75 PRO3-M</a>, <a href="https://www.asrock.com/mb/intel/b85m%20pro4/">B85M PRO4</a> 이다. <code class="language-plaintext highlighter-rouge">libata.atapi_passthru16=0</code>을 GRUB bootloader 옵션에 넣고 설치를 하면 된다. 이후에 영구적으로 수정하기 위해 <code class="language-plaintext highlighter-rouge">/etc/grub.d</code>의 <code class="language-plaintext highlighter-rouge">10_linux</code>에서 <code class="language-plaintext highlighter-rouge">linux_entry</code> 함수를 찾는다. <code class="language-plaintext highlighter-rouge">args="$4"</code> 대신에 <code class="language-plaintext highlighter-rouge">args="$4 libata.atapi_passthru16=0"</code>으로 수정한다. 그런다음 <code class="language-plaintext highlighter-rouge">update-grub</code> 실행…</p>

<h4 id="참고">참고</h4>
<ul>
  <li><a href="https://www.linuxquestions.org/questions/showthread.php?p=5819208">https://www.linuxquestions.org/questions/showthread.php?p=5819208</a></li>
  <li><a href="https://github.com/torvalds/linux/blob/master/drivers/ata/libata-scsi.c">https://github.com/torvalds/linux/blob/master/drivers/ata/libata-scsi.c</a></li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[증상]]></summary></entry><entry><title type="html">sign_and_send_pubkey: no mutual signature supported</title><link href="/2023/09/17/openssh-no-mutual-signature-supported.html" rel="alternate" type="text/html" title="sign_and_send_pubkey: no mutual signature supported" /><published>2023-09-17T00:00:00+09:00</published><updated>2023-09-17T00:00:00+09:00</updated><id>/2023/09/17/openssh-no-mutual-signature-supported</id><content type="html" xml:base="/2023/09/17/openssh-no-mutual-signature-supported.html"><![CDATA[<p><a href="https://ubuntu.com/pro">Ubuntu Pro</a> 기능을 활성화시키고, FIPS 관련 설치를 하고 난 다음부터 아래와 같은 경고 메세지 발생.</p>

<p> 
<code class="language-plaintext highlighter-rouge">sign_and_send_pubkey: no mutual signature supported</code></p>

<p> 
<code class="language-plaintext highlighter-rouge">ssh -vvvv &lt;host&gt;</code> 로 확인한 결과 <code class="language-plaintext highlighter-rouge">debug1: Skipping ssh-ed25519 key &lt;redacted&gt; - not in PubkeyAcceptedKeyTypes</code> 라는 메세지를 볼 수 있었다. ssh-ed25519를 지원하지 않을리가 없어서 조금 황당한 상황.
 </p>

<p>서버의 SSH daemon 버전을 보면 <code class="language-plaintext highlighter-rouge">SSH-2.0-OpenSSH_7.9p1 Ubuntu-10~ubuntu18.04.fips.0.8</code> 이었고,
클라이언트의 SSH client 버전을 보면 <code class="language-plaintext highlighter-rouge">OpenSSH_7.9p1 Ubuntu-10~ubuntu18.04.fips.0.8, OpenSSL 1.1.1  11 Sep 2018</code> 이다. (업데이트를 좀 하긴 해야하는데…)</p>

<p>클라이언트 부분에서의 config에 <code class="language-plaintext highlighter-rouge">PubkeyAcceptedKeyTypes +ssh-ed25519</code> 를 추가하니 일단 접속은 가능.</p>

<p><code class="language-plaintext highlighter-rouge">/etc/ssh/sshd_config</code>에서 <code class="language-plaintext highlighter-rouge">PubkeyAcceptedKeyTypes +ssh-ed25519</code>  부분을 추가하긴 했고, 의외로 필수는 아닌 것 같았다.</p>

<p><code class="language-plaintext highlighter-rouge">sudo /usr/sbin/sshd -T</code> 하면 설정들이 쭉 보이므로 참고할 수 있다. 다만 언제부터인지 모르겠지만, <code class="language-plaintext highlighter-rouge">PubkeyAcceptedKeyTypes</code> 가 최신 버전의 openssh-server에서는 <code class="language-plaintext highlighter-rouge">PubkeyAcceptedAlgorithms</code>로 변경이 되었다. <code class="language-plaintext highlighter-rouge">man sshd_config</code> 에 따르면 다음과 같다.</p>

<pre style="white-space: pre-wrap;">
PubkeyAcceptedAlgorithms
Specifies the signature algorithms that will be accepted for public key authentication as a list of comma-separated patterns.  
Alternately if the specified list begins with a ‘+’ character, then the specified algorithms will be appended to the default set instead of replacing them.  
If the specified list begins with a ‘-’ character, then the specified algorithms (including wildcards) will be removed from the default set instead of replacing them.  
If the specified list begins with a ‘^’ character, then the specified algorithms will be placed at the head of the default set. 
</pre>]]></content><author><name></name></author><summary type="html"><![CDATA[Ubuntu Pro 기능을 활성화시키고, FIPS 관련 설치를 하고 난 다음부터 아래와 같은 경고 메세지 발생.]]></summary></entry></feed>