最近經常使用ubuntu,難免會遇到各種各樣的問題。特記錄下來。
之前在中文模式下,ibus是自動啓動的。在中文模式下有一個不好的地方,桌面,下載這些文件夾都是中文。用命令行進入這些文件夾頓時感到很不爽。所以切換會英文模式。
1 中文模式下切換回英文模式?
修改/etc/default/locale文件的語言值。
將LANG zh_CN.UTF-8修改爲en_US.UTF-8 , LANGUAGE zh_CN:zh修改爲en_US:en
2.英文模式下開機自動啓動IBUS中文輸入法。
英文模式下,ibus不能自動啓動。每次輸入中文都得手動啓動。這個讓人不能接受。google一下,兩種方法。
方法1:system settings->Languange-support->keyboard input method system ->ibus
這種方法我沒試驗成功。如圖所示,選擇了沒有保存按鈕。我以爲是默認保存的。但是關了在打開發現還是沒有選擇上。有可能語言包沒有按完整的語言,每次進入語言設置,都會提示語言包沒有安裝完整。
方法2:添加ibus設置爲開機啓動的應用
system->preferences->startup application
-d 的意思是讓ibus在後臺運行
3.筆記本裝win7和ubuntu雙系統,在ubuntu下發熱量大。
開機進入ubuntu,風扇就沒停過,沒過多久你就會發現筆記本那個熱的。現在才五月份,成都還不是很熱,要是等到七八月份,我那筆記本估計都能煮蛋了。這個樣子是不行的,上網搜解決方法。各種各樣的回答。但是從字裏行間能發現,如果筆記本是雙顯卡的,出現這個問題概率很高。所以決定禁掉獨立顯卡。我的顯卡是N卡,貌似看到禁A卡的方式不太一樣。
使用軟件bumblebee禁掉N卡(參考 http://hi.baidu.com/gylxue/blog/item/7c95e4ecb44071ce2e2e2107.html)
sudo add-apt-repository ppa:bumblebee/stable
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install bumblebee
sudo apt-get install bumblebee-nvidia
在輸入
lspci | grep -i vga
nvidia顯卡那一行最後有個 rev ff ,表示獨顯已經關閉了 .
獨立顯卡禁掉後,現在明顯發熱量沒那麼大了。
4.ubuntu root用戶下使用chrome
apt-get install hexedit
hexedit /opt/google/chrome/chrome
打開文件內容如下,左邊爲16進制,右邊爲Ascii嘛.光標打開是在左邊,用tab鍵將光標切換到後邊Ascii碼。Ctrl+S打開搜索界面,輸入geteuid,定位後,將geteuid改爲getppid。5、Netbeans語言改爲英文,並且支持顯示中文.
- 從windows C:\Windows\Fonts複製一個字體,我複製的是微軟雅黑
- 將字體複製到Java_HOME下jre/lib/fonts/fallback,如果沒有fallback,建一個.
chmod 644 msyhbd.ttf chmod 644 msyh.ttf mkfontscale && mkfontdir
- 這是會在fallback目錄產生fonts.dir fonts.scale,再將fonts.scale的內容追加到父目錄的fonts.dir
- cat fonts.scale >> ../fonts.dir
6、Netbeans支持輸入中文
add-apt-repository ppa:fcitx-team/nightly
apt-get update
apt-get install fcitx
update:7.統計代碼行數
wc -l *.c *.h
8.安裝win7和ubuntu雙系統後,重啓無ubuntu啓動項
root@jackie-desktop:/etc/ESP# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x7fdeb80e
Device Boot Start End Blocks Id System
/dev/sda1 * 63 167782859 83891398+ 7 HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sda2 167782921 829853639 331035359+ f W95 Ext'd (LBA)
Partition 2 does not start on physical sector boundary.
/dev/sda3 829853696 833853439 1999872 82 Linux swap / Solaris
/dev/sda4 833853440 976771071 71458816 83 Linux
/dev/sda5 167782923 419473214 125845146 7 HPFS/NTFS/exFAT
Partition 5 does not start on physical sector boundary.
/dev/sda6 419473278 671163569 125845146 7 HPFS/NTFS/exFAT
Partition 6 does not start on physical sector boundary.
/dev/sda7 671163633 829853639 79345003+ 7 HPFS/NTFS/exFAT
Partition 7 does not start on physical sector boundary.
這一行 /dev/sda4 833853440 976771071 71458816 83 Linux
mkdir /media/tmp
mount /dev/sda4 /media/tmp
5.在終端中輸入命令:grub-install --root-directory=/media/temp /dev/sda。重新安裝grub2到硬盤的主引導記錄MBR中,出現“Installation finished.No Error Reported.”表示操作成功。