What is Hackers' Pub?

Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed.

今天是5/6,我的室內溫度計已經連續三天觀測到30℃以上。請問各位象友,你們是否已經開冷氣了?

0
0
0
0
0
0
0
1
0
0

> (Many fediverse servers do process incoming activities asynchronously, but they generally still verify signatures synchronously, so double knocking is still viable when delivering activities to remote inboxes.)

what is the point of this? what are the issues with the current httpsig system?
0
1

구트현X(-_-)가 그나마 있던 영어 고객지원 계정을 삭제하고, 도움말 센터와 유료이용자 지원 계정만 남길거라고. 물론 욕을 퍼먹고 있음. arstechnica.com/tech-policy/... 외국 유저들은 X고객 센터에서 답변을 받기까지 6개월 이상 기다려야 했고, 계정 정지 후에도 계속 요금이 청구되었다고 분노.

Disgruntled users roast X for ...

0
0
0
1
0
0
1
0
1
0
0

SparklingOutlaw🍉 shared the below article:

「日本品質」の味噌、中国から世界に輸出 30年越しの技術協力で年産1万トン達成【人気記事再掲】

中国内モンゴル自治区興安盟にある食品会社、内蒙古科沁万佳食品の生産ラインでは連日、忙しくも秩序正しい生産の光景が広[…]

Read more →
0
0
0
0
0
0

Kraken 近期揭露一起北韓駭客試圖透過應徵工程師職位滲透公司的事件。
https://blog.kraken.com/news/how-we-identified-a-north-korean-hacker
這名應徵者從一開始就行為可疑,不但在面試中使用不同姓名,還疑似在有人指導下作答,且使用的 Email 位於已知的駭客名單中。Kraken 的紅隊隨即展開公開情報(OSINT)調查,發現該應徵者與多個假身份有關,並曾在其他公司任職,甚至與受制裁的外國代理人有連結。駭客使用 VPN 與遠端設備掩飾位置,提供的身分證明也有偽造嫌疑。為深入了解其手法,Kraken 選擇將其帶入多輪面試並設下身分驗證陷阱,最終在高層面談中透過突擊問題讓駭客露出馬腳。Kraken 表示,這次經驗證實「不要信任,要驗證」的原則至關重要,並提醒企業需將安全防線延伸至招聘流程,以防駭客從正門滲透,確保整體組織安全。

0
0

戲腳友人回港之前,大家討論咗好耐電影。
有一晚我地討論,到底電影最重要嘅係咩?我地都覺得最重要係好睇。

無論創作團隊想討論啲咩深刻議題都好,先用任何敍事手法講好咗個故事應該係最大原則,喺呢個基礎上再去傳遞滲透想講嘅各種大道理完全無問題,但唔好本末倒置。實在反感某啲電影連講好故事嘅能力都無,就想藉住套戲教觀眾點做人,未盡好本份就有泰山壓頂嘅說教味撲面而來,加劇咗觀影時嘅不適感,直白地表達嗰種反感就係:故仔都未撚拍好就想教我做人,你係邊位?

我成日覺得有啲創作人係好有趣,佢地好似以娛樂其他人為恥,係咪因為太怕作品受歡迎就被鞭撻娛樂至死呢?但明明一個作品由無到有到推上戲院,種種都牽涉商業行為,唔賣座就好難有下一套,點解對於娛樂性豐富嘅作品,有咁多人避之唯恐不及?

係咪因為好單純咁將娛樂與低俗掛咗鈎?

如多人從之則為俗,咁當好多人怕俗時候,呢種心態又係咪另類嘅俗氣?

RE: https://www.threads.com/@tsao_shih_han/post/DJS7lwbydHU

0
0
0
0
0
0
0

몇년 전에 한 번 곤약밥을 먹어봤다가, 이건 내 길이 아니다 싶어서 한 3일 정도만에 때려쳤더랬음.

근데, 최근에 백미에서 곤약밥으로 바꾸고 양도 절반으로 줄인지 일주일 정도 됐지 싶은데, 이게 나한테는 딱 정량인 것 같음.

그리고 아침엔 바나나 쉐이크, 점심은 방울토마토 아니면 전날 저녁때 먹고 남은 요리 해치우기, 저녁에 곤약밥 + 간단한 요리 해먹기 정도로 식단을 바꿔봤는데도 괜찮은 것 보면... 그동안 너무 많이 먹었는 것 같음.

0
0
0
0

For some reason, every time I shut down my 1st unbound DNS resolver, most of my clients stall and wait for replies until a timeout is reached. Then and only then will they switch to my 2nd unbound DNS resolver.

I was thinking of using CARP to have only one virtual IP for the clients to use, so if the 2nd unbound jail takes over, the clients won't even notice.

Does this make sense or is there a better way to deal with this? 🤔

0
0

Next.js 서버 액션은 서버 데이터를 가져오는 용도로 사용하기에 적합하지 않다. React 공식문서에서는 다음과 같이 말하고 있다.

Server Functions are designed for mutations that update server-side state; they are not recommended for data fetching. Accordingly, frameworks implementing Server Functions typically process one action at a time and do not have a way to cache the return value.

서버 액션이 여러 호출되면 바로 실행되는 대신 큐에 쌓이고 순차적으로 처리된다. 이미 실행된 서버 액션은 이후 취소할 수 없다.

이에 서버 액션을 데이터 가져오기로 활용하면 끔찍해지는 UX가 생길 수 있는데, 예를 들어 페이지의 목록 검색 화면에서 검색 후 데이터를 가져오는 상황에 않았다고 다른 화면으로 네비게이션이 불가능한 것은 일반적인 경험이 아니다.

이러면 RSC를 통해 무한 스크롤을 구현하지 못하는가? 에 대해서 의문이 생길 수 있는데 여기에 대해서 대안을 발견했다.

function ServerComponent({ searchParams }) {
  const page = parseInt((await searchParams).page ?? "1", 10)
  const items = await getItems(page)
  return (
    <Collection id={page}>
      {items.map(item => <InfiniteListItem key={item.id} {...items} />)}
    </Collection>
  )
}
"use client"

function Collection({ id, children }) {
  const [collection, setCollection] = useState(new Map([[id, children]]))
  const [lastId, setLastId] = useState(id)
  if (id !== lastId) {
    setCollection(oldCollection => {
      const newCollection = new Map(oldCollection)
      newCollection.set(id, children)
      return newCollection
    })
    setLastId(id)
  }
  return Array
    .from(collection.entries())
    .map(
      ([id, children]) => <Fragment key={id}>{children}</Fragment>
    )
}

대충 이런 꼴이다. 이러고 page를 증가시키거나 감소시키는건 intesection observer나 특정 엘리먼트의 onClick 이벤트 따위를 의존하면 된다. 이러면 데이터 가져오기 패턴을 RSC 형태로 의존할 수 있다. InfiniteListItem는 서버컴포넌트, 클라이언트컴포넌트 무엇으로 구현하더라도 상관없다. 가령 아래와 같은 식:

function ServerComponent({ searchParams }) {
  const page = parseInt((await searchParams).page ?? "1", 10)
  const { items, hasNext } = await getItems(page)
  return (
    <div>
      <Collection id={page}>
        {items.map(item => <InfiniteListItem key={item.id} {...items} />)}
      </Collection>
      {hasNext && (
        <IntersectionObserver nextUrl={`/?page=${page + 1}`} />
      )}
    </div>
  )
}

검색 조건이나 검색어에 따라 상태를 초기화시키려면 다음과 같이 표현하면 된다.

function ServerComponent({ searchParams }) {
  const page = parseInt((await searchParams).page ?? "1", 10)
  const query = parseInt((await searchParams).query ?? "")
  const { items, hasNext } = await getItems(page, query)
  return (
    <div>
      <Form action="/">
        <input name="query" />
        <button />
      </Form>
      <Collection id={page} key={query}>
        {items.map(item => <InfiniteListItem key={item.id} {...items} />)}
      </Collection>
      {hasNext && (
        <IntersectionObserver nextUrl={`/?page=${page + 1}&query=${query}`} />
      )}
    </div>
  )
}

매우 PHP스럽고, 암묵적이기도 하다. 다만 RSC의 데이터 가져오기 패턴을 활용하면서 기존 컴포넌트를 최대한 재사용할 수 있게 된다는 점이 좋다.

2
0
0

昨天回家發現我家長輩,又被騙了⋯⋯。
被朋友以來路不明的「神奇乳膏」抵債,聲稱塗了以後能讓白髮變黑、改善失智症狀,還說有「醫生保證」、「美國人體實驗」等背書。
結果我們深入查證後,發現這些產品可能來自被政府勒令停產、違反GMP規定、使用過期原料的藥廠。
決定完整整理相關經驗分享給大家,請大家一定要幫家中的長輩把關!
來路不明的產品不僅造成財物損失,更可能影響身體健康!!

完整經驗分享請見:
next-able.com/20250506-2/

0
0
1

"Aber verliert , wenn es wird!"

Nein, das ist ganz sicher nicht der Fall.

Erstens geht es bei unserem Plan nur um Regulierung. Wir werden Außenwerbung nicht abschaffen, sondern nur wieder auf ein erträgliches Maß zu reduzieren.

braucht zappelnde Bildschirme an jeder .

0
0
0
0
0

Kraken 近期揭露一起北韓駭客試圖透過應徵工程師職位滲透公司的事件。
https://blog.kraken.com/news/how-we-identified-a-north-korean-hacker
這名應徵者從一開始就行為可疑,不但在面試中使用不同姓名,還疑似在有人指導下作答,且使用的 Email 位於已知的駭客名單中。Kraken 的紅隊隨即展開公開情報(OSINT)調查,發現該應徵者與多個假身份有關,並曾在其他公司任職,甚至與受制裁的外國代理人有連結。駭客使用 VPN 與遠端設備掩飾位置,提供的身分證明也有偽造嫌疑。為深入了解其手法,Kraken 選擇將其帶入多輪面試並設下身分驗證陷阱,最終在高層面談中透過突擊問題讓駭客露出馬腳。Kraken 表示,這次經驗證實「不要信任,要驗證」的原則至關重要,並提醒企業需將安全防線延伸至招聘流程,以防駭客從正門滲透,確保整體組織安全。

0
0
1
0
1