來自另一個演化樹的 Grand Central Dispatch

前幾天讀了 Evan Miller 的 Four Days of Go ,裡面有一段提到 libdispatch ,就研究了一下。

每次發現 XNU, BSD, Solaris, Illumos 這些比較不一樣的 UNIX 有神奇的功能的時候就如同發現尼安德塔人的存在,還有他們某方面還比我們先進一樣。又像是重新發現亞特蘭提斯,是如此的先進,但卻不為多數人所知、所用。




Extend virtual machine disk size, enlarge filesystem

If you select “use entire disk and use LVM" during Ubuntu installation, the installer will use a weird disk topology:

  1. /boot on the first primary partition, sda1
  2. extended partition on sda3
  3. LVM partition on sda5

Super weird. So in order to enlarge the filesystem I decided to simply create a new partition and add it to LVM.

Quick notes on using fdisk:

fdisk /dev/sda
first sector is the end sector of the extended partition+1

Add sda3 to LVM, extend VG, extend LV, extend filesystem.

pvcreate /dev/sda3
vgextend xx-vg /dev/sda3
lvextend -l 100%FREE /dev/xx-vg/root
resize2fs /dev/xx-vg/root


最近在 Facebook 分享了 Hacker News 上面一篇針對黑客松的討論,引起了一些迴響,所以決定寫一篇文章整理我的想法。


關於黑客松的歷史就不多介紹了,有兩種起源,Sun 和 OpenBSD ,見維基百科

黑客松的 OpenBSD 詮釋其實很簡單,一群程式設計師聚在同一個地方開發一個專案,就可以叫做黑客松了。一開始 OpenBSD 的黑客松也不過是這樣而已。


上面講的是比較沒有壓力的黑客松,有時候黑客松也會有一個明確的開發目標,讓大家像馬拉松一樣在活動的幾天日以繼夜地寫程式,這時候的目標往往是用各種 hack ,在最短的時間內達成開發目標,這種黑客松就真的融入了 marathon 的精神。這也就是黑客松的 Sun 詮釋了。

不過什麼是 hack ?(印象中《黑客列傳》將其譯為「黑技」)

hack 泛指用聰明絕頂的方法解決問題,通常也包含著戲謔、嘲諷、炫耀、懶惰、小聰明的特質,著重在解決問題本身,甚至會為了快速解決問題,而故意忽略問題的其他面向。

舉例來說, Richard Stallman 做的 GNU 計劃就是對 UNIX 一個絕妙的 hack ,根據授權條款規定,他不能使用 UNIX 的原始碼,但還是靠著自己的聰明才智寫出源碼不一樣但是完全相容的程式。

另一個例子是 MIT 的 hack 傳統,有一次一群學生(應該是一群學生,不過這種惡作劇的始作俑者通常都不會被找到)把一台完整的消防車放上 MIT 圓頂:


以寫程式來說,有時候為了解決某個問題(作出某個功能或是修掉某個 bug),可是完整的解決方案要花費很久的時間才能實作的時候,我們有時候會用一些「骯髒」的方式來解決,譬如說把某個值寫死 (hard-code) ,或是某個應該要模組化的功能,為了快速實作,直接把它做在核心裡面。

從這點講回黑客松,為了要在短時間內達到開發目標,實作過程中很可能大量使用各種 hack ,寫出各種骯髒的 code ,所以不斷 hack 的 marathon ,就叫做 hackathon 了。

雖然骯髒的程式碼不利於長遠維護,不過有時候為了 proof of concept 或是快速驗證可行性,工程師們還是會寫骯髒的 code 。反正萬一真的成功了再修改也不遲。


I am an american CS student that goes to (a lot) of hackathons. The purpose of this post is to get feedback/opinions from people that are outside the “Hackathon Hackers" bubble to determine whether or not my rant is founded and if the issues I am highlighting are characteristic of the tech industry.It bothers me to see how obsessed with success this generation of “hackers" seems to be. I have met people who were justifying censorship, population control and unfair business practices because they could benefit from them someday. I was expecting a little more regard to civil liberties and ethics from students and so called “hackers".
我是一位美國 CS 學生,我參加過很多黑客松。這篇的目的是聽聽那些「黑客松的駭客們」圈圈外的人的觀點和意見,來讓我瞭解我的抱怨是否具備合理基礎,還有這些我點出的議題是否真的是科技產業的特性。這年頭的「駭客」是如此地執迷於「成功」讓我有點感冒,我曾遇過一些人為言論審查、人口控制、不公平的商業手法辯護,只因為他們有天可以從此獲利。我認為學生和所謂的「駭客們」對於公民議題應該有更多的重視。

People win by making “cool" apps (Uber for X) whereas technical hacks are totally ignored.
人們製作酷炫的 app (像是 Uber for X)來贏得黑客松,卻完全不在意那些技術上骯髒的地方。
譯註:Uber for X 是指,把 Uber 的模式套用到其他領域上面去,就像我們會說 LinkedIn 是給業界人士的 Facebook 。

I am glad that people are motivated to succeed but this lead to some of them taking themselves very seriously. Often to the expense of ethics.

“There is such ignorance in this world about who we are. We are not criminals. We are innovators. We create things. We change the world.[…]"

And this is one example among many other from a guy who has never engineered anything. Weeks are spent planning for their new “great project" with at the end little to no execution.

Students who believe to be 1000x SE because they can stick two APIs together and use bootstrap end-up to be very condescending older engineers.
學生覺得自己是超厲害的軟體工程師,因為他們可以把兩個 API 接在一起然後用 bootstrap 把它做得美美的,就這樣輕視較老的工程師。

This “bro"/"my framework is the best"/"Make money fast" culture that stinks a little bit IMO.

Hackathons are great to try out new technologies, meet new people and outreach to demographics that are traditionally under-represented in CS but I don’t like where this is headed.
黑客松是嘗試新科技、新工具,並且認識那些 CS 領域當中的少數族群的好機會,但是我不喜歡很多黑客松的發展方向。

Like HS there is “cool kids" who are “Student Entrepreneur" or “Innovator, UX Artist blah blah", “RoR Genius" etc… and the rest of the world.
就跟高中一樣,那些酷傢伙可以自稱「學生創業家」、「創新者」、「UX 設計師」、「RoR 天才」巴拉巴拉巴拉,其他人就只能在旁邊看。

My apologies if this post is a little bit ranty, I hope to get other perspectives on this.

再來我想要引用幾句 Hacker News 討論串裡面特別中肯的留言:

Yes, I think that the idea that a hackathon can be “won" is silly too.


There are two types of hackathons: The Sun and the OpenBSD type. Most of what is talked here seems to be more of the former, but that term can mean two entirely different things.
有2種黑客松,Sun 和 OpenBSD 的。這邊討論的似乎大部分都是指前者,但是黑客松一詞可以有兩種完全不同的意義。

For starters, the OpenBSD one can’t be “won".
簡單來說,OpenBSD 黑客松不能「被贏」。


Honestly? You’re hanging out with a bunch of ambitious, entry level devs, probably all college students. This is what you should expect from a crowd like this. Take what you need and leave the rest. For more depth and maturity, go to your favorite language meetups and attend/participate in talks from/with folks with some industry experience under their belt. Kudos for having perspective enough to ask for feedback about this. You’ll be fine.


I think a key part of the question though is the fact that it didn’t used to be just entry level devs and college students at hackathons.


Well, it depends on hackaton. Most of the hackatons now are commercial events, designed either to milk participants for free work or promote some third party services.

I remeber when hackatons were made by programmers for programmers, when they were about hacking on actually cool projects and having fun. Those hackatons had some serious devs participating, because hell, even if you’re doing this professionally, you need to take a break every now and then and do something just for fun.


Take a look at the free software community (which is incidentally very well-correlated with what the “hacker" community used to be 20-30 years ago, and has much more of a claim to being the intellectual heirs of that group than the hackathon crowd does or even the HN crowd does). There’s a lot of focus on ethics and civil liberties, and maybe a bit too little focus on effective PR and on shipping, but it’s very refreshing.
你可以看一下自由軟體社群,比起那些黑客松的人們,或甚至是 HN (Hacker News) 這邊的社群,他們跟二三十年前那些真正的駭客比較像,更有資格被稱作駭客精神的人繼承者。他們非常關注公民議題,雖然或許有些輕視公關和行銷部分,不過依舊值得一看。


真正的黑客松並不難,也不需要什麼錢來舉辦,更不需要什麼宣傳。三五好友,找個下午,一起來做個專案,大家開心寫 code 開心吃批薩喝飲料,也就是黑客松了。