存档

‘linux’ 分类的存档

Set SSL Google as the Default Search Engine when using Pentadactyl in Firefox

2011年8月22日 T 没有评论

First of all, if you don’t have any idea what Pentadactyl is, then this post maybe not worth your time.

Secondly, I should tell you about my system environments: Ubuntu 11.04; Firefox 6.0. If yours are differ from mine, I suppose it will still be ok, in most of the cases, they share the same steps.

Now, let’s start.

  1. Why use Firefox? It’s the only browser what can have Pentadactyl as the add-on.
  2. Why use Pentadactyl? It’s vim-like add-on, designed for some keyboard addicted users to make life easier and more efficiently. If you ever heard about vim, you should know how powerful it is.
  3. Why bother to use encrypted google search engine? It’s really something personal, I like it, because I like it. If you insist to ask, I think the main reason is I don’t want my search queries to be intercepted. Besides, it makes me cool and different.

In Pentadactyl, when you want search something, just type “o”(open the results in current tab) or “t”(open the results in new tab) followed the search words. By default, Pentadactyl use google as the search engine, Not google ssl. So how to change it? Add it as a bookmark will be the first step. Since we use Pentadactyl, let’s do it in some cool way:

  1. Press “:” to begin to typing command.

    bmark -keyword gssl https://encrypted.google.com/search?sclient=psy&hl=en&safe=off&site=webhp&source=hp&q=%s&pbx=1&oq=&aq=&aqi=&aql=&gs_sm=&gs_upl=

  2. Press “Enter” to execute the command. And now you add it to your bookmark. Then press “:” again to type another command.

    set defsearch=gssl

  3. Job done!

Command no.1: “-keyword” is an option for you to name a search engine which will be used in the second command. The url I provided maybe only functional in my system environment, I’m not sure. But if it doesn’t work, you could find it by yourself. AND it’s more easier.

  1. Open https://encrypted.google.com
  2. Right click of the search box
  3. Choose “Add a Keyword for this Search…”
  4. Name a keyword as you like, in my case it will be “gssl

It’s exactly the same result as command no.1. You will find the url when you check this bookmark’s property.

Command no.2: is used to set the default search engine. I really try hard to find this option of Pentadactyl…

Well, over…

How to fix the problem when Firefox cannot launch in Ubuntu

2011年3月26日 T 2 条评论

I’ve encountered such problems for several times. I don’t know why, but it just happens. Bad luck, maybe.

First of all, let me describer the syndrome, actually there are two syndromes:

  1. After launching the Firefox, the browser returns an error message:

    firefox is already running, but is not responding…

  2. After launching the Firefox, there’s totally no feedback. At first, the icon will show up, and after a short while, it disappears.

So the point is: how to fix it?

Of course, everyone knows that you should check the answers which you get from Google. But this time I got no luck, either those guys problems are differ from mine or the answers didn’t work for me. But at least, you can have a try.

Solution One:

Open Terminal (Applications–Accessories–Terminal or simply hit Ctrl+Alt+T), enter

killall firefox-bin

or

killall firefox

then reboot your Firefox.

Solution Two:

Unfortunately, solution one didn’t apply to my problem. So I have to find another one.

Open Home Folder (Places–How Folder), show all the hidden folders (you can do it by hit Ctrl+H), find folder named “.mozllia“, find its sub-folder named “firefox“, delete it and try again.

Solution Two worked for me, So I hope it will also works for you. Good luck.

分类: computer, linux, study_note 标签: ,

How to install Firefox 4 (Stable) In Ubuntu [10.04 and 10.10]

2011年3月23日 T 没有评论

Source: How To Install Firefox 4 (Stable) In Ubuntu [10.04 and 10.10]

Now Firefox 4 (stable) has finally released, I cannot wait to have a try. Though I use Chrome quite a lot nowadays, Firefox was once my favorite. Somehow it’s a little bit slow, but it can highly customize, that win my heart, besides, I’m quite indulge in”Pentadactyl“, an add-on to emulate vim in the browser. Of course, Chrome has the similar extension, “Vimium“, but I suppose  ”Pentadactyl“ is better.

If your OS is other than Ubuntu, you can probably find Firefox installer in this page, download it, click and install, simple and easy. And if you happened to use Ubuntu like me, then follow these steps:

  1. If you are using the development version of Firefox, remove it with the command,
    sudo apt-get remove firefox-4.0
    If you are not using the development version, skip this step.
  2. Now add the Firefox stable PPA.
    sudo add-apt-repository ppa:mozillateam/firefox-stable
  3. Now update the software list
    sudo apt-get update
  4. Finally install Firefox 4 with the command.
    sudo apt-get install firefox
    After installation, you will find Firefox under Applications > Internet > Firefox Web Browser.

Some of the add-ons are not compatible with Firefox 4, such as “Autoproxy”, I don’t know how to fix it now, but I’m sure with the help Almighty Google, you can find your way.

O.k., let’s surf.

分类: computer, linux, study_note 标签: , ,

Dropbox扩容详尽指南

2010年11月2日 T 14 条评论

写在最前面的话:

本文的方法实质上是在欺骗Dropbox,思想低劣,手法庸俗,实在是付不起钱不得已而为之。如果你有一定的财力,请一定购买付费服务,毕竟一个优质的软件是需要资金维持才能生存下去的!


关于这个话题已经有人详尽地写过,具体在这里。但是我在折腾的过程中又碰到了很多不可预见的问题,所以还是写一下和大家分享。

首先Dropbox作为一个被GFW光荣认证的服务,其质量的优质性不容质疑,这也是我坚定不移使用它的原因。(题外话:ubuntu下的ubuntu one也是个不错的选择。)但被墙的服务使用起来终归有些麻烦,要为其扩容更要点折腾的精神,所以我觉得你至少要知道以下一些概念:翻墙、虚拟机、ubuntu。都明白不?明白就接着看下去,不明白就走酱油通道。

  1. 申请帐号
  2. 首先当你有了自己的Dropbox以后会有邀请码,别人用你的邀请码注册Dropbox,你们双方就是多250m的Dropbox空间。先利用你的邀请码,翻墙注册n个帐号。Dropbox是不检查帐号的真实性的,你完全可以瞎填,只要方便自己记忆即可。

  3. 安装虚拟机和镜像
  4. 用这些帐号直接安装Dropbox是不会给你扩容的,因为Dropbox会检查操作系统和网卡的MAC。正因为这样,所以我们要用到虚拟机virtualbox和ubuntu的iso镜像来欺骗Dropbox造成我们在多台机器上安装Dropbox的假象。

    首先下载virtualboxubuntu的iso镜像,在virtualbox里创建ubuntu虚拟机。(创建什么系统并不重要,只要你自己熟悉就好,我觉得ubuntu的live cd比较好,如此而已。你当然也可以用Windows PE,不过我没有试过,原理上讲是一样的。)

    From Drop Box

    注意,在storage标签页里加载ubuntu的iso镜像,确定之后点击”Start”就可以顺利进入ubuntu虚拟机

    From Drop Box

    选择”Try Ubuntu“即可,不必安装,我们只是走走过场。

    From Drop Box

  5. 连接ssh
  6. 进入到ubuntu之后第一步就是连接你的ssh,一般最方便的就是直接用Terminal(终端),可以在下图的位置找到或者直接按快捷键Ctrl+Alt+T

    From Drop Box

    然后输入:

    ssh -D 7070  -p port -l user yourserver.com

    这里的port为你远端主机的端口名,一般为22或443,有变动的话一般空间商会告知你,user为你自己的用户名,yourserver.com为你ssh服务器域名或IP

    我很不幸,自己的ssh每天准时在我折腾Dropbox扩容的时候down掉,只好用1984.org提供的ssh,偏偏他们不提供shell,说要在命令行中加 -N 参数,否则在Terminal(终端)下一连接上就断开。这个我到最后都没有搞定,只能放弃,改用图形化程序gSTM。这个程序可以在Ubuntu Software Center里找到。

    From Drop Box

    在搜索框里搜索”gstm”

    From Drop Box
    From Drop Box
    From Drop Box

    安装完成后在Application–Internet中打开”gSTM”,点击”Add”

    From Drop Box

    在下图相应位置处填入信息:Name 随意;Host为ssh服务器域名或IP;Login为你的用户名;Port为端口号,一般为22或443。然后再点击”Add”,类型选”Dynamic”,端口填7070,其他默认。

    From Drop Box

  7. 安装Dropbox
  8. 这里有两种方法:一种直接在虚拟机中下载;一种在宿主机中先下载完成,再共享到虚拟机。

    我觉得后一种方法更好,省去了每次在虚拟机中下载的麻烦。虚拟机中要配置,要下载,效率上肯定是比不过宿主机的。不过这里还是一并说明一下:

    一、直接在虚拟机中下载:依次打开Firefox–Edit–Preferences– Advanced–Network–Settings,出现如下图所示:选择Manual proxy configurations,Socks Host填127.0.0.1 Port填7070,确认关闭即可。现在Firefox就全局用ssh代理了,直接去Dropbox的网站下载相应安装程序即可。当然,有人可能知道autoproxy插件,用来甄别是否需要ssh代理,毕竟很多网站并没有被墙,走ssh反而慢。不过在这里本来就不需要开多少网站,安装autoproxy插件,我认为反而麻烦了,走走全局代理即可。

    From Drop Box

    二、在宿主机中先下载完成,再共享到虚拟机:现在宿主机中下载好相应的安装程序,放入一个文件夹然后共享出来,接着在ubuntu虚拟机中依次点击Places–Connect to server,出现如下图所示。Service type根据自己的情况选择,一般大家的宿主机都是Windows吧,那么就选”Windows share”;Server填自己宿主机的IP。然后点”Connect”连接到宿主机,选择相应共享目录下的安装文件拷贝到虚拟机来安装。

    From Drop Box

    但Dropbox的安装很奇怪,也许是因为被墙的原因,大家应该都会碰到,就是安装完成后无法启动Dropbox的问题,我在以前的博里也有讲到。虽然不会很明白问题是如何产生的,也不知道解决问题的原理,但大家只要照做就行了。

    下载Dropbox daemon:32bit 这里;64bit 这里
    解压文件,解压出来的是隐藏文件,所以你可能看不到。
    进入Terminal(终端),切换到你解压文件所在的位置。然后键入:
    .dropbox-dist/dropboxd

  9. 调校Dropbox
  10. Terminal(终端)中键入命令后应该会出现如下界面,这时候还是连不上Dropbox,那是肯定的,永远别忘了Dropbox被墙了。这时候要选择”Connection Options”进行代理设置。

    From Drop Box

    如果没有的话,也可以右键Dropbox图标,点击”Preference”

    From Drop Box

    然后按图中所示填入信息:选择Manually proxy settings,Proxy Type选SOCKS5,Server填127.0.0.1,Port填7070。确认后关闭即可。

    From Drop Box

    然后跳出Setup界面,选择”I already have Dropbox account”。

    From Drop Box

    现在就要用到你文章一开始注册的那些Dropbox帐号了,将其中一个填入下图相应位置。

    From Drop Box

    最后一路Forward完成即可。

    O.K.! Done! Your Dropbox’s Capacity Has Been Enlarged!

  11. 重新再跑一遍虚拟机。
  12. 关键是不要忘了去改虚拟机的MAC地址,不然是无效的!virtualbox里提供修改的位置如下图所示:

    From Drop Box

补充说明1 : 在使用Dropbox的时候记得去改系统的hosts文件(不同的操作系统,这个文件的位置也各不相同,ubuntu下好像需要sudo一下才能修改。),增加这么一段:

174.36.30.67 dropbox.com
174.36.30.71 www.dropbox.com
75.101.129.115 dl.dropbox.com

然后Dropbox的设置改成No proxy server。现在就可以无代理正常使用Dropbox软件的同步功能,网页的话好像还是缺样式表,看上去很糟糕。不过无所谓,大家都很少登陆网页版的吧?如果这个方法失效了那就只能走ssh代理了,比较凄惨,所以尽量在Dropbox里以放小文件为主,电影什么的也走ssh代理就有些痛苦了。

补充说明2 : 如果你有edu邮箱,那么去Dropbox认证一下,你的邀请码每邀请一人可以增加500m空间。这个也很给力,让我们扩容更省力。大家可以试一试下面这个,我测试过,有效:

@ mspil.edu.cn 教育部-微软(中国) 。另外Dropbox的edu邮箱认证地址:这里

总结:

文章有些长,图有些乱,如果你已经头昏眼花了,我这里先简单地给你理理思路。

先用你Dropbox的邀请码申请账号,然后在虚拟机中用这些账号去安装Dropbox,然后利用虚拟机不停变换操作系统特征和网卡的MAC使Dropbox始终认为你在不同的电脑上用不同的账号在安装Dropbox,从而达到扩容的目的。

其中的难点在于:

  1. Dropbox自身被墙,要在虚拟机中翻墙连接Dropbox服务器。
  2. Dropbox在ubuntu下的古怪安装程序,需要辅助措施才能安装完成。

p.s : 如果有朋友确实有困难,又想扩容,我这里可以视情况提供帮助(人太多我就不能为力了),当然一定记得留下你们的邀请码

Fix the Problem which Ubuntu Cannot Root Itself

2010年10月17日 T 1 条评论

先说说今天的Ubuntu Release Party。我因为坐错了车所以去晚了,结果反而坐在了第一排,说实话,以我的视力坐后面几排还真看不清楚,会严重影响我听讲的效果。我觉得这个活动举办得很成功,看到了不少大牛,听到了不少经验。交流了一下就解决了我输入法的大问题,这个前文也有提到。而且又接触到了一个叫Ubuntu-Tweak的软件,那是相当得给力啊。今天这样的活动一定要继续跟进。

今天一回家就开始折腾Ubuntu10.10,结果我那台陈旧的台式机,在调试的时候突然给我来了个死机,无法启动了。我以为废了,要重装,不过老天毕竟还没有绝我之路啊,一般这样的情况在Windows底下我就放弃了。但今天我看了一下错误代码,大致如下(具体的当然记得没那么清楚,但有一句提示我Try passing init=bootarg):

kinit: name_to_dev_t (/dev/disk/by-uuid/84effa58-ee21-420d-9c45-233a552636af) = dev(8,2)
kinit: trying to resume from /dev/disk/by-uuid/84effa58-ee21-420d-9c45-233a552636af)
kinit: no resume imgae, doing normal boot….
mount: mounting /dev/disk/bu-uuid/ac67818a-4afa-4a75-b78a-b53758624b2b on /root failed:invalid argument
mount: mounting /root/dev on /dev/.static/dev failed: no such file or directory
mount: mounting /sys on root/sys failed: no such file or directory
Taget file system doesn’t have /sbin/init
no init found, Try passing init=bootarg
Busybox v1.10.2 (ubuntu 1:1.10.2-1 ubuntu7) built in shell (ash) Enter ‘help’ for a list of built in commands
(initramfs)

我觉得好像不像是致命错误,应该有救,查了一下果然有办法。

  1. 找一张Live CD. (我千辛万苦翻出一张Ubuntu9.04的,lucky~)
  2. 进入Ubuntu系统,打开终端(Terminal)
  3. 输入命令

    sudo e2fsck -C0 -p -f -v /dev/sda1

e2fsck是一个用于检测和修复ext文件系统的命令。(e2fsck is the program for checking and repairing ext series file systems.)其中的/dev/sda1就是你Ubuntu所在的分区,这个参数根据个人不同的情况进行修改。如果不清楚的话可以用下面的命令来察看。

sudo fdisk -l

重新开机就终于又顺利地进到了Ubuntu10.10. OH, yes!


p.s: 情不自禁地要提一下Ubuntu10.10下的字体实在太漂亮了,无论是中文还是英文,这样连写博客都能让人写得那么地愉悦。

Some Ubuntu Tips

2010年10月16日 T 3 条评论

  1. Ubuntu版本更新
  2. Ubuntu10.10已经发布,但现在还没办法从旧版本直接自动更新到新版本。我们可以通过在终端(terminal)键入命令来实现:

    update-manager --devel-release

    这下就可以看到10.10的upgrade按钮了。关于Ubuntu10.10今天因为刚开始用,谈不上什么心得,直观的感受就是字体变了。和以往的Ubuntu风格一样,新字体还是那么的简洁大方、赏心悦目,我从Ubuntu身上倒是看到了前端设计是多么的重要,多么得能黏住用户。

    不过在更新的时候最好不要有其他操作,这篇博文就是在我更新的时候写的,我两台电脑同时更新,几乎都因为chrome的浏览器上写博客导致速度异常缓慢,基本无法接受。

  3. SCIM输入法的bug
  4. 每次升级我都会遇到SCIM输入法的bug,具体说来就是打中文时如果按了方向键或者退位键就再也打不出中文了,一定要再切换一次中英文输入法才行。而打字时方向键或者退位键的使用频率是极高的,所以这个bug严重影响使用。我至今也搞不清原因。

    解决办法只能是删除重装,不过要注意:在Synaptic Package Manager的选中SCIM后一定要Mark for Complete Removal,然后重启后再重装。别问我为什么,我就是这么搞成功的。对了重装的时候别忘了勾选scim-pinyin,勾选scim的时候默认是不装的。

    update1: 测试了一下,还是不行,很奇怪,在浏览器里就是无法使用方向键或者退位键,在gedit里就木有问题。哼,妈了个巴子。

    update2: 今天参加了Ubuntu Release Party,询问了一下别人,开始改用ibus-sunpinyin,好像还不错。

  5. Ubuntu和Windows双系统下调整开机菜单的默认选项。
  6. 关于Ubuntu和Windows双系统的安装可以参考我的这篇文章

    要修改Ubuntu和Windows双系统开机菜单的默认选项就要修改grub,其相关文件位于/etc/default/grub。首先用管理员权限打开

    sudo gedit /etc/default/grub

    修改GRUB_DEFAULT=x(举例来说如果你希望的启动项是第5项,就把GRUB_DEFAULT改为4)。有人还提到可以添加了GRUB_GFXMODE=1024×768,来提高Grub界面的分辨率。我试 了一下,不是很好用,还不如没有这一行的效果好,遂放弃。

    最后在保存了这个文件之后,还需要执行

    sudo update-grub

    这个在刚才的文件里也有提示。

  7. Ubuntu下gedit中无法正确显示中文的问题
  8. 这个问题是偶然发现的。因为要修改一些html文件,结果无论是gedit还是vim都无法正确显示文件中的中文。解决办法:

    Alt-F2后键入gconf-editor,打开“配置编辑器”。展开左边的树节点,找到 /apps/gedit-2/preferences/encodings 节点并单击它。双击右边的 auto_detected 键,打开“编辑键”对话框。单击列表右边的“添加”按钮,输入“GB18030”,单击确定按钮。
    列表的最底部新增加了一个“GB18030”。单击选中它,并单击右边的 “Up” 按钮直到 “GB18030” 位于列表的顶部为止。
    单击确定按钮,关闭配置编辑器。

p.s: 最后情不自禁地推荐两个学习Ubuntu的好地方,Ubuntu中文论坛WOW! Ubuntu,你能想到的问题几乎都能在这里找到,实在太给力了!

在ubuntu内关闭没有响应的程序

2010年9月14日 T 2 条评论

ubuntu很少碰到程序失去响应的情况,可正因为如此,一旦碰到了就束手无策。传统windows下的ctrl+alt+del无用,被我强关了几次以后发现还是要学习一下。正确的做法是:

  1. ctrl+alt+d 切回到桌面
  2. ctrl+alt+t 调用出Terminal
  3. 输入 ps -aux
  4. 在长长的进程表中找出需要关闭的程序的PID,下面的命令里要用到。进程表很长,不好找?失去响应的程序一定占用了cpu和memery,看看哪个的%CPU和%MEM高就可以了
  5. 输入 kill PID(第四步里找到的那个数字)

另外,有人说ctrl+alt+f1可以调出Console,为什么我从来没有成功过?

update (2011.3.30): 有一个更快捷的方法,用命令行注销账户: 调出terminal, 键入

gnome-session-save –kill –silent

分类: computer, linux, study_note 标签:

ubuntu9.10下安装dropbox出现的一个问题

2010年7月9日 T 没有评论

昨天在ubuntu9.10下安装dropbox出了问题:安装完后启动dropbox,提示我”in order to use dropbox you must download propritary daemon“,我没有管他直接按了”ok”,紧接着有蹦出一条错误”Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable.“然后dropbox就启动不起来了,很奇怪的毛病,以前好像没碰到过,但既然有提示己跟着提示走。查了查资料,还确实有人和我碰到一样的情况。最后参考了一下这里的文章,把问题解决了。写在这里公大家参考,顺便做个笔记。

  • 按着提示下载Dropbox daemon:
    32bit: 这里
    64bit: 这里
  • 解压文件,解压出来的是隐藏文件,所以你可能看不到。
  • 进入shell命令行,切换到你解压文件所在的位置。然后键入:

    /.dropbox-dist/dropboxd

好了,现在就ok了,可以顺利在ubuntu9.10下打开dropbox了。家里电脑比较陈旧所以我装的是9.10,在单位我装的是10.04,貌似就没碰到过类似问题,是ubuntu版本号陈旧遗留下的问题吗?迷惑ing…

p.s: 如果你觉得dropbox不错,可以通过这个链接,注册下载使用dropbox,好处是你我都多250m的空间。(虽然没什么效果,但是不写出来还是有些不爽。)

分类: linux, study_note 标签: ,

How to Install .bin Files in Ubuntu

2010年6月1日 T 没有评论

随手记录下,免得忘了。好像挺简单的,可不会的时候就是不会,一点也木有办法。

打开terminal(终端),进到.bin文件所在的目录下,输入以下两条命令:

chmod a+x name_of_file.bin

sudo ./name_of_file.bin

分类: linux, study_note 标签:

(译文)如何设置Ubuntu的swap区

2010年5月24日 T 4 条评论

接着上一篇文章,来讲一讲如何设置Ubuntu的swap区。在ubuntu社区里找到这样一篇文章,点击此处,这里只节选一段翻译供大家学习。


如何添加swap?

swap一般都在一个专有的swap区里,这可能是因为在安装的时候系统会提示你创建一个swap区。但实际上任何文件都可以被用作swap(交换设备),无论是一个分区或是一个简单的文件。尽管如此,为了更好的体验效果和感应速度,还是建议使用大容量的内存,而不是依赖swap。可以通过添加一个swap文件来增加swap。

共分四步
  1. 创建一个你预设好大小的文件。
  2. 将该文件格式化成swap(交换设备)。
  3. 将swap添加到现有系统中。
  4. 在系统里作一个永久性变更。

要添加一个512M的swap

  • 创建一个512M的文件:

我们会在 /mnt/512Mb.swap 上创建一个swap文件。

sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512

代码中的 count=512 的意思是我们要创建文件,其中包含了512个 bs=1M(bs = block size 区块大小; 1M=1mebibyte 一兆 =1048576 bytes 字节) 的区块。 请注意*不要*使用 dd of=/mnt/512Mb.swap bs=1M seek=512 count=0 这条命令。虽然文件会马上增长到512Mb,但是这是有漏洞的,可能会造成无法使用。

  • 格式化文件,使之成为swap(交换设备):
sudo mkswap /mnt/512Mb.swap
  • 将swap加入到现有系统中:
sudo swapon /mnt/512Mb.swap

现在新增的swap可以通过”cat /proc/meminfo“命令看到。

  • 做永久性变更:

编辑 /etc/fstab 文件:

gksudo gedit /etc/fstab

在文件末尾加上如下一行:

/mnt/512Mb.swap  none  swap  sw  0 0

保存并重启。

一个swap文件的示例

如下的例子展现了在一台没有swap分区的电脑上创建和使用swap。

user@computer:~$ sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512
Password:
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 35.3802 seconds, 15.2 MB/s
user@computer:~$ sudo mkswap /mnt/512Mb.swap
Setting up swapspace version 1, size = 536866 kB
no label, UUID=dd6a01c8-93f0-41e0-9b7a-306956d8821b
user@computer:~$ sudo swapon /mnt/512Mb.swap
user@computer:~$ cat /proc/meminfo
MemTotal:       499496 kB
MemFree:          9156 kB
Buffers:          4748 kB
Cached:         233140 kB
SwapCached:        724 kB
Active:         254432 kB
Inactive:       157920 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       499496 kB
LowFree:          9156 kB
SwapTotal:      524280 kB
SwapFree:       523556 kB
Dirty:             128 kB
Writeback:           0 kB
Mapped:         243420 kB
Slab:            20672 kB
CommitLimit:    774028 kB
Committed_AS:   648680 kB
PageTables:       2224 kB
VmallocTotal:   524280 kB
VmallocUsed:      5708 kB
VmallocChunk:   518176 kB
user@computer:~$ gksudo gedit /etc/fstab
user@computer:~$ free
             total       used       free     shared    buffers     cached
Mem:        499496     479488      20008          0       8256     215892
-/+ buffers/cache:     255340     244156
Swap:       524280       3856     520424
#####Then, after running a few more programs...
user@computer:~$ free
             total       used       free     shared    buffers     cached
Mem:        499496     492768       6728          0       1240     142336
-/+ buffers/cache:     349192     150304
Swap:       524280      53384     470896

#####Next, reboot to make sure it will work consistently.
user@computer:~$ free
             total       used       free     shared    buffers     cached
Mem:        499496     493136       6360          0       7528     174700
-/+ buffers/cache:     310908     188588
Swap:       524280      17148     507132

撤销你的变更 :

基本上只要将刚才所做的再反过来做一遍就好了。

gksudo gedit /etc/fstab

删除刚才添加的最末一行

/mnt/512Mb.swap  none  swap  sw  0 0

在现有系统中删除swap并删除创建的swap文件。

sudo swapoff /mnt/512Mb.swap && sudo rm /mnt/512Mb.swap

无需重启。


当然,所有例子都不能生搬硬套。如果按上一篇文章的方法安装双系统,我们就可以把swap区设置在扩展分区里,就是我们说的ubuntu和windows共用的storage区,相应的目录也应该从刚才提到的/mnt/512Mb.swap 改成 /media/xxx/512Mb.swap,xxx每个人都不一样,这取决于你是如何给自己的扩展分区命名的。

分类: computer, linux, study_note 标签: , ,