Wednesday, May 19, 2010

巴菲特2010年第二季度完全持股名单


  新浪财经讯 “股神”巴菲特旗下的伯克希尔哈萨韦公司(Berkshire Hathaway)刚刚披露了截至2010年3月31日的最新持股名单。这是我们能够了解到的巴菲特最新的持股数据,尽管个别持仓3月份以来可能略有变化。下面这个名单是按照字母顺序从A-Z排列的。
  美国运通(American Express)(AXP) 超过1.5160亿股,与上一季度相同。
  美国银行(Bank of America)(BAC) 500万股,与上一季度相同。
  Becton Dickinson(BDX) 增持至174.4万股,上一季度为150万股,两个季度前为120万股。
  CarMax(KMX) 减持至772.5万股,上一季度为800万股,两个季度前为900万股。
  可口可乐(Coca Cola)(KO) 刚好2亿股,与上一季度相同。
  Comcast(CMCSA) 1200万股,与上一季度相同。
  Comdisco Holdings(CDCO) 大约150万股,与上一季度相同。
  康菲石油(ConocoPhillips)(COP) 减持至3417.9万股,上一季度为3770万股,两个季度前为5743万股,去年6月底为6248.5万股。
  好市多(Costco Wholesale)(COST) 减持至433.3363万股,上一季度为525.4万股。
  埃克森美孚(Exxon Mobil)(XOM) 42.18万股,与上一季度相同,这是两个季度前的新头寸,当时持股为127.6万股。
  Gannett(GCI) 减持至174.0231万股,上一季度为220.2万股,两个季度前为344.7万股。
  通用电气(General Electric)(GE) 777.7万股,与上一季度相同,但没有包括2008年年底的巨额优先股投资。
  高盛(Goldman Sachs)(GS) 高盛不在名单之上,不过这是因为伯克希尔持有的并非高盛普通股,而是优先股和认股权证。巴菲特说他依然持有这些优先股和认股权证。
  葛兰素史克(GlaxoSmithKline PLC)(GSK) 151万股,与上一季度相同。
  哈雷戴维森(Harley-Davidson)(HOG) 不是普通股,但巴菲特仍持有其优先股和认股权证。
  家得宝(Home Depot)(HD) 275.7万股,与上一季度相同。
  英格索兰(Ingersoll-Rand)(IR) 63.66万股,与上一季度相同,但三个季度前为778万股。
  Iron Mountain(IRM) 增持至779.48万股,上一季度为700万股,两个季度前为337.22万股。
  强生(Johnson & Johnson)(JNJ) 减持至2390万股左右,上一季度为2700万股多一点,两个季度前为3691万股,而2008年一度持股高达6200万股。
  卡夫食品(Kraft Foods)(KFT) 减持至1.067亿股,上一季度为超过1.38亿股。巴菲特对于卡夫收购吉百利的交易一直持批评态度。
  Lowe's Companies(LOW) 650万股,与上一季度相同。
  M&T Bank(MTB) 减持至556.3万股,上一季度为671万股。
  穆迪(Moody's)(MCO) 连续减持至3083万股,上一季度为3180万股,两个季度前为3920万股,再往前一个季度则达到4800万股。
  Nalco Holding(NLC) 900万股,与上一季度相同。
  雀巢(Nestle)美国存托凭证(ADR) 340万股,与上一季度相同。
  耐克(Nike)(NKE) 764.1万股,与上一季度相同。
  宝洁(Procter & Gamble)(PG) 连续减持至7831.7万股,上一季度大约为8750万股,两个季度前为9630万股。
  Republic Services(RSG) 增持至1082.7万股,上一季度为829万股。该股为巴菲特两个季度前跟随比尔·盖茨的投资步伐开始持有。
  赛诺菲-安万特(Sanofi Aventis)(SNY) 超过390万股,与上一季度相同。
  蒂芙尼(Tiffany & Co)(TIF) 不是普通股,但巴菲特依然持有其优先股和认股权证。
  Torchmark(TMK) 大约282万股,与上一季度相同。
  US Bancorp(USB) 大约6900万股,与上一季度相同。
  USG Corp(USG) 1707.2万股,与上一季度相同。
  United Parcel Service(UPS) 142.9万股,与上一季度相同。
  沃尔玛(Wal-Mart Stores)(WMT) 略超3900万股,与上一季度相同,上一季度增持之前为3780万股,远高于3个季度之前的1990万股。
  华盛顿邮报(Washington Post)(WPO) 超过172万股,与上一季度相同。
  富国银行(Wells Fargo)(WFC) 大约3.195亿股,与上一季度基本不变,两个季度前为3.133亿股,三个季度前为3.02亿股,再往前一个季度为2.9亿多股。
  Wesco Financial(WSC) 570.3万股,与上一季度相同。
  Sun Trust Bank(STI) 全部出清。上一季度为将近240万股,两个季度前为307.9万股,三个季度前超过320万股。
  Travelers Cos(TRV) 全部出清。不过此前也仅少量持有27336股。
  United Health(UNH) 全部出清。上一季度为117.5万股,此前已经连续三四个季度不断减持。
  Wellpoint(WLP) 全部出清。清仓之前的上一季度为持有134.3万股。
  注:原文来自24/7 Wall St。

Recovering from a forgotten root password

1.Reboot the PC (select Reboot as you log out of the GUI screen) or power up as usual.

Soon you see the graphical GRUB boot loader screen that shows the names of the operating systems you can boot. If your system runs the LILO boot loader, press Ctrl+X and at the boot: prompt, type linux single and press Enter. Then proceed to Step 4.

2.If you have more than one operating system installed, use the arrow key to select Linux as your operating system and then press the A key.

GRUB prompts you for commands to add to its default boot command.

3.Press the spacebar, type the following, and press Enter:
       single
   Linux starts up as usual but runs in a single-user mode that doesn't require you to log in. After Linux starts, you see the following command-line prompt that ends with a hash mark(#), similar to the following:
     sh-3.00#

4.Type the passwd command to change the root password as follows:
    sh-3.00# passwd
    Changing password for user root.
    New password:

5.Type the new root password that you want to use (it doesn't appear on-screen) and then press Enter.

   Linux asks for the password again, like this:
      Retpye new password:

6.Type the password again and press Enter.
    If you enter the same password both times, the passwd command changes the root password.

7.Now type reboot to reboot the PC.
   After Linux starts, it displays the familiar login screen. Now you can log in as root with the new password.

In SUSE Linux, in Step 3, type single init=/bin/sh (instead of single) and before proceeding to Step 4, type mount /-n-0 remount,rw. Then perform Steps 4 through 6 to change the root password. After Changing the password, type mount /n -o remount,ro. Then continue to Step 7 and reboot the PC.

Tuesday, May 18, 2010

Text Editing with ed and vi

Using ed

When you use ed, you work in command mode or text input mode:

  • Command mode is what you get by default. In this mode, anything that you type is interpreted as a command.
  • Text input mode is for type text. You can enter input mode with the commands a (append), c (change), or i (insert). After entering lines of text you can leave input mode by entering a period (.) on a line by itself.
To practice editing a file, copy the /etc/fstab file to you home directory by issuing the following commands:

cd
cp /etc/fstab .

Now you have a file named fstab in you home directory. Type ed -p: fstab to begin editing a file in ed. The editor responds:

878
:

This Expamle uses the -p option to set the prompt to the colon character (:) and opens the fstab file (in the current directory, which is you home directory) for editing.  The ed editor opens the file, reports the number of characters in the file (878), displays the prompt(:), and waits for a command.

When you're editing with ed, make sure that you always turn on a prompt character ( use the -p option). Without the prompt, distinguishing whether ed is in iuput mode or command mode is difficult.

After ed opens a file for editing, the current line is the last line of the file. To see the current line number (the current line is the line to which ed applies you command), use the .= command like this:

:.=
9

This output tells you that the fstab file has nine lines. (Your system's /etc/fstab file may have a different number of lines).

You can use the 1,$p command to see all lines in a file, as the following example shows:

:1,$p
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
#            
proc            /proc           proc    defaults        0       0
# / was on /dev/sda1 during installation
UUID=2d09f69e-b3b9-4f77-bd34-728bc5d5b97e /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=896133ec-9044-4ea4-a341-e0033120076f none            swap    sw              0       0
/dev/scd1       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
/dev/scd0       /media/cdrom1   udf,iso9660 user,noauto,exec,utf8 0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
:

To go to a specific line, type the line number:

:15

The editor responds by displaying that line:

/dev/scd1       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
:

Suppose you want to delete the line that contains cdrom. To search for a string, type a slash(/) followed by the string that you want to locate:

:/cdrom
/dev/scd1       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
:

The editor locates the line that contains the string and then displays it. That line becomes the current line.

To delete the current line, use the d command as follows:

:d
:

To replace a string with another, use the s command. To replace cdrom with the string cd, for example, use this command:

:s/cdrom/cd
:

To insert a line in front of the current line, use the i command:

:i
      (type the line you want to insert)
.     (type a single period to indicate you're done)
:

You can enter as many lines as you want.  After the last line, enter a period (.) one a line by itself.

When you're happy with the changes, you can write them to the file with the w command. If you want to save the changes and exit, type wq to perform both steps at the same time:

:wq
857

If you want to quit the editor without saving any changes, use the Q command.




Commonly Used ed Commands
CommandDoes the following
!commandExecutes a shell command.
$Goes to the last line in the buffer
%Applies a command that follows to all lines in the buffer. For example, %p prints all lines.
+Goes to next line
+nGoes to the nth next line (where n is a number you designate)
,Applies a command that follows to all lines in the buffer. (For example, ,p prints all lines.) This is similar to %.
-Goes to the preceding line
-nGoes to the nth previous line
.Refers to the current line in the buffer
/text/Searches forward for the specified text
;Refers to a range of lines---current through last line in the buffer
=Prints the line number
?text?Searches backward for the specified text
^Goes to the preceding line. (See also the - command)
^nGoes to the nth previous line
aAppends the current line
cChanges the specified lines
dDeletes the specified lines
iInserts text before the current line
nGoes to line number n
Press EnterDisplays the next line and makes that line current
qQuits the editor
QQuits the editor without saving changes
r fileReads and inserts the contents of the file after the current line
s/old/new/Replaces an old string with a new one
uUndoes the last command
W fileAppends the contents of the buffer to the end of the specified file
w fileSaves the buffer in the specified file. (If no file is named, it saves in the default file ---- the file whose contents ed is currently editing.

Using vi

The vi editor loads the file into memory and displays the first few lines in a text screen and positions the cursor on the first line.

The last line shows the pathname of the file as well as the number of lines (21) and the number of characters(771) in the file.Later, the last line in the vi display functions as a command entry area. The rest of the lines display the file. If the file contains fewer lines than the screen, vi displays the empty lines with a tilde(~) in the first column.

The current line is marked by the cursor, which appears as a small black rectangle. The cursor appears on top of a character.

When using vi, you work in one of three modes:

  • Visual command mode is what you get by default. In this mode, anyting that you type is interpreted as a command that applies to the line containing the cursor. The vi commands are similar to the ed commands.
  • Colon command mode is for reading or writing files, setting vi options, and quitting vi. All colon commands start with a colon(:). When you enter the colon, vi positions the cursor on the last line and waits for you to type a command. The command takes effect when you press Enter.
  • Text input mode is for typing text. You can enter input mode with the command a (insert after cursor), A (append at end of line), or i (insert after cursor). After entering lines of text, you have to press Esc to leave input mode and re-enter visual command mode.
One problem with all these modes is that you can't easily tell the current mode taht vi is in. You may begin typing only to realize that vi isn't in input mode, which can be frustrating(令人沮丧的).

If you want to make sure that vi is in command mode, just press Esc a few times. (Press Esc more than once doesn't hurt.)

To view online help in vi, type :help while in colon command mode. When you are done with help, type :q to exit the Help screen and return to the file you're editing.
Cursor Movement Commands in vi
KeyDoes the following
Move the cursor one line down
Move the cursor one line up
Move the cursor one character to the left
Move the cursor one character to the right
WMove the cursor one word forward
BMove the cursor one word backward
Ctrl+DMoves down half a screen
Ctrl+UScrolls up half a screen

To search for a string, first type a slash(/). The vi editor displays the slash on the last line of the screen. Type the search string and then press Enter. The vi editor locates the string and positions the cursor at the beginning of that string. 

Commonly Used vi Commands
CommandDoes the following
Insert Text
aInserts text after the cursor
AInserts text at the end of the current line
IInserts text at the beginning of the current line
iInserts text before the cursor
Delete Text
DDeletes up to the end of the current line
ddDeletes the current line
dGDeletes from the current line to the end of the file
dwDeletes from the cursor to the end of the following word
xDeletes the character on which the cursor rests
Change Text
CChanges up to the end of the current line
ccChanges the current line
JJoins the current line with the next one
rxReplaces the character under the cursor with x(where x is any character)
Move Cursor
h or ←Moves one character to the left
j or ↓Moves one line down
k or ↑Moves one line up
LMoves to the end of the screen
l or →Move one character to the right
wMoves to the beginning of the following word
bMoves to the beginning of the previous word
Scroll Text
Ctrl+DScrolls forward by half a screen
Ctrl+UScrolls backward by half a screen
Refresh Screen
Ctrl+LRedraws screen
Cut and Paste Text
yyYanks(copies) current line into an unnamed buffer
PPuts the yanked line above the current line
pPuts the yanked line below the current line
Colon Commands
:!commandExecutes a shell command
:qQuits the editor
:q!Quits without saving changes
:r filenameReads the file and inserts it after the current line
:w filenameWrites a buffer to the file
:wqSaves changes and exits
Search Text
/stringSearches forward for a string
?stringSearches backward for a string
Miscellaneous
uUndoes the last command
EscEnds input mode and enters visual command mode
UUndoes recen changes to the current line

Monday, May 17, 2010

Commands for mounting and unmounting

Start by looking at the /etc/fstab file for clues to the name of the CD-ROM device. For example, some Linux distributions use the device name /dev/cdrom to refer to CD/DVD-ROM drives, whereas others may use device names such as /dev/hdc, /dev/cdroms/cdrom0, or /dev/cdrecorder( for a DVD/CD-R drive). The entry in /etc/fstab file also tells you the directory where that distribution expects the CD/DVD to be mounted. Some distributions use /media/cdrom as mount point, whereas others use /media/cdrom0, or /media/cdrecorder.

It is customary to use the cdrom term to mean both CD-ROM and DVD-ROM.

Log in as root ( or type su - to become root), insert the DVD-ROM in the DVD drive, and then type the following command:

mount  /dev/hdc /media/cdrom0

This command mounts the file system on the device named /dev/hdc (an IDE DVE/CD-ROM drive) on the /media/cdrom0 directory ( which is also called the mount point) in the Linux file system.

After the mount command successfully completes its task, you can access the files on the DVD-ROM by referring to the /media/cdrom0 directory as the top-level directory of the disc. In other words, to see the contents of the DVD-ROM, type

ls -F /media/cdrom0

When you're done using the DVD-ROM and before you eject it from the drive, you have to unmount the disc drive with the following umount command:

umount  /dev/hdc


You can mount devices on any empty directory on the file system. However, each distribution has customary locations with directories meant for mounting devices. For example, some distributions use directories in /mnt whereas others use the /media directory for the mount points.

Linux 常见目录

The Linux file system has a well-defined set of top-level directories,and some of these directories have specific purposes.

Top-level Direcotries in Linux File System

DirectoryDescription
/This root directory forms the base of the file system.All files and directories are contained logically in the root directory,regardless of their physical locations.
/binContains the executable programs that are part of the Linux operating system. Many Linux commands, such as cat, cp, ls, more, and tar, are located in /bin.
/bootContains the Linux kernel and other files that the LILO and GRUB boot managers need. (The kernel and other files can be anywhere, but placing them in the /boot directory is customary.
/devContains special files that represent devices attached to the system.
/etcContains most system configuratoin files and the initialization scripts(in the /etc/tc.d subdirectory)
/homeConverntional location of the home directories of all users. User edulaney's home directory, for example, is /home/edulaney.
/libContains library files for all programs stored in /sbin and /bin directories (including the loadable driver modules) needed to start Linux.
/lost+foundDirectory for lost files. Every disk partition has a lost+found directory.
/mediaA directory for mounting file systems on removable media, such as CD/DVD-ROM drives, floppy disks, and Zip drives. Contains the /media/floppy directory for mounting floppy disks and /media/cdroom or /media/cdroom0 directory for mounting the CD/DVD-ROM drive. if you have a CD/DVD recorder, you find a /media/cdrecorder directory instead of /media/cdrom and may also find /media/DVD.
/mntA directory for temporarily mounted file systems
/optProvides a storage area for large application software packages. For example, some distributions install the OpenOffice.org Office suite in the /opt directory.
/procA speical directory that contains various information about the processes running in the Linux system.
/rootThe home directory for root user.
/sbinContains executable files representing commands typically used for system-administration tasks and used by the root user. Commands such as halt and shutdown reside in the /sbin directory.
/srvContains data for services( such as Web and FTP ) offered by this system.
/sysA special directory that contains information about the devices, as seen by the Linux kernel.
/tmpA temporary directory that any user can use as a scratch directory, meaning that the contents of this directory are considered unimportant and usually are deleted every time the system boots.
/usrContains the subdirectories for many important programs, such as the X Window System( in the /usr/X11R6 directory ) and the online manual.
/varContains various system files(such as logs), as well as directories for holding other information, such as files for the Web server and anonymous FTP server.

Important /usr Subdirectories
SubdirectoryDescription
/usr/X11R6Contains the X Window System software
/usr/binContains executable files for many more Linux commands,including utility programs that are commonly available in Linux but aren't part of the core Linux operating system.
/usr/gamesContains some old Linux games
/usr/includeContains the header files (file names ending in .h) for the C and C++ programming languages; also includes the X11 header files in the /usr/include/X11 directory and the Linux kernel header files in the /usr/include/linux directory.
/usr/libContains the libraries for C and C++ programming languages; also contains many other libraries, such as database libraries and graphical libraries.
/usr/localContains local files. The /usr/local/bin directory, for example, is supposed to be the location for any executable program developed on your system
/usr/sbinContains many administrative commands, such as commands for electronic mail and networking.
/usr/shareContains shared data, such as default configuration files and images for many applications. For example, /usr/share/gnome contains various shared files for the GNOME desktop, and /usr/share/doc has the documentation files for many Linux applicaions (such as the bash shell, the Sawfish window manager, and The GIMP image-processing program).
/usr/share/manContains the online manual (which you can read by using the man command)
/usr/srcContains the source code for the Linux kernel (the core operating system)


Important /var Subdirectories
SubdirectoryDescription
/var/cacheStorage area for cached data for applications
/var/libContains information relating to the current state of applications
/var/lockContains locked files to ensure that a resource is used by one application only
/var/logContains log files organized into subdirectories. The syslogd server stores its log files in /var/log, with the exact content of the files depending on the syslogd configuration file /etc/syslog.conf. For example, /var/log/messages is the main system log file; /var/log/secure contains log messages from secure services (such as sshd and xinetd); and /var/log/mainlog contains the log of mail messages.
/var/mailContains user mailbox files
/var/optContains variable date for packages stored in /opt directory
/var/runContains data describing the system since it was booted
/var/spoolContains data that's waiting for some kind of processing
/var/tmpContains temporary files preserved between system reboots
/var/ypContains Network information Service(NIS) database files

Search This Blog