Skip to content

Instantly share code, notes, and snippets.

View FlatMapIO's full-sized avatar
😭
Focusing

dong.huo FlatMapIO

😭
Focusing
View GitHub Profile
; NASM 快速入门
; 原文: http://www.ibm.com/developerworks/cn/linux/l-gas-nasm.html
; nasm: http://www.nasm.us/
; Text segment, 是处理器开始执行代码的地方
section .text
global _start ; 让一个符号对链接器可见
; Program entry
;; An (imaginary) actor macro takes an initial state and callback fns.
;; (actor {} (fn1 [state message]) (fn2 [state message) ...)
;; The most obvious callback fn is (receive [state message) that is called when a
;; message is consumed from the agents mailbox. receive is called with the old state
;; and the message as parameters -- it returns the new state.
;; sender is bound to the senders pid.
;; other callbacks are stuff broken link detection etc.
@FlatMapIO
FlatMapIO / 解决 dns 污染 .md
Last active August 29, 2015 14:04
解决 dns 污染
@FlatMapIO
FlatMapIO / linux-man.md
Last active August 29, 2015 14:04
linux 管理备忘

工具

  • 解压 tar -xzvf foo.tar.gz
  • 安装开发包
sudo yum groupinstall "Development Tools" # 一口气安装编译时所需的一切工具
sudo yum install ncurses-devel #必须这样才能让 make *config 这个指令正确地执行。
sudo yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel #创建 CentOS-6 内核时需要它们

Clojure 解构卡

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

@FlatMapIO
FlatMapIO / write iso to usb on mac.md
Last active August 29, 2015 14:05
write iso to usb on mac
# find usb dev
diskutil list
# unmount usb dev
diskutil unmountDisk /dev/disk<USB>
brew install pv
pv -petr ubuntu.iso | dd of=/dev/disk bs=1m
@FlatMapIO
FlatMapIO / coreos-vagrant config.rb
Created August 19, 2014 02:38
coreos-vagrant config.rb
# coreos-vagrant is configured through a series of configuration
# options (global ruby variables) which are detailed below. To modify
# these options, first copy this file to "config.rb". Then simply
# uncomment the necessary lines, leaving the $, and replace everything
# after the equals sign..
# Size of the CoreOS cluster created by Vagrant
#$num_instances=1
# Official CoreOS channel from which updates should be downloaded
@FlatMapIO
FlatMapIO / install fish.md
Last active August 29, 2015 14:05
install fish.md

Install

CentOS 6

sudo yum-config-manager --add-repo http://fishshell.com/files/linux/RedHat_RHEL-6/fish.release:2.repo
sudo yum install fish
@FlatMapIO
FlatMapIO / LaunchpadTips.md
Created August 29, 2014 15:01
Launchpad 攻略:清空、重置、手动整理、删除、重建图标缓存

Launchpad save db in

~/Library/Application Support/Dock/

Clear

sqlite3 ~/Library/Application\ Support/Dock/*.db 'DELETE FROM apps;' && killall Dock