Showing posts with label UBUNTU. Show all posts
Showing posts with label UBUNTU. Show all posts

Ubuntu 12.04 Advanced Setting


sudo apt-get install gnome-tweak-tool

設定Monitor by nvidia-settings

GeForce GT 435M
============================================
$gksu nvidia-settings
============================================
Reference1:
http://viktorstanchev.com/blog/ubuntu-11.04-rotate-only-one-of-two-monitors

Refrence2:
http://www.libre-software.net/ubuntu-linux-external-monitor-nvidia-rotate
Rotate / pivot / tilt your screen

Set the display(s) you want to rotate to "Separate X screen" as described in part A. Then edit the xorg.conf file:
gksudo gedit /etc/X11/xorg.conf
Add the RandRRotation option somewhere in the "Screen" section to allow rotation:
Section "Screen"
...
Option "RandRRotation" "True"
....
Complete example:
Section "Screen"
    Identifier   "Screen0"
    Device       "Device0"
    Monitor      "Monitor0"
    DefaultDepth 24
    Option       "TwinView" "0"
    Option       "metamodes" "CRT: nvidia-auto-select +0+0"
    Option       "RandRRotation" "True"
    SubSection "Display"
        Depth 24
    EndSubSection
EndSection
Finally, restart your computer. You'll then be able to rotate your screen through the NVIDIA utility, or via the command line:
xrandr -o left
xrandr -o normal
Use man xrandr for more details and options.

execution time on terminal

Reference:
http://manpages.ubuntu.com/manpages/maverick/man1/time.1.html


NAME

       time - run programs and summarize system resource usage

SYNOPSIS

       time   [ -apqvV ] [ -f FORMAT ] [ -o FILE ]
              [ --append ] [ --verbose ] [ --quiet ] [ --portability ]
              [ --format=FORMAT ] [ --output=FILE ] [ --version ]
              [ --help ] COMMAND [ ARGS ]

DESCRIPTION

       time  run  the  program  COMMAND with any given arguments ARG....  When
       COMMAND finishes, time displays information  about  resources  used  by
       COMMAND  (on  the standard error output, by default).  If COMMAND exits
       with non-zero status, time displays a  warning  message  and  the  exit
       status.

       time  determines  which information to display about the resources used
       by the COMMAND from the string FORMAT.  If no format  is  specified  on
       the  command  line, but the TIME environment variable is set, its value
       is used as the format.  Otherwise, a default format built into time  is
       used.

       Options  to  time  must  appear  on  the  command  line before COMMAND.
       Anything on the command line after COMMAND is passed  as  arguments  to
       COMMAND.

OPTIONS

       -o FILE, --output=FILE
              Write  the  resource  use  statistics  to FILE instead of to the
              standard error stream.  By default, this  overwrites  the  file,
              destroying  the file's previous contents.  This option is useful
              for collecting information on interactive programs and  programs
              that produce output on the standard error stream.
       -a, --append
              Append  the  resource use information to the output file instead
              of overwriting
               it.  This option is only useful with  the  `-o'  or  `--output'
              option.
       -f FORMAT, --format FORMAT
              Use  FORMAT  as  the  format  string that controls the output of
              time.  See the below more information.
       --help Print a summary of the command line options and exit.
       -p, --portability
              Use the following format  string,  for  conformance  with  POSIX
              standard 1003.2:
                        real %e
                        user %U
                        sys %S
       -v, --verbose
              Use  the  built-in verbose format, which displays each available
              piece of information on the program's resource use  on  its  own
              line, with an English description of its meaning.
       --quiet
              Do  not report the status of the program even if it is different
              from zero.
       -V, --version
              Print the version number of time and exit.

FORMATTING THE OUTPUT

       The format string FORMAT controls the contents of the time output.  The
       format  string  can  be  set  using  the  `-f'  or  `--format', `-v' or
       `--verbose', or `-p' or  `--portability'  options.   If  they  are  not
       given,  but  the TIME environment variable is set, its value is used as
       the format string.  Otherwise, a built-in default format is used.   The
       default format is:
         %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
         %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps

       The   format   string   usually   consists   of  `resource  specifiers'
       interspersed with plain text.  A  percent  sign  (`%')  in  the  format
       string  causes  the following character to be interpreted as a resource
       specifier, which  is  similar  to  the  formatting  characters  in  the
       printf(3) function.

       A  backslash (`\') introduces a `backslash escape', which is translated
       into a single printing character  upon  output.   `\t'  outputs  a  tab
       character,  `\n'  outputs  a  newline, and `\\' outputs a backslash.  A
       backslash followed by any other character outputs a question mark (`?')
       followed  by  a backslash, to indicate that an invalid backslash escape
       was given.

       Other text in the format string is copied verbatim to the output.  time
       always prints a newline after printing the resource use information, so
       normally format strings do not end with a newline character (or `0).

       There are many resource specifications.  Not all resources are measured
       by  all  versions  of  Unix, so some of the values might be reported as
       zero.  Any character following a percent sign that is not listed in the
       table below causes a question mark (`?') to be output, followed by that
       character, to indicate that an invalid resource specifier was given.

       The resource specifiers, which are a superset of  those  recognized  by
       the tcsh(1) builtin `time' command, are:
              %      A literal `%'.
              C      Name  and  command  line  arguments  of the command being
                     timed.
              D      Average size of the  process's  unshared  data  area,  in
                     Kilobytes.
              E      Elapsed  real  (wall  clock) time used by the process, in
                     [hours:]minutes:seconds.
              F      Number of  major,  or  I/O-requiring,  page  faults  that
                     occurred while the process was running.  These are faults
                     where the page  has  actually  migrated  out  of  primary
                     memory.
              I      Number of file system inputs by the process.
              K      Average   total   (data+stack+text)  memory  use  of  the
                     process, in Kilobytes.
              M      Maximum resident set  size  of  the  process  during  its
                     lifetime, in Kilobytes.
              O      Number of file system outputs by the process.
              P      Percentage  of  the  CPU that this job got.  This is just
                     user + system times divided by the total running time. It
                     also prints a percentage sign.
              R      Number  of minor, or recoverable, page faults.  These are
                     pages that are not valid (so they fault) but  which  have
                     not  yet  been  claimed by other virtual pages.  Thus the
                     data in the page is still valid  but  the  system  tables
                     must be updated.
              S      Total  number of CPU-seconds used by the system on behalf
                     of the process (in kernel mode), in seconds.
              U      Total  number  of  CPU-seconds  that  the  process   used
                     directly (in user mode), in seconds.
              W      Number  of  times  the  process  was  swapped out of main
                     memory.
              X      Average  amount  of  shared  text  in  the  process,   in
                     Kilobytes.
              Z      System's  page  size,  in  bytes.   This  is a per-system
                     constant, but varies between systems.
              c      Number  of  times  the   process   was   context-switched
                     involuntarily (because the time slice expired).
              e      Elapsed  real  (wall  clock) time used by the process, in
                     seconds.
              k      Number of signals delivered to the process.
              p      Average unshared stack size of the process, in Kilobytes.
              r      Number of socket messages received by the process.
              s      Number of socket messages sent by the process.
              t      Average resident set size of the process, in Kilobytes.
              w      Number  of  times  that  the program was context-switched
                     voluntarily,  for  instance  while  waiting  for  an  I/O
                     operation to complete.
              x      Exit status of the command.

EXAMPLES

       To run the command `wc /etc/hosts' and show the default information:
            time wc /etc/hosts

       To  run  the command `ls -Fs' and show just the user, system, and total
       time:
            time -f "%E real,%U user,%S sys" ls -Fs

       To edit the file BORK and have  `time'  append  the  elapsed  time  and
       number of signals to the file `log', reading the format string from the
       environment variable `TIME':
            export TIME="%E,%k" # If using bash or ksh
            setenv TIME "%E,%k" # If using csh or tcsh
            time -a -o log emacs bork

       Users of the bash shell need to use an explicit path in  order  to  run
       the  external time command and not the shell builtin variant. On system
       where time is installed in /usr/bin, the first example would become
            /usr/bin/time wc /etc/hosts

ACCURACY

       The elapsed time is not collected atomically with the execution of  the
       program;  as  a  result,  in bizarre circumstances (if the time command
       gets stopped or swapped out in between when  the  program  being  timed
       exits  and  when  time calculates how long it took to run), it could be
       much larger than the actual execution time.

       When the running time of a command is very  nearly  zero,  some  values
       (e.g.,  the  percentage  of  CPU  used)  may be reported as either zero
       (which is wrong) or a question mark.

       Most information shown by time is  derived  from  the  wait3(2)  system
       call.   The numbers are only as good as those returned by wait3(2).  On
       systems  that  do  not  have  a  wait3(2)  call  that  returns   status
       information,  the  times(2)  system  call is used instead.  However, it
       provides much less information than wait3(2), so on those systems  time
       reports the majority of the resources as zero.

       The `%I' and `%O' values are allegedly only `real' input and output and
       do not include those supplied  by  caching  devices.   The  meaning  of
       `real'  I/O  reported by `%I' and `%O' may be muddled for workstations,
       especially diskless ones.

DIAGNOSTICS

       The  time  command  returns  when  the  program  exits,  stops,  or  is
       terminated  by  a  signal.   If the program exited normally, the return
       value of time is the return  value  of  the  program  it  executed  and
       measured.  Otherwise,  the  return  value is 128 plus the number of the
       signal which caused the program to stop or terminate.

AUTHOR

       time was written by David MacKenzie. This man page was  added  by  Dirk
       Eddelbuettel <edd@debian.org>, the Debian GNU/Linux maintainer, for use
       by the Debian GNU/Linux distribution but  may  of  course  be  used  by
       others.

SEE ALSO

       tcsh(1), printf(3)

Instruction in Ubuntu


updatedb
------------------------------------------------------
locate (file)
------------------------------------------------------
vimdiff
------------------------------------------------------

UBUNTU - 開機選單

sudo vim /etc/default/grub
sudo update-grub
sudo update-grub2

Install Apache2, PHP5, MYSQL, phpmyadmin ON UBUNTU

Step 1 : Install Apache2
1.Use Synaptic Package Manager -> Apache2
2. sudo pico /etc/apache2/conf.d/fqdn
3. type :   ServerName    localhost(or IP)
------------------------------------------------------------
Step 2 : Install PHP5

1.Use Synaptic Package Manager -> PHP5
2. sudo a2enmod php5
3. sudo gedit /etc/php5/apache2/php.ini
4. Change the memory_limit to 256 or 512

------------------------------------------------------------
Step 3 : Install MYSQL
1. sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
------------------------------------------------------------
Step 4 : Install phpmyadmin
1.Use Synaptic Package Manager -> phpmyadmin
2. sudo gedit /etc/apache2/apache2.conf
3. type the following code at bottom page
Include /etc/phpmyadmin/apache.conf

Change the terminal font size

System ->
Preferences ->
Appearance ->
Fonts ->
Fixed width font  -> 14

su: Authentication failure

sudo passwd root

Remove sun-java6-jdk on UBUNTU

SDK instal and path set up  

http://wallyjue.blogspot.com/2011/04/ubuntu-1004java-jdk-15.html

Remove java
$sudo apt-get remove sun-java6-jdk
$sudo apt-get remove sun-java6-jre
$sudo apt-get remove sun-java6-bin

Problem: xxx is not in the sudoers file

sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。下面是修改方法:

1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)
 

2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
 
3)编辑/etc/sudoers文件。也就是输入命令"sudo gedit  /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。 
4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。

Install repo

Problem:
-----------------------------------------------------------------------------------------------------------------------------
fatal: unable to connect a socket


Resolution:
-----------------------------------------------------------------------------------------------------------------------------
會出現這個問題是因為Android git   Server的DNS查詢回應太慢的關係可依照下列方法解決
1.  ping android.git.kernel.org ,將結果的IP記錄下來
2.  更改系統的hosts, 將android.git.kernel.org與IP之對照表建立起來
     方法:sudo gedit /etc/hosts 新增一行 IP address 對照到 android.git.kernel.org
3. 修改專案目錄下的  .repo/manifest.xml, 將android.git.kernel.org 替換成剛剛找到的IP
4. repo init ................................................................................


-----------------------------------------------------------------------------------------------------------------------------


http://5i01.com/topicdetail.php?f=423&t=1130384&p=1

Install sun-java5-jdk in UBUNTU


$ sudo  add-apt-repository  "deb http://old-releases.ubuntu.com/ubuntu/ jaunty multiverse"


$ sudo  add-apt-repository  "deb http://old-releases.ubuntu.com/ubuntu/ jaunty-updates multiverse"


$ sudo  apt-get  update


$ sudo  apt-get  install  sun-java5-jdk






http://a7419.pixnet.net/blog/post/73106685