Monday, October 3, 2011

Configure Dropbox as a service

First, run the Dropbox installer using the command line switch /D=C:\Program Files\Dropbox (with no quotes) to install Dropbox into the Program Files directory for all users.
Then here an updated version of the procedure given on this link:
Since Dropbox will normally only work when a user is logged in, we will have to install and use it first via remote desktop, before it can be turned it into a Service.
  1. Remote desktop to your WHS as administrator
  2. Get DropBox from their website.
  3. Install and configure Dropbox as you like. e.g. I made a special share on my WHS named Dropbox before the installation and linked Dropbox to this share. Then exit dropbox from the system tray.
  4. Similar to Foldershare, you will need instsrv.exe and srvany.exe from the Windows Server 2003 Resource Kit Tools.
  5. Copy instsrv.exe to C:\Program Files\Dropbox
  6. Copy srvany.exe to C:\Program Files\Dropbox
  7. execute "C:\Program Files\Dropbox\instsrv.exe" Dropbox "C:\Program Files\Dropbox\srvany.exe"
  8. execute reg ADD HKLM\SYSTEM\CurrentControlSet\Services\Dropbox\Parameters /v Application /d "C:\Program Files\Dropbox\Dropbox.exe"
  9. execute reg ADD HKLM\SYSTEM\CurrentControlSet\Services\Dropbox\Parameters /v AppDirectory /d "C:\Program Files\Dropbox"
  10. Delete or move the shorcut to Dropbox away from the startfolder (Start -> All Programs -> Startup) on the startmenu.
  11. Move (cut/paste) ALL the files from C:\Documents and Settings\Administrator\Application Data\DropBox to C:\Documents and Settings\Default User\Application Data\Dropbox
  12. execute net start Dropbox


After you're done: Start > Run > "services.msc"
Find your "Dropbox" service.
Right click on it and select "Properties" goto the "Log On" tab and make sure the "Allow service to interact with desktop" checkbox is checked.
Start/Restart the service as necessary.
You will either get a popup asking for permission to show the Dropbox configuration or the Dropbox configuration will just come up.
Put in your username/password, choose where you want to place your Dropbox (under the particular user you want) and you're good to go.
Verified to work on Windows Server 2008.

Sunday, October 2, 2011

老子智慧:知者不言,言者不知

知者不言,言者不知。塞其兑,闭其门,挫其锐,解其纷,和其光,同其尘,是谓玄同。故不可得而亲,不可得而疏;不可得而利,不可得而害;不可得而贵,不可得而贱。故为天下贵。

智慧深澈的人实施超脱语言的教化,喜欢高谈阔论的人往往并没有多少真知。摒弃一切感知,停止向外追求,以求得内心的宁静清澈;挫磨掉锐气、锋芒和棱角,消 除种种人为限制,突破重重心灵障碍,使心灵纯真质朴;收敛起光泽避免无谓争夺,混同尘世凡物:这就叫做玄妙的同化,微妙大统一的法门。所以没法亲近他,也 没法疏远他;没法给他好处,也没法损害他;没法抬高他,也没法贬低他。所以他才真正成为天下最可贵的

Friday, September 30, 2011

巴菲特所持10只高股息股票

 新浪财经讯 北京时间9月30日下午消息,据外电报道,根据“股神”巴菲特麾下伯克希尔-哈撒韦公司最新披露的季度监管文件显示,财经网站TheStreet.com列出了巴菲特所持的10只高股息股票。



股息排名
个股名称
最近的季度股息
占巴菲特投资组合的比重
市值(亿美元)
市盈率
1
葛兰素史克公司(GSK)
5%
0.1%
1066
20.7
2
康菲石油(COP)
4%
4.2%
917
8.4
3
赛诺菲(SNY)
4%
0.3%
889
19.6
4
M&T银行(MTB)
3.9%
0.9%
90
10.2
5
通用电气(GE)
3.7%
0.3%
1715
12.6
6
强生(JNJ)
3.6%
5.4%
1758
15.3
7
宝洁(PG)
3.3%
9.3%
1754
16.2
8
卡夫食品(KFT)
3.3%
5.7%
616
20.2
9
UPS(UPS)
3.2%
0.2%
485
16.2
10
Gannett(GCI) (媒体股)
3.2%
0.05%
24
4.5

Friday, September 23, 2011

Mac OS Lion: New Wi-Fi Diagnostics tool & Troubleshooting Solutions

Inside Mac OS X 10.7 Lion: New Wi-Fi Diagnostics tool
http://www.appleinsider.com/articles/11/03/15/inside_mac_os_x_1

WiFi Dropping in OS X Lion? Here are Some Wireless Troubleshooting Solutions
http://osxdaily.com/2011/07/22/wifi-dropping-in-os-x-lion-fixes

Wednesday, September 14, 2011

How to delete database data file

1.DBCC SHRINKFILE('logical_file_name', EMPTYFILE).
2.After that, the file dropped with no problems.

Monday, September 12, 2011

成功人的特質

1. 目標具體
    “我想掉5磅”的目標比“我想減肥”就要好得多。
2. 開始時間具體
    不要定個目標就立刻把它忘了。
3. 追蹤進展
    時刻檢查自己離目標還有多遠。
4. 既樂觀主義又現實
5. 希望做到更好,而不是只做好
    很多人相信能力天生無法逾越,其實潛能是能不斷開發的。
6. 持之以恆
7. 意志力
    意志力可以磨練。做一些自己平常不挑戰自己的事情,如:放棄零食,每天100個仰臥起坐,學習新技能。開始覺得犯懶了吧?不行!再堅持堅持!
8. 認清事實不好高騖遠
    比如,意志力磨練一個一個來,不要一鍋端想一口吃成大胖子。
9. 多看“我想做的事”少看“我不想做的事”
    因為人性就是看到“Don't push the button”的時候你就會想去push the button。戒菸的時候老想著戒菸只會不停給自己誘惑,不如多想想你用來代替吸煙的那個活動。

Sunday, August 21, 2011

How to move TempDB to another drive.

Open Query Analyzer and connect to your server. Run this script to get the names of the files used for TempDB.
USE TempDB
GO
EXEC sp_helpfile
GO

Results will be something like:
name fileid filename filegroup size
——- —— ————————————————————– ———- ——-
tempdev 1 C:Program FilesMicrosoft SQL ServerMSSQLdatatempdb.mdf PRIMARY 16000 KB
templog 2 C:Program FilesMicrosoft SQL ServerMSSQLdatatemplog.ldf NULL 1024 KB
along with other information related to the database. The names of the files are usually tempdev and demplog by default. These names will be used in next statement.
=========================================

Run following code, to move mdf and ldf files.

USE master
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = tempdev, FILENAME = 'd:datatempdb.mdf')
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = templog, FILENAME = 'e:datatemplog.ldf')
GO

The definition of the TempDB is changed. However, no changes are made to TempDB till SQL Server restarts. Please stop and restart SQL Server and it will create TempDB files in new locations.