I run Ubuntu 12.04.1 LTS on ThinkPad. Most of the time, the track point gets in the way. I disable it with this command,
xinput -set-prop "TPPS/2 IBM TrackPoint" "Device Enabled" 0
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Saturday, February 2, 2013
Tuesday, July 10, 2012
GIMP 2.8 has arrived
GIMP (GNU IMAGE) 2.8 is here.
It just occurred to me the other day that GIMP was working on 2.8. I thought I would like to check it out. When I got there (www.gimp.org), it is there.
I like the single view mode (under menu Windows, Single-Window-Mode). It solved the only complaint I had with GIMP in the past. That is to click twice in order to re-focus on the other window when switching between tool/editor/layer windows.
I have not checked out what else is new in it. GIMP is one of a few open source projects I appreciated and used frequently. I would expect to continue creating a lot of digital assets from GIMP for my iPhone app projects.
Monday, March 19, 2012
Examine multiple files in command less
To change to the next file after opening multiple files simultaneously in 'less' command, use this command
:n
And to change to the previous file, use
:p
The instruction should also be available from the man page.
:n
And to change to the previous file, use
:p
The instruction should also be available from the man page.
Friday, December 30, 2011
Comment out multiple lines in vi
Press Ctrl-v to start a VISUAL BLOCK
Move the cursor (up/down arrow key) to expand the block
Press I (Shift-i) to start insert.
Type in the character(s) that you want to insert, such as #, or //.
Press ESC to leave the visual block.
Move the cursor (up/down arrow key) to expand the block
Press I (Shift-i) to start insert.
Type in the character(s) that you want to insert, such as #, or //.
Press ESC to leave the visual block.
Tuesday, December 6, 2011
Global search in vi and list results
We use the simple command to search a pattern (or a fragment of text),
:/{pattern}
Sometimes, there would be a few dozens of matches that you want to list and browse quickly. Use this command,
:g/{pattern}
It lists the search results in one buffer. If you want to search the pattern case insensitive, add \c in the command, like
:g/\c{pattern}
Tuesday, November 1, 2011
Monitor disk IO activities on a Linux host
1. Use df first to find all the devices
2. Use iostat
iostat -dx <device> <time-interval>
For example,
iostat -dx /dev/sdb 5
to display disk IO activities every 5 seconds.
2. Use iostat
iostat -dx <device> <time-interval>
For example,
iostat -dx /dev/sdb 5
to display disk IO activities every 5 seconds.
Thursday, October 27, 2011
Find CPU information on a Linux
A good tip for finding out CPU and 32/64 bit kernel information on a Linux host, at http://www.cyberciti.biz/faq/linux-how-to-find-if-processor-is-64-bit-or-not/
In short, use
uname -a
and
cat /proc/cpuinfo
In short, use
uname -a
and
cat /proc/cpuinfo
Thursday, August 18, 2011
Use wildcard in the command find
To use a wildcard
Without quote or backslash
find . foo*bar -print
the shell will expand * before passing it into find command. This results is a different, and most likely a narrower, search.
To avoid that, use
find . 'foo*bar' -print
or
find . foo\*bar -print
*in the find command needs a little more care.
Without quote or backslash
\, such as
find . foo*bar -print
the shell will expand * before passing it into find command. This results is a different, and most likely a narrower, search.
To avoid that, use
find . 'foo*bar' -print
or
find . foo\*bar -print
Tuesday, August 16, 2011
Add one more yum repository
Read yum.conf first. Usually the path is /etc/yum.conf.
Understand where the cache and repository configuration file directory
The following examples use default locations
## add epel to the repo list
## see what is there before change
ls /var/cache/yum/*/*
cd yum.repos.d/
## copy contents from another configured host
sudo vi epel.repo
sudo yum clean all
## make sure it is empty
ls /var/cache/yum/*/*
sudo yum makecache
## see if the new repo epel is added
ls /var/cache/yum/*/*
## add GPG key for the new repo, also do copy-paste
sudo vi /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
If you are not sure about the name of RPM-GPG key, run rpm to install the package. Towards the end, rpm will complain about missing the GPG key and prompt the file name for you.
Understand where the cache and repository configuration file directory
The following examples use default locations
## add epel to the repo list
## see what is there before change
ls /var/cache/yum/*/*
cd yum.repos.d/
## copy contents from another configured host
sudo vi epel.repo
sudo yum clean all
## make sure it is empty
ls /var/cache/yum/*/*
sudo yum makecache
## see if the new repo epel is added
ls /var/cache/yum/*/*
## add GPG key for the new repo, also do copy-paste
sudo vi /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
If you are not sure about the name of RPM-GPG key, run rpm to install the package. Towards the end, rpm will complain about missing the GPG key and prompt the file name for you.
Find out it is a 32 or 64-bit Linux
Use the command
uname -m
If it shows x86_64, it is a 64-bit host.
If it shows i386 (or sometimes i686), it is a 32-bit machine
Plus, run the command
file /bin/ls
For 64-bit kernel, it should show
/bin/ls: ELF 64-bit LSB executable ....
uname -m
If it shows x86_64, it is a 64-bit host.
If it shows i386 (or sometimes i686), it is a 32-bit machine
Plus, run the command
file /bin/ls
For 64-bit kernel, it should show
/bin/ls: ELF 64-bit LSB executable ....
Find installed packages on Linux hosts
To find installed packages on a Redhat/CentOS Linux, use
Once the package name is found, use this command to find more details
To find installed packages on a Debian (also Ubuntu) Linux, use
Once the package name is found, use this command to find more details
rpm -qa | less
Once the package name is found, use this command to find more details
rpm -qil {package-name}
To find installed packages on a Debian (also Ubuntu) Linux, use
dpkg --list
Once the package name is found, use this command to find more details
dpkg -p {package-name}
Tuesday, August 9, 2011
Find and delete into directories recursively
How to find a set of files or directories that are named the same? For example, to delete all the '.svn' directories in the current working directory.
One easy way is
The option [-v] prints out the files/directories found. and rm -rf is the typical force deletion of a directory.
Another way to do it is
But this command prints out warning messages that sometimes confuse users.
The warning message means it found a .svn directory in the current directory and deleted as instructed ( -exec rm -rf ). When the command find wanted to descend into .svn directory, it could not.
The trailing {} \; is required. Pay attention to its format: there is a space between } and \.
One easy way is
rm -rvf `find . -type d -name .svn`
The option [-v] prints out the files/directories found. and rm -rf is the typical force deletion of a directory.
Another way to do it is
find . -name ".svn" -exec rm -rf {} \;
But this command prints out warning messages that sometimes confuse users.
find: ./.svn: No such file or directory
find: ./images/.svn: No such file or directory
find: ./images/.svn: No such file or directory
The warning message means it found a .svn directory in the current directory and deleted as instructed ( -exec rm -rf ). When the command find wanted to descend into .svn directory, it could not.
The trailing {} \; is required. Pay attention to its format: there is a space between } and \.
Wednesday, August 3, 2011
Find socket/port status on Linux
When debugging or monitoring a client-server application or any connected application, it is necessary to find out what is going on at socket level.
To start, use
netstat -an
To start with TCP connections, use
netstat -ant
Although the option -p should show process information (PID), it usually gives a "-" for that field. Remember to use ifconfig to find interfaces and IP addresses.
To start, use
netstat -an
To start with TCP connections, use
netstat -ant
Although the option -p should show process information (PID), it usually gives a "-" for that field. Remember to use ifconfig to find interfaces and IP addresses.
Subscribe to:
Posts (Atom)