本来上次已经配置好的博客,但是由于细节的不完善,手贱贱地把本地和远程分支上的配置都删除了,无奈只得重新来一次github上的octopress博客搭建。

综合谷歌百度引擎,发现最好的教程仍然是octopress官方博客。不得不承认octopress写博客的方式很hacker,所有的步骤都能在shell和vim完成。有了2次搭建的经历,终于对octopree的文件管理方式有了一些理解:上传到github上的有两个分支,一个是master,一个是source,而source是我们最重要的源码,两个分支分别对应文件目录的deploy和,source文件夹(注释在下面的目录树了),所以下次在其他电脑上书写博客,一定要注意clone下来的目录,要先git checkout source分支,然后rake setup_github_pages才能rake new_post['blog'] rake generate rake deploy

好了,终于可以随意自由markdown写博客了!:)

octopress目录树
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.
├── _deploy *github上origin服务器上的master分支,既最终部署的页面
│   ├── about
│   ├── assets
│   │   └── jwplayer
│   │       └── glow
│   │           ├── controlbar
│   │           ├── display
│   │           ├── dock
│   │           ├── playlist
│   │           └── sharing
│   ├── blog
│   │   ├── 2012
│   │   │   └── 05
│   │   │       ├── 14
│   │   │       │   └── ubuntu-common-softwae
│   │   │       ├── 15
│   │   │       │   └── cao-zuo-xi-tong-zhong-de-linuxming-ling
│   │   │       └── 30
│   │   │           └── bu-zhe-teng
│   │   ├── archives
│   │   └── categories
│   │       ├── linux
│   │       └── thoughs
│   ├── images
│   ├── javascripts
│   │   ├── asides
│   │   └── libs
│   └── stylesheets
│       ├── bootstrap
│       └── syntax
├── plugins
├── public *本地rake generate,rake preview生成的页面
│   ├── about
│   ├── assets
│   │   └── jwplayer
│   │       └── glow
│   │           ├── controlbar
│   │           ├── display
│   │           ├── dock
│   │           ├── playlist
│   │           └── sharing
│   ├── blog
│   │   ├── 2012
│   │   │   └── 05
│   │   │       ├── 14
│   │   │       │   └── ubuntu-common-softwae
│   │   │       ├── 15
│   │   │       │   └── cao-zuo-xi-tong-zhong-de-linuxming-ling
│   │   │       └── 30
│   │   │           └── bu-zhe-teng
│   │   ├── archives
│   │   └── categories
│   │       ├── linux
│   │       └── web
│   ├── images
│   ├── javascripts
│   │   ├── asides
│   │   └── libs
│   └── stylesheets
│       ├── bootstrap
│       └── syntax
├── sass
│   ├── base
│   ├── bootstrap
│   ├── custom
│   ├── partials
│   │   └── sidebar
│   └── syntax
└── source *github上origin服务器上的source分支,源码存放地
    ├── about *主页上about栏markdown文件
    ├── assets
    │   └── jwplayer
    │       └── glow
    │           ├── controlbar
    │           ├── display
    │           ├── dock
    │           ├── playlist
    │           └── sharing
    ├── blog
    │   └── archives
    ├── images *博客本地配图存放地
    ├── _includes
    │   ├── asides
    │   ├── custom
    │   │   └── asides
    │   └── post
    ├── javascripts
    │   ├── asides
    │   └── libs
    ├── _layouts
    ├── _posts *博客所有markdown源文件
    └── stylesheets
        ├── bootstrap
        └── syntax

首先不推荐中大信科院自己的操作系统实验课,跟着老师学完,你只是windows里点点鼠标更熟练了。强烈推荐这份南大操作系统实验,我也正在看,欢迎交流@twitter(求粉哟) 实验依赖(ubuntu 12.04下)

sudo apt-get install nasm
sudo apt-get install vim
sudo apt-get instsall virtualbox

第一次用markdown,好不熟悉,这是第二段?

因为怕考试时候忘了命令,所以将这些记下来。

创建一个新的软盘

dd if=/dev/zero of=floppy.img bs=512 count=2880

512Bx2880是不是正好等于1.44MB,只要修改bs(block size),count参数,你可以创建任何格式大小的磁盘镜像文件。抛弃你的botchs创建空软盘的老土方法吧,linux提供你所需要的任何机制。

汇编编译及写引导扇区

asm -> bin
sudo nasm boot.asm -o boot.bin
bin -> img
sudo dd if=boot.bin of=a.img bs=512 count=1 conv=notrunc

读出硬盘MBR

sudo dd if=/dev/sda of=~/MYBoot.dat bs=512 count=1

用vim取代winHex编辑16进制功能

vim -b floppy.img
:%!xxd
do some rewrite...
:%!xxd -r
:wq

往镜像文件添加文件

sudo mkdir -p /mnt/floppy
sudo mount floppy.img /mnt/floppy
sudo cp *.com /mnt/floppy
sudo umount /mnt/floppy

反汇编

ndisasm -o 0x7c00 boot.bin >> boot.asm

不同版本,只需要将你执行lsb_release -a标准输出中codename替换下面的precise即可

#教育网-中国科技大学 
deb http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-backports restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
#公网-163,备胎,不在学校时取消下面注释同时注释上面
# deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
# deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
# deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
# deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
# deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
# deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

我的常用软件

sudo apt-get install ubuntu-restricted-extras
sudo apt-get install vlc
sudo apt-get install chromium-browser
sudo apt-get install vim-gtk
sudo apt-get install ssh
sudo apt-get install gnome-shell
sudo apt-get install wireshark
sudo apt-get install putty
sudo apt-get install filezilla
sudo apt-get install virtualbox
sudo apt-get install g++
sudo apt-get install gnome-tweak-tool
sudo apt-get install nasm
sudo apt-get install eclipse
sudo apt-get install ibus-googlepinyin
sudo apt-get install codeblocks
sudo apt-get install chmsee