Ubuntu 12.04 LTS Toss Little Notes _ essays

Source: Internet
Author: User
Tags gtk locale
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =///Ubuntu solution to heat problem
Build Eclipse's Java build environment on Ubuntu
The default setting of the Ubuntu/win7 dual system for Eclipse Indigo
0. Preamble

Summer leisure to have nothing to try new things, the face of unbearable system reload is the most convenient cleaning work. Between worrying about a new version of Ubuntu's Fever [Dell Books], last used a xubuntu of aesthetics, ╮(╯▽╰)╭

We use is really good, set + in = life. Wisdom ~ Study Summary ~\ (≧▽≦)/~ The solution of the Fever problem of 1.Ubuntu [success greatly cool down ~!!!]

Graphics driver has been a Linux mishap ah. Once my computer is installed with a closed source driver, the GUI hangs. Recently heard another good way: Turn off the standalone video card. Anyway, not playing games, integrated video card is absolutely enough.

The code is very simple, I get rid of the restart and so did not find any problems, you can rest assured use.

Everything I say is done under root, so switch to root. One: Verify that your kernel can switch dual graphics

Cat  /sys/kernel/debug/vgaswitcheroo/switch

This is possible if the following text appears.

0:dis::P wr:0000:01:00.0
1:igd:+:P wr:0000:00:02.0

Note: IGD is an integrated graphics card, dis is a stand-alone video card II: Off-alone display

echo "Off" >/sys/kernel/debug/vgaswitcheroo/switch

And then look at

Cat  /sys/kernel/debug/vgaswitcheroo/switch

Should be turned into a

0:dis:: off:0000:01:00.0
1:igd:+:P wr:0000:00:02.0

Congratulations, it worked.

Solve the problem of hard disk heating

In Ubuntu, the size of the swappiness value has a big connection to how the swap partition is used. Swappiness=0 the maximum use of physical memory, and then the swap space, swappiness=100 when the positive use of the swap partition, and the memory of the data in a timely manner into the swap space. Two extremes, for Ubuntu's default setting, this value is equal to 60, and the recommended modification is 10. To do this specifically:

1. View your system inside of the swappiness cat/proc/sys/vm/swappiness not an accident, you should see is 60
  

2. Modify the swappiness value of the Sysctl vm.swappiness=10 but this is only a temporary change, after you restart the system will restore the default of 60, so you have to do one step:
Gksudo gedit/etc/sysctl.conf at the end of this document with one line: vm.swappiness=10 then save and reboot. OK, your settings are in effect. You will find that the rabbit is running faster now.
Of course, you can use other editors to modify, such as Kate,vi,vim,nano ... Just have to replace the gedit with them OK. Because considering the GNOME desktop that most people use, write the gedit.

I love the Linux release version of Ubuntu, but there is a problem that has plagued me for a long time: the hard drive temperature in the bottom right corner is significantly higher than using XP.

Reasons on the Internet to find a lot, some said it is because of the fingerprint identification, there is also said to be the reason for the wireless network card, but now through the test, feel the possibility of a larger disk.

Ubuntu in the AC mode, the hard drive in High-performance state, the head does not return, the hard drive does not slow down, so the temperature is higher than under XP. But in the use of batteries, the hard disk in order to slow down power, the head will be ordinary return, the temperature will naturally come down, but the head of the position value will be like WIN7 and XP system under the same very high, the hard disk life has a certain impact (a tradeoff).

If you want to reduce the hard drive temperature, you can use this workaround:

1. Install laptop-mode-tools sudo apt-get install Laptop-mode-tools

2. Modify Power Management configuration: laptop-mode.conf sudo gedit/etc/laptop-mode/laptop-mode.conf

Modify Profile: # Description of the parameter please refer to the note in the file
Enable_laptop_mode_on_ac=1 # when the laptop uses alternating current, it also opens the Laptop-mode
Enable_laptop_mode_when_lid_closed=1

minimum_battery_charge_percent=11
Disable_laptop_mode_on_critical_battery_level=7

Control_hd_idle_timeout=0
# Archlinux/debian default 20, resulting in hard drive often stop turn, Ubuntu default 60, with a few days without feeling. Anyway, I turned off this feature.
Lm_ac_hd_idle_timeout_seconds=20
Lm_batt_hd_idle_timeout_seconds=20

Control_hd_powermgmt=1
# Archlinux/debian is not enabled by default, Ubuntu is enabled by default, I also set to enable, but modify the following three values.
batt_hd_powermgmt=192
lm_ac_hd_powermgmt=192
nolm_ac_hd_powermgmt=192

After the test (on the ThinkPad), after the modification, the hard disk temperature has been kept below 40 degrees.

2. Build codeblocks on Ubuntu on the C + + compilation Environment

In the case of networking, enter the following instructions for installation.

1. Install the basic compilation environment

$sudo Apt-get Install Build-essential

$sudo Apt-get Install GDB



2. Install Codeblock

$sudo Apt-get Install Codeblocks

$sudo Apt-get Install codeblocks-dbg

$sudo Apt-get Install Wxformbuilder

($sudo apt-get Install contrib, the original author explained, this is the installation of Wxsmith, if not installed is the use of WXFB. )

or directly in the Ubuntu Software Center, the keyword search codeblock can find codeblock to install.

I was installed in the Software center, and then installed in the terminal codeblocks-dbg, currently do not know what to do with this. Just put it on first.


3. Install wxwidgets

$sudo Apt-get Install libwxbase2.8

$sudo Apt-get Install Libwxbase2.8-dev

$sudo Apt-get Install libwxgtk2.8-0

$sudo Apt-get Install Libwxgtk2.8-dev

$sudo Apt-get Install libwxgtk2.8-dbg

$sudo Apt-get Install Wx-common

$sudo Apt-get Install Wx2.8-headers

$sudo Apt-get Install wx2.8-i18n

($sudo apt-get Install Wx2.8-examples

$sudo Apt-get Install Wx2.8-doc

The above two are documents, optional)


4. After installation, open the Code::Blocks can be used directly.

I did not set the compiler path, only to select the compiler as GCC, some of the header files to use when using #include can still be found. In the last of the first said to do the basic compilation run environment configuration, otherwise the project compilation cannot pass. In front of my study also can not use engineering documents, so there is no configuration.


The Chinese-codeblocks.mo of 3.codeblocks 10.05
Download http://d.download.csdn.net/down/743075/bengold1979. Copy the file to your LOCALE/ZH_CN under the Code::Blocks installation directory in Ubuntu. There is no LOCALE/ZH_CN directory under my directory, so "sudo mkdir-p locale" ... The command is created and then copied. Remember to use the sudo command when copying, otherwise there is no permission to copy. After a successful copy of the Mo file, you can start Code::Blocks, and then select the first "Environment" in the "Setting" menu, click "View" on the left side of the pop-up window, and then select "Locale" on the right side, and next to the dimmed Drop-down list. Simplified Chinese ". The final step is to close the Code::Blocks and restart it. Now, your Codeblocks interface will appear in Chinese.

4. Build Eclipse's Java build environment on Ubuntu

Method One: (The disadvantage is the installation of additional openjdk and so on a large number of programs can not be removed, the advantage is simple installation)

$ sudo apt-get install eclipse

Method Two: (The advantage is that the installation content is refreshing, the disadvantage is to configure trouble)
1, install JDK, reference Ubuntu 12.04 install JDK 7 2, download Eclipse

Download the appropriate version from  http://www.eclipse.org/downloads/index-developer.php, such as: Eclipse IDE for C + + developers

3, Unzip the file
$ sudo mv eclipse-cpp-juno-m7-linux-gtk.tar.gz /usr/lib/
$ cd/usr/lib/
$ sudo tar-zxvf eclip Se-cpp-juno-m7-linux-gtk.tar.gz
$ sudo rm./eclipse-cpp-juno-m7-linux-gtk.tar.gz

4, creating a startup shortcut
$ sudo gedit/usr/share/applications/eclipse.desktop
reads as follows:
[desktop Entry]
type=application
Name= Eclipse
Comment=eclipse Integrated Development environment
ICON=/USR/LIB/ECLIPSE/ICON.XPM
exec=/usr/lib/ Eclipse/eclipse
Terminal=false
Categories=development;ide; Java;

The localization of 5.eclipse Indigo
Download the corresponding version of the Chinese package from http://www.eclipse.org/babel/downloads.php.
1 Select the latest version Babel Language Pack zips and Update sites-r0.9.1 Indigo
2) Select the Babellanguagepack-eclipse-zh_3.7.0.v20111128043401.zip under Language:chinese (Simplified)
3) Extract Files
$ sudo unzip Babellanguagepack-eclipse-zh_3.7.0.v20111128043401.zip
$ sudo mv./eclipse/plugins/*/usr/lib/eclipse/plugins/
$ sudo mv./eclipse/features/*/usr/lib/eclipse/features/
$ sudo rm-r eclipse

Or

Find Eclipse's website with a Babel project, which is a localized project for various language versions of Eclipse.

Find downloads after entering:

If you click on the blue Word, enter the page in the Simplified Chinese category will display more than 10 20 language packs, this download is tired.

Then go to eclipse, click Help-->install New software, click Add Site, and enter the Indigo link below.

OK, then select this site, update the inside of the Chinese package, after the restart is the Chinese version. Very convenient.
6.ubuntu/win7 default setting problem for dual systems

Open the grub.cfg of the/boot/grub directory (requires power of reference)
Of course, you can open it directly with this command.
Code: $ sudo gedit/boot/grub/grub.cfg


Modify set default= "0" 0 to be the serial number of the other system
The serial number starts at 0.
2, red behavior set default= ' 4 '; The number 4 is the boot sequence. When you start your computer, you go to an interface that selects the operating system, in my case, Ubuntu is the first, Win7 is the last, and there are five options (0, 1, 2, 3, 4, respectively). Originally my number is 0, that is, the default from Ubuntu boot, and then I changed to 4, that is, starting from the Win7. Combined with the actual situation to change the number can modify the startup item.

#
# Don't EDIT this FILE
#
# It is automatically generated by/usr/sbin/grub-mkconfig using templates
# FROM/ETC/GRUB.D and Settings From/etc/default/grub
#

### Begin/etc/grub.d/00_header ###
If [-S $prefix/grubenv]; Then
Load_env
Fi
Set default= "4"//------------->!!!! Attention!!!
If [${prev_saved_entry}]; Then
Set Saved_entry=${prev_saved_entry}
Save_env Saved_entry
Set prev_saved_entry=
Save_env Prev_saved_entry
Set Boot_once=true
Fi

.................................................................... Omit n more code ........... ............ ................. ........

Finish

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.