[Fedora 12]關閉FireFox的離線模式(Offline mode)

摘錄自原文

Find “browser.offline-apps.notify” in the “about:config” method and set it to false.

toolkit.networkmanager.disable to “true”

————————————–

在用Linux時,是否會被那離線模式(Offline mode)給弄煩了呢?
無網路連線時會顯示離線模式,而當有網路連線時卻還是會留在離線模式

 

可照以下作法:

在FireFox上的網址列打入

about:config

會出現一個 You might void your warranty 的警告訊息
,按 I’ll be careful I promise! 繼續

在 Filter: 裡搜尋

browser.offline-apps.notify

雙點該項目,值從True -> False

相同的方法搜尋

toolkit.networkmanager.disable

雙點該項目,值從False -> True

完成

[轉貼]IP/Subnet子網路切割表示法

來源:http://vbb.twftp.org/showthread.php?t=5085

在IPv4的協定下,IP位址是由4個8位元組成的數字來表達,如200.1.1.130。一個IP位址分為網路位址(Network
Address)+主機位址(Host
Address),依網路位址所佔的位元數不同而分為A/B/C/D級網路。IP數字的0及255是預設的主機及廣播位址無法使用,所以每個數字可用的
IP位址變化只有254個(256-2),這也就是一般C級網段的Gateway
IP都預設x.x.x.254的緣故。IPv4的位址因為ABCD型網段的配法而無法完全應用到254四次方那樣多的可用IP值,隨著世界上主機數遞
增,IP位址漸漸不夠用了!在IPv6的應用尚未完全普及之時,就得利用切分子網路(Subnet)的方式來有效分配IP位址。

某台網路主機,它的IP及子網路表示法為200.1.1.130/28,從這樣簡短的字句,你該立刻看出什麼呢?

1.子網路的遮罩位址為何?
該數字28是代表遮罩IP位址的網路位址所佔位元數,即:11111111.11111111.11111111.11110000,遮罩位元為1者是讓
IP通過(合法),0者為阻擋,所以從上述的32位元分布,我們得知它的網段型態是屬於C型位址,因此十進位的遮罩位址就是
255.255.255.240(只需要求算右邊那四個1),即 128 + 64 + 32 + 16 = 240

2.可切成幾個子網路?
數字1是讓IP通過,所以只要注意1的位元變化組合(因為後面的0怎麼變化都會被擋住),(1111)= 2^4 = 16,共有16種變化。

3.每個子網段有幾個IP值?
子網路ip數為 256/16 = 16 (有效IP為14,因為頭尾IP要去除)

4.每個子網路的IP起迄位址?
200.1.1.0-15,200.1.1.16-31,200.1.1.32-48,…,200.1.1.240-255
例如,主機IP為200.1.1.130/28的所在子網路起迄IP為: 130/16 = 8, 16 * 8 = 128,故在 200.1.1.128-143。

假如上述你都了解的話,讓我們反過來思考,用子網路IP起迄位址,反推出它的IP/Subnet表達格式?例如,我們要讓某C級網段(192.83.184.*)下的IP合法通過,這組子網路該怎麼用IP/Subnet格式表示呢?

首先,第四個IP值不遮封,因此遮罩IP位址的2進位是: 11111111.11111111.11111111.00000000
(255.255.255.0),其網路位址位元數共24個,因此寫法是:
192.83.184.0/24,依此類推,B級網段就是192.84.0.0/16,全部開放就是:
0.0.0.0/0。所以,從IP位址的二進位表示法的位元分布,就可看出其背後的隱藏資訊,只要您能了解這些概念就可直接看出來,不需再作
IP(192.83.184.0)轉二進位的運算(江湖一點訣)。

 

—————————————————————

還有另外一篇,由於是全文轉貼,所以就不放費空間去貼了

感謝原作者的好文章,讓我去好好加強網路概念

http://caf677.pixnet.net/blog/post/22615302

 

[Ubuntu10.04] 關於Ubuntu的一些雜記

切換root

sudo su –

修改root密碼

sudo passwd root

 使用vi

apt-get vim;alias vi=’vim’

vi ~/.vimrc

引用:http://linux.vbird.org/linux_basic/0310vi.php#vim_set

:set nu
:set nonu
就是設定與取消行號啊!
:syntax on
:syntax off
是否依據程式相關語法顯示不同顏色? 舉例來說,在編輯一個純文字檔時,如果開頭是以 # 開始,那麼該行就會變成藍色。 如果你懂得寫程式,那麼這個 :syntax on 還會主動的幫你除錯呢!但是, 如果你僅是編寫純文字檔案,要避免顏色對你的螢幕產生的干擾,則可以取消這個設定 。
:set bg=dark
:set bg=light
可用以顯示不同的顏色色調,預設是『 light 』。如果你常常發現註解的字體深藍色實在很不容易看, 那麼這裡可以設定為 dark 喔!試看看,會有不同的樣式呢!

 

關於GRUB2

引用:http://wiki.ubuntu-tw.org/index.php?title=GRUB_2_%E4%B8%AD%E6%96%87%E6%8C%87%E5%8D%97#.E5.A2.9E.E5.8A.A0.E5.8A.9F.E8.83.BD

  • 沒有 /boot/grub/menu.lst。已被 /boot/grub/grub.cfg 取代。
  • 在 grub 提示符號下沒有「/find boot/grub/stage1」。Stage 1.5 被淘汰了。
  • 主要選單檔,/boot/grub/grub.cfg,不應再被手動編輯,即使是由「root」身份。
  • grub.cfg 會在任何有更新、核心被加入/移除或是使用者執行 update-grub 的時候被覆寫。
  • 主要用來改變顯示設定的設定檔是 /etc/default/grub
  •  其他參見說明

     

    [Ubuntu10.04] Apt-get指令用法和yum對照

    我是Fedora派的,不管是Cent OS或Fedora都好好用
    但我又被ubuntu的強大視窗特效和親合力很高的圖型介面所吸引
    不過ubuntu是用debian系列的,指令介面用起來還是有點卡卡的,試試看也不錯。

    我紀錄一下這指令用法,和做一些對照,YUM比較常用

    引用:http://wiki.debian.org.hk/w/Install_software_with_APT

    更新最新的軟件資料 (apt-get update)

    YUM指令對照:yum update

    在系統管理員帳戶(即root)下打「apt-get update」更新最新的軟件資料:

    # apt-get update
    下載:1 ftp://ftp.hk.debian.org stable/main Packages [3577kB]
    已有 http://deb.opera.com stable/non-free Packages
    略過 http://deb.opera.com stable/non-free Release
    下載:2 ftp://ftp.hk.debian.org stable/main Release [82B]
    下載:3 ftp://ftp.hk.debian.org stable/main Sources [1415kB]
    讀取 4992kB 用了 11s (159kB/s)
    讀取套件清單中... 完成
    

    搜尋軟件 (apt-cache search)

    YUM指令對照:yum search 關鍵字

    先用 “apt-cache search 關鍵字 ...” 搜尋軟件:

    $ apt-cache search image manipulate
    cinepaint - motion picture image painting and retouching tool
    fujiplay - Interface for Fuji digital cameras
    gnubik - 3D Rubik's cube game
    gtkmorph - Digital image warp and morph (gtk)
    gtkmorph-example - digital image warp and morph, examples
    imagemagick - Image manipulation programs
    jhead - manipulate the non-image part of Exif compliant JPEG files
    jpegpixi - Remove hot spots from JPEG images with minimal quality loss
    

    安裝軟件 (apt-get install)

    YUM指令對照:yum install  套件名稱

    apt-get install 套件名稱

    # apt-get install imagemagick
    Reading Package Lists... Done
    Building Dependency Tree... Done
    Suggested packages:
    html2ps lpr
    The following NEW packages will be installed:
    imagemagick
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0B/1466kB of archives.
    After unpacking 5325kB of additional disk space will be used.
    Selecting previously deselected package imagemagick.
    (Reading database ... 60636 files and directories currently installed.)
    Unpacking imagemagick (from .../imagemagick_6%3a6.0.6.2-2.4_i386.deb) ...
    Setting up imagemagick (6.0.6.2-2.4) ...
    

    移除軟件 (apt-get remove)

    要移除套件,可以在系統管理員帳戶(即root)下打「apt-get remove 套件名稱」,APT就會把所指定的套件和相依的套件一併移除。不過apt-get remove不會移除套件所屬的設定檔,要把設定檔也一併移除,就要加入選項「--purge」。

    YUM指令對照:yum erase 套件名稱

    # apt-get --purge remove imagemagick
    Reading Package Lists... Done
    Building Dependency Tree... Done
    The following packages will be REMOVED:
    imagemagick*
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    Need to get 0B of archives.
    After unpacking 5325kB disk space will be freed.
    Do you want to continue? [Y/n]
    (Reading database ... 60867 files and directories currently installed.)
    Removing imagemagick ...
    Purging configuration files for imagemagick ...
    

    顯示個別軟件詳細資訊 (apt-cache show) (很少用)

    YUM指令對照:yum list 套件名稱

    如果想知道個別套件詳細資訊,可以打 "apt-cache show 套件名稱":

    $ apt-cache show imagemagick
    Package: imagemagick
    Priority: optional
    Section: graphics
    Installed-Size: 5200
    Maintainer: Ryuichi Arafune <[email protected]>
    Architecture: i386
    Version: 6:6.0.6.2-2.4
    Replaces: imagemagick-doc, geomview (<= 1.8.0)
    Depends: libmagick6 (= 6:6.0.6.2-2.4)
    Suggests: gs, html2ps, lpr
    Conflicts: imagemagick-doc
    Filename: pool/main/i/imagemagick/imagemagick_6.0.6.2-2.4_i386.deb
    Size: 1465598
    MD5sum: 4b9eb6cda5f5fe0c20040c9647ee2b6f
    Description: Image manipulation programs
    Imagemagick is a set of programs to manipulate various image formats
    (JPEG, TIFF, PhotoCD, PBM, XPM, etc...). All manipulations can
    be achieved through shell commands as well as through a X11 graphical
    interface (display).
    .
    Possible effects: colormap manipulation, channel operations, thumbnail
    creation, image annotation, limited drawing, image distortion, etc...
    .
    This package suggests a postscript interpreter (gs) to read postscript
    files. It will however function happily without it (as long as you don't
    want to read postscript).
    

    [Fedora12] 開機失敗

    最近遇到選完GRUB選單,然後Fedora開機卡住的問題

    螢幕只剩下一個小點點 (或底線 _ ) 在那邊閃呀閃

     

     

    硬體是HP dx2000mt的電腦      Intel 865GV晶片組

    引用:http://lkml.indiana.edu/hypermail/linux/kernel/0308.1/1105.html
    https://bugzilla.redhat.com/show_bug.cgi?id=521423

     

    查到是說,是ACPI(進階電源管理)的問題

    關於ACPI,這裡有他的很棒的說明

    http://www.delightpress.com.tw/article_c.aspx?article_id=8

    簡單說就是控制電腦在休眠待命和關機的一些電源控制
    作業系統需要偵測硬體和與BIOS做溝通

    如果你也是遇到這種問題,先把核心參數

    rhgb quiet

    這二個拿掉,才能顯示詳細的內容

     

    然後嘗試加上

    acpi=ht

    這是針對核心有HT技術的硬體架構所開發 (Intel ICH5 APIC)
    可以略過一些硬體偵測,又可以打開Hyper-threading技術

    如果嘗試這個不行

    只好使用這個相容性最高的參數

    acpi=off

    當然,在關機時不能自動軟關機

     

    如果不行的話可以依序試試

    acpi=noirq

    pci=routeirq

    pci=noacpi

    acpi=noirq

    pci=nomsi

     

    ——————————————————————————————————-

    引用:http://www.cyberciti.biz/howto/question/static/linux-kernel-parameters.php

    其他開機核心參數

            acpi=           [HW,ACPI] Advanced Configuration and Power Interface
                            Format: { force | off | ht | strict | noirq }
                            force — enable ACPI if default was off
                            off — disable ACPI if default was on
                            noirq — do not use ACPI for IRQ routing
                            ht — run only enough ACPI to enable Hyper Threading
                            strict — Be less tolerant of platforms that are not
                                    strictly ACPI specification compliant.

     

            pci=option[,option…]  [PCI] various PCI subsystem options:
                    off             [IA-32] don’t probe for the PCI bus
                    bios            [IA-32] force use of PCI BIOS, don’t access
                                    the hardware directly. Use this if your machine
                                    has a non-standard PCI host bridge.
                    nobios          [IA-32] disallow use of PCI BIOS, only direct
                                    hardware access methods are allowed. Use this
                                    if you experience crashes upon bootup and you
                                    suspect they are caused by the BIOS.
                    conf1           [IA-32] Force use of PCI Configuration
                                    Mechanism 1.
                    conf2           [IA-32] Force use of PCI Configuration
                                    Mechanism 2.
                    nosort          [IA-32] Don’t sort PCI devices according to
                                    order given by the PCI BIOS. This sorting is
                                    done to get a device order compatible with
                                    older kernels.
                    biosirq         [IA-32] Use PCI BIOS calls to get the interrupt
                                    routing table. These calls are known to be buggy
                                    on several machines and they hang the machine
                                    when used, but on other computers it’s the only
                                    way to get the interrupt routing table. Try
                                    this option if the kernel is unable to allocate
                                    IRQs or discover secondary PCI buses on your
                                    motherboard.
                    rom             [IA-32] Assign address space to expansion ROMs.
                                    Use with caution as certain devices share
                                    address decoders between ROMs and other
                                    resources.
                    irqmask=0xMMMM  [IA-32] Set a bit mask of IRQs allowed to be
                                    assigned automatically to PCI devices. You can
                                    make the kernel exclude IRQs of your ISA cards
                                    this way.
                    pirqaddr=0xAAAAA        [IA-32] Specify the physical address
                                    of the PIRQ table (normally generated
                                    by the BIOS) if it is outside the
                                    F0000h-100000h range.
                    lastbus=N       [IA-32] Scan all bus
    es thru bus #N. Can be
                                    useful if the kernel is unable to find your
                                    secondary buses and you want to tell it
                                    explicitly which ones they are.
                    assign-busses   [IA-32] Always assign all PCI bus
                                    numbers ourselves, overriding
                                    whatever the firmware may have done.
                    usepirqmask     [IA-32] Honor the possible IRQ mask stored
                                    in the BIOS $PIR table. This is needed on
                                    some systems with broken BIOSes, notably
                                    some HP Pavilion N5400 and Omnibook XE3
                                    notebooks. This will have no effect if ACPI
                                    IRQ routing is enabled.
                    noacpi          [IA-32] Do not use ACPI for IRQ routing
                                    or for PCI scanning.
                    routeirq        Do IRQ routing for all PCI devices.
                                    This is normally done in pci_enable_device(),
                                    so this option is a temporary workaround
                                    for broken drivers that don’t call it.
                    firmware        [ARM] Do not re-enumerate the bus but instead
                                    just use the configuration from the
                                    bootloader. This is currently used on
                                    IXP2000 systems where the bus has to be
                                    configured a certain way for adjunct CPUs.

     

    [Fedora 12]VGA顯卡的相關顯示問題

    文字模式顯示問題

    引用:https://fedoraproject.org/wiki/Common_F12_bugs#Miscellaneous_problems_with_Intel_graphics_adapters

    我的硬體是Intel 865GV晶片組的內建顯卡82865G

    在裝fedora 12時,只要是在文字模式載入的時候(類似DOS)
    螢幕就會顯示Not Supported Mode (螢幕不支援的顯示模式)
    進入圖型模式後就正常了

     

    原因是說Linux錯的驅動(或是沒有驅動)導致在顯示的時候出不來
    (好像是VESA Driver吧,反正網路上找也沒有適合的)

    解法只要在Grub選單的時侯,在Fedora (2.6.32.11-99.fc12.i686)
    按下e,然後加入

    nomodeset

    這樣就會正常跑出loading的Bar了

    修改grub.conf (或是menu.lst)

    #vi /boot/grub/grub.conf

    我列出我的其中一項

    title Fedora (2.6.32.11-99.fc12.i686)
            root (hd0,1)
            kernel /boot/vmlinuz-2.6.32.11-99.fc12.i686 ro root=UUID=83ef3ac6-d581-4536-a6bb-6a06c9060094 noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet nomodeset
            initrd /boot/initramfs-2.6.32.11-99.fc12.i686.img

     

    版號請以你的為主,在kernel那行的最後
    KEYTABLE=us rhgb quiet加上nomodeset

    就OK了

    ——————————————————————————————–

    如果想修改在文字模式的顯示解析度

    可以用上述方式再加上

    vga=791

    代表是用1024×768的32位元全彩顯示
    (迷之音:還真豪華…)

    如果想相同性高一些(像我這種電腦)

    在kernel那行的最後,去除rhgb quiet參數,加上

    nomodeset vga=769

    這樣就會有最多的資訊了(當然開機還沒進桌面前都蠻醜的)
    (註:rhgb代表圖形用顯示開機情況,較美觀。而quiet代表不顯示詳細訊息)

     

    以下是其他常用的解析度參數,不含括號的註解
    引用:http://soft.zdnet.com.cn/software_zone/2007/1011/545493.shtml

    vga=769 (640x480x256) 
    vga=771 (800x600x256)
    vga=788 (800x600x645536)
    vga=773 (1024x768x256)
    vga=791 (1024x768x65536)

     

    ——————————————————————————————–

    沒有顯示滑鼠游標

    之後又發現一個問題,就是在登入後進入桌面時,沒有顯示滑鼠游標

     

    引用:http://phorum.vbird.org/viewtopic.php?f=2&t=33926&view=previous

    : 在進去的藍色畫面時都還可以看到滑鼠,
    : 可是當他變成登入的畫面時,滑鼠圖案消失了!!
    : 滑鼠其實一直都存在,因為我有移動滑鼠亂點確實還可以點擊,
    : 但是滑鼠的圖案卻都看不到,有沒有人遇到這個問題??
    : 要怎樣解決這個問題呢?? 謝謝教導。

    像是文章說的

    我的解決辦法是在xorg.conf下改參數

    但Fedora 12預設不會幫我們產生/etc/X11/xorg.conf

    先執行
    #Xorg -configure :1
    增測硬體設備

    #mv /etc/X11/xorg.conf.new /etc/X11/xorg.conf
    移動設定檔到/etc/X11/xorg.conf

    然後修改之

    #vi /etc/X11/xorg.conf

    Section “Device”
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: “True”/”False”,
    ### <string>: “String”, <freq>: “<f> Hz/kHz/MHz”
    ### [arg]: arg optional
    #Option “NoAccel” # [<bool>]
    #Option “SWcursor” # [<bool>]
    #Option “ColorKey” # <i>
    #Option “CacheLines” # <i>
    #Option “Dac6Bit” # [<bool>]
    #Option “DRI” # [<bool>]
    #Option “NoDDC” # [<bool>]
    #Option “ShowCache” # [<bool>]
    #Option “XvMCSurfaces” # <i>
    #Option “PageFlip” # [<bool>]
    Identifier “Card0”
    Driver “intel”
    VendorName “Intel Corporation”
    BoardName “82865G Integrated Graphics Controller”
    BusID “PCI:0:2:0”

    Option “NoAccel” “True”
    Option “SWcursor” “True”

    EndSection

     

    在上述區塊加入紅色的字,然後登出再登入即可
    好像每張卡的都不太一樣
    像文章裡寫到

    BoardName “nVidia Corporation C51 PCI Express Bridge”
    下面加入這一行
    Option “HWcursor” “false”
    登出再登入,就行了!

    我的顯卡就沒有上述說的那個參數
    如果我的方法不能使用,可以試試看他的

    ———————————————————————————————

    後記:

    google到cent os 5也有這問題
    http://www.samtseng.liho.tw/~samtz/blog/?p=2488
    CentOS 5 滑鼠指標消失的問題
    編輯 /etc/X11/xorg.conf 檔案 加入 Option “HWCursor” “off”

    我的另一台電腦也裝了Fedora 12和ubuntu,也有這前者的問題
    顯卡是Ati Radeon 9550

    似乎有Driver,嘗試安裝中…..

    [轉貼] linux使用wget透過proxy抓取檔案

      
    所以在linux使用wget抓取檔案,若要透過proxy 必須如下:

    vi /etc/wgetrc,找到以下兩行,並將以下參數

     #passive_ftp = off <- 是否關閉 passive mode
     #http_proxy = http://163.28.80.40:3128/ <- 設定台中區網的 proxy ip

     前面的 # 刪除後,修改為

    passive_ftp = off
    http_proxy=http://163.28.80.40:3128/
    ftp_proxy = http://163.28.80.40:3128/
    use_proxy = on

    存檔後再用 wget 抓檔就會比較快了

    [分享] Synergy–讓你一組鍵盤滑鼠在二台電腦間遊走

    就如同標題所述,對於我這種同時使用筆電和桌電的人真的是一大福音

    Synergy這個軟體,大家對他的介紹都是軟體KVM,一組鍵盤滑鼠共用多台電腦。
    我對他的解釋,不如說是一個沒有畫面的遠端操控軟體。

    對於一個人同時使用二台電腦時候,如美工人員或是系統管理師,這真的可以派上用場
    用起來好像是延伸桌面,但是是二台電腦幫為你服務

    對於正在使用Linux學習的使用者也很方便,XP下打開文章,另一邊打開Terminal,可以同時看文章和操作
    文章看到的指令,複製一下,滑鼠拉過去,就可以貼到Terminal了,真的是超方便的。

     

    我很久以前就有想過可以寫這種軟體,還搭配傳檔….等等(好啦離題了。)

    主要特色:

    • 利用網路達到鍵盤滑鼠共用 (一台鍵盤/滑鼠操控二台電腦,前提是二台電腦都要有螢幕)
    • 剪貼簿共享 (A電腦複製,B電腦貼上)
    • 同步進入螢幕保護程式,也可以同時被喚醒(只在同OS下才適用)
    • 可以跨平台(Win7、XP、Mac、Fedora、Ubuntu、CentOS….等等的Linux)
    • 免費,自由軟體

    唯一個小小的缺點,就是不能傳檔 (A電腦的檔案直接拉到B電腦),不過可以用網芳….等等方法去解決。

    還有不適合一套電腦操作一台「主機」,連螢幕都沒有,或是一台電腦不在你面前(電腦在機房)
    這樣的話,遠端操控軟體 (例如:XP的遠端桌面、VNC….等等)會比較適合你。


    設定方法:

    你插鍵盤滑鼠的那台電腦為Server,其餘為Client

    以我的例子

    我的電腦左邊是Fedora桌機,插著鍵盤滑鼠
    右邊則是筆電

    Fedora Linux的設定方法

    打開Terminal打入指令

    yum install synergy quicksynergy -y

    等待安裝完成

    在Appliccations → Internet → QuickSynergy

     Screenshot-1.png   

    依畫面打入其相對位置的電腦名稱,然後按Execute

    (XP的話在我的電腦右鍵→內容,在電腦名稱的頁籤裡)

    Screenshot-QuickSynergy.png

    防火牆記得要打開 TCP 24800 連接埠

    以下是防火牆設定

    System → Administration → Firewall

    Screenshot-2.png

    第一個對話框可以不用理他,然後打入root的密碼

     Screenshot-3.png

     

    在其左邊選擇 Other Ports,右邊按下Add

    把User Defined打勾,在Port / Port Range打入24800,Protocol選擇TCP,然後按OK

    Screenshot-4.png

     最後按Apply存檔

     


     

    XP的話直接到以下網址去下載

    http://sourceforge.net/projects/synergy2/files/Binaries/1.3.1/SynergyInstaller-1.3.1.exe/download

    然後安裝起來

    打開Synergy,會有我類似的圖,在這個Client中打入IP位址 (也可以打Linux的HostName拉,只是比較不容易找到就是了)

     2010-05-30 14 31 48.png

    然後按下Test測試看看,有

    NOTE: connected to server

    字樣代表連線成功,然後再滑鼠滑到螢幕邊界看看,理論上應該可以從另一台螢幕出來

    Screenshot.png

    這樣就成功了

     

     

     

    參考資料:

    http://qwweee7467.spaces.live.com/Blog/cns!A4205F53E9B9B1B4!905.entry
    http://hohayo.pixnet.net/blog/post/25718509
    http://blog.ssh.tw/?p=344
    http://synergy2.sourceforge.net/

    [linux bash] 建立格式化過的Shell Script

    #!/bin/bash
    #————————————
    #Time:2010/05/03 22:41
    #Author:Johnny
    #Comment:建立一個屬於自己格式的Shell Script
    #————————————

    # 檢查參數是否足夠
    [ “$#” -lt 1 ] && echo “ERROR: Missing arguments (less than 1).” \
            && exit 0

    # 檢查檔案是否存在,不存在就建立
    if [ “$(cat $1)” == ” ]; then
    echo “File Created.”
    else
    echo “ERROR: File exist.” && exit 0
    fi

    # 建立其檔案內容(註:中間的註解也會被寫入,中間可以修改作者的名字)
    cat > $1 <<end
    #!/bin/bash
    #————————————
    #Time:$(date +%Y)/$(date +%m)/$(date +%d) $(date +%H):$(date +%M)
    #Author:Johnny
    #Comment:
    #————————————
    end
    # 該屬性更改為可執行的檔案
    chmod +x $1

    我在這裡解釋一下這要怎麼用

    將其存成mksh,可以直接放在/bin下

    就可以直接打

    $ mksh test.sh

    就會有一個自己格式的shell script了

    $ cat test.sh

    #!/bin/bash
    #————————————
    #File:test.sh
    #Time:2010/05/03 23:35
    #Author:Johnny
    #Comment:
    #————————————

    [Fedora12] 一些雜項設定

    WindowsXP和Fedora的時間不同步

    Screenshot.png 

    WindowsXP和Fedora 12 linux的雙系統環境下,時間一直會不同步? 

    (XP下使用正常,但切到Fedora後時間雖然正確,但回到XP後時間就會差8個小時)

    http://hi.baidu.com/wyl0367/blog/item/8333cdfa0a82de9e58ee90cd.html

    原因在於BIOS的時間沒有存時區,而Fedora預設會以UTC時間存到BIOS裡

    「系統」→「管理」→「時間和日期」→「時區」,把UTC的勾去掉,就行了

    System -> Administraton -> Date & Time

    Time Zone頁籤下,System Clock uses UTC 勾勾取消


    新酷音的符號輸入方法

    引用:http://briian.com/?p=404

     Linux下開啟新酷音輸入法請見:http://j796160836.pixnet.net/blog/post/25444345

    Screenshot-IBus Preferences-1.png  

    當我們用「新酷音輸入法」在輸入中文字時,可以按一下鍵盤上左上角的「~」按鍵,便可出現剛剛設定的特殊符號選單,我們可以用鍵盤上下左右鍵來選擇想要輸入的符號。(空白鍵換頁)

    建議鉤上幾個選項

    自動移游標,這選項才會和新注音的感覺差不多,要刪預先字時才不會刪錯

    Esc鍵清理預編區

    輸入風格可以依照喜好來設定


    開機自動打開Numlock

    引用:http://www.linuxquestions.org/questions/fedora-35/numlock-key-turn-on-420427/

    可以裝一個很簡單的套件numlockx

    numlockx.i686 : NumLockX turns on NumLock after starting X

     

    YUM掛Proxy下載套件

    引用:http://www.fedoraforum.org/forum/showthread.php?s=&threadid=7

    修改yum.conf

    vi /etc/yum.conf

    在裡面加入一行

    http_proxy=http://strong>user:passwd@proxy.foo.com:portnumber

    上述的

    user為帳號,passwd為密碼,proxy.foo.com為proxy的位址,portnumber為連接埠號