<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matrix &#187; dropbox</title>
	<atom:link href="http://matrix.windhunter.net/blog/tag/dropbox/feed" rel="self" type="application/rss+xml" />
	<link>http://matrix.windhunter.net/blog</link>
	<description>Everything that Has a Beginning Has an End</description>
	<lastBuildDate>Tue, 17 Jan 2012 00:51:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>blog服务器线路故障以及dropbox更新引起的小问题</title>
		<link>http://matrix.windhunter.net/blog/2010/03/dropbox-auto-upgrade-error-resolve-127.html</link>
		<comments>http://matrix.windhunter.net/blog/2010/03/dropbox-auto-upgrade-error-resolve-127.html#comments</comments>
		<pubDate>Mon, 01 Mar 2010 05:34:48 +0000</pubDate>
		<dc:creator>matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[dropbox]]></category>

		<guid isPermaLink="false">http://matrix.windhunter.net/blog/?p=127</guid>
		<description><![CDATA[我的linux服务器上跑了一份dropbox同步数据。今天早晨，例行的打开笔记本等数据更新，可惜，硬盘等没有如往常一样闪亮忙碌。当时没当回事，忙其他事情了。 10点多，xrspook同学短信到了，说服务器连不上。web/ssh/vpn都是如此。赶紧检查服务器，丢了份ticket给服务商。10分钟后，有回应了： （还不错，米国时间夜里2点半，居然还有值班人员。） Thank you for providing that information, I have forwarded it to our upstream provider for further investigation. We thank you for your continued patience with this matter, please do not hesitate to update this ticket with any questions or concerns you may have in the meantime. 原来是上一级的线路出现问题，故障和服务器完全无关。 12：13分，线路终于恢复了。 可是，我的dropbox依旧没动静。ssh上服务器，重新启动dropbox进程，出现了如下错误： /usr/local/.dropbox-dist-new/dropbox: /lib64/ld-linux-x86-64.so.2: bad [...]]]></description>
			<content:encoded><![CDATA[<p>我的linux服务器上跑了一份dropbox同步数据。今天早晨，例行的打开笔记本等数据更新，可惜，硬盘等没有如往常一样闪亮忙碌。当时没当回事，忙其他事情了。</p>
<p>10点多，<a href="http://www.xlanda.net" onclick="urchinTracker('/outgoing/www.xlanda.net?referer=');">xrspook</a>同学短信到了，说服务器连不上。web/ssh/vpn都是如此。赶紧检查服务器，丢了份ticket给服务商。10分钟后，有回应了：<br />
（还不错，米国时间夜里2点半，居然还有值班人员。）<br />
<span id="more-127"></span></p>
<blockquote><p><code><br />
Thank you for providing that information, I have forwarded it to our upstream provider for further investigation. We thank you for your continued patience with this matter, please do not hesitate to update this ticket with any questions or concerns you may have in the meantime.</code></p></blockquote>
<p>原来是上一级的线路出现问题，故障和服务器完全无关。</p>
<p>12：13分，线路终于恢复了。</p>
<p>可是，我的dropbox依旧没动静。ssh上服务器，重新启动dropbox进程，出现了如下错误：</p>
<blockquote><p>
<code>/usr/local/.dropbox-dist-new/dropbox: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory</code></p></blockquote>
<p>奇怪&#8230;.我安装dropbox的文件夹明明是.dropbox-dist。联想到到Windows版本的dropbox最近有个升级；而这里的文件夹名称变为.dropbox-dist-new。严重怀疑是dropbox瞒着俺偷偷把自己升级了了；怀疑运行错误的故障和此次自动升级有关。</p>
<p>上dropbox网站看了下，果然2月25号有个升级。ok，干掉错误的自动升级，手动升级：</p>
<blockquote><p>
<code>$ /etc/init.d/dropbox stop #先停掉dropbox服务<br />
$ cd /usr/local<br />
$ rm -rf .dropbox-dist<br />
$ rm -rf .dropbox-dist-new<br />
</code>
</p></blockquote>
<p>下载新版本</p>
<blockquote><p><code>$ wget http://dl-web.dropbox.com/u/17/dropbox-lnx.x86-0.7.110.tar.gz </code></p></blockquote>
<p>注意这里是32位版本，64位版本是http://dl-web.dropbox.com/u/17/dropbox-lnx.x86_64-0.7.110.tar.gz<br />
解解包即可：</p>
<blockquote><p><code>$ tar xzf dropbox-lnx.x86-0.7.110.tar.gz </code></p></blockquote>
<p>重新运行dropbox后一切正常。</p>
<p>看来dropbox的自动升级还是不够智能.</p>
]]></content:encoded>
			<wfw:commentRss>http://matrix.windhunter.net/blog/2010/03/dropbox-auto-upgrade-error-resolve-127.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何利用dropbox的console模式备份linux服务器上的资料</title>
		<link>http://matrix.windhunter.net/blog/2010/02/how-to-use-dropbox-under-console-mode-95.html</link>
		<comments>http://matrix.windhunter.net/blog/2010/02/how-to-use-dropbox-under-console-mode-95.html#comments</comments>
		<pubDate>Wed, 24 Feb 2010 04:48:03 +0000</pubDate>
		<dc:creator>matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[dropbox]]></category>

		<guid isPermaLink="false">http://matrix.windhunter.net/blog/?p=95</guid>
		<description><![CDATA[Dropbox是一款非常好用的网盘工具。其支持的客户端非常多样，支持Windows/mac/linux。基本涵盖了主要的操作系统。对大陆用户来说，最方便的一点是：没有被墙（悲哀&#8230;.） 我们想利用dropbox支持多平台的特点，同步/备份linux服务器上的资料。因为专用的服务器并没有图形界面，所以，我们需要在console模式下运行dropbox。 1，我们安装dropbox： wget -O dropbox.tar.gz http://www.dropbox.com/download?plat=lnx.x86 如果服务器是64位版本，请使用这个链接 2，解包到相关文件夹 $ tar -zxof dropbox.tar.gz $ mv .dropbox-dist ~/.dropbox-dist 3，下载console版本需要的Pythone script $ wget http://dl.dropbox.com/u/6995/dbmakefakelib.py $ wget http://dl.dropbox.com/u/6995/dbreadconfig.py 4，运行 dbmakefakelib.py，以创建dropbox运行所需要的GUI库文件 $ python dbmakefakelib.py adding library libgtk-x11-2.0.so.0 adding library libgdk-x11-2.0.so.0 adding library libatk-1.0.so.0 adding library libgdk_pixbuf-2.0.so.0 adding library libpango-1.0.so.0 adding library libgobject-2.0.so.0 adding library libgmodule-2.0.so.0 adding library libgthread-2.0.so.0 adding [...]]]></description>
			<content:encoded><![CDATA[<p>Dropbox是一款非常好用的网盘工具。其支持的客户端非常多样，支持Windows/mac/linux。基本涵盖了主要的操作系统。对大陆用户来说，最方便的一点是：没有被墙（悲哀&#8230;.）</p>
<p>我们想利用dropbox支持多平台的特点，同步/备份linux服务器上的资料。因为专用的服务器并没有图形界面，所以，我们需要在console模式下运行dropbox。<br />
<span id="more-95"></span><br />
1，我们安装dropbox：</p>
<blockquote><p>wget -O dropbox.tar.gz http://www.dropbox.com/download?plat=lnx.x86</p></blockquote>
<p>如果服务器是64位版本，请使用这个<a href="http://www.dropbox.com/download?plat=lnx.x86_64" onclick="urchinTracker('/outgoing/www.dropbox.com/download?plat=lnx.x86_64&amp;referer=');">链接</a></p>
<p>2，解包到相关文件夹</p>
<blockquote>
<pre>$ tar -zxof dropbox.tar.gz</pre>
<pre>$ mv .dropbox-dist ~/.dropbox-dist</pre>
</blockquote>
<pre>3，下载console版本需要的Pythone script</pre>
<blockquote>
<pre>
<pre>$ wget http://dl.dropbox.com/u/6995/dbmakefakelib.py
$ wget http://dl.dropbox.com/u/6995/dbreadconfig.py</pre>
</pre>
</blockquote>
<pre>4，运行 dbmakefakelib.py，以创建dropbox运行所需要的GUI库文件</pre>
<blockquote>
<pre>
<pre>$ python dbmakefakelib.py
adding library libgtk-x11-2.0.so.0
adding library libgdk-x11-2.0.so.0
adding library libatk-1.0.so.0
adding library libgdk_pixbuf-2.0.so.0
adding library libpango-1.0.so.0
adding library libgobject-2.0.so.0
adding library libgmodule-2.0.so.0
adding library libgthread-2.0.so.0
adding library libglib-2.0.so.0
adding function gtk_tree_view_new
adding function gtk_toolbar_new
adding function g_threads_got_initialized
adding function gtk_grab_remove
adding function gtk_button_new
adding function gtk_frame_new
adding function gtk_major_version
... lots more of this ...
adding function g_static_rw_lock_writer_unlock
adding function g_value_set_boxed_take_ownership
adding function g_boxed_type_register_static
adding function g_datalist_clear
dropboxd ran for 15 seconds without quitting - success?</pre>
</pre>
</blockquote>
<p>如果在这里系统没有反应，也不用担心。</p>
<p>5，现在，我们读取hostid</p>
<blockquote>
<pre>$ python dbreadconfig.py
host_id = 739bfxxxxxxxxxxxxxxxxx20dbe2b //我mark了一下...呵呵...
last_revision = None
schema_version = 6</pre>
</blockquote>
<pre>如果您和我一样不幸读取失败</pre>
<blockquote>
<pre>$ python dbreadconfig.py
File "dbreadconfig.py", line 24
 print row[0], '=', pickle.loads(base64.b64decode(row[1])) if row[1] !=  None else row[1]
 SyntaxError: invalid syntax</pre>
</blockquote>
<pre>那么，用SQLite直接查询：</pre>
<blockquote>
<pre>$ cd .dropbox
$  sqlite3 dropbox.db
SQLite version 3.3.6
Enter ".help" for instructions
sqlite&gt; .dump config #执行这个命令
BEGIN TRANSACTION;
CREATE TABLE config (
id INTEGER PRIMARY KEY,
key TEXT NOT NULL UNIQUE,
value TEXT
);
INSERT INTO "config" VALUES(1, 'schema_version', 'STYKLg==
');
INSERT INTO "config" VALUES(2, 'last_revision', NULL);
INSERT INTO "config" VALUES(3, 'host_id',

'VjZXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxCi4=    //此处的资料被我用xxxx盖住了大部分...
 ');
 COMMIT;</pre>
</blockquote>
<p>现在，我们把hostid解码，官方文档推荐使用 <a href="http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/" onclick="urchinTracker('/outgoing/www.opinionatedgeek.com/dotnet/tools/Base64Decode/?referer=');">http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/</a> decode之后，我们会获取三行字符：</p>
<blockquote><p>V6c19ae63289XXXXXXXXXXXdb7372a8c772    //还是XXXXXX过的&#8230;<br />
p1<br />
.</p></blockquote>
<p>第二/三行忽略，第一行去掉V，现在我们获取了hostid:6c19ae63289XXXXXXXXXXXdb7372a8c772</p>
<p>6，去dropbox网站绑定。</p>
<p>打开https://www.dropbox.com/cli_link?hostid=HOSTID (这里替换成上一步获取的字符串)</p>
<p>7，建立Dropbox文件夹：</p>
<blockquote>
<pre>$ mkdir ~/Dropbox //注意大小写</pre>
</blockquote>
<p>8，后台运行dropbox:</p>
<blockquote>
<pre>~/.dropbox-dist/dropboxd &amp;</pre>
</blockquote>
<p>至此，所有 ~/Dropbox文件夹下的文件自动备份/同步至Dropbox了。</p>
<p>关于备份：</p>
<p>我们可以建立备份脚本，每天凌晨3点将数据都tar至 ~/Dropbox文件夹。cron+shell脚本即可搞定。这里就不多说了。</p>
<p>(我的Dropbox Referrals Link：<a href="https://www.dropbox.com/referrals/NTE2MDg0MDc5" onclick="urchinTracker('/outgoing/www.dropbox.com/referrals/NTE2MDg0MDc5?referer=');">https://www.dropbox.com/referrals/NTE2MDg0MDc5  </a><br />
用此链接注册Dropbox，你我都有空间加成&#8230;欢迎注册&#8230;.)</p>
<p>参考文件：<br />
1.<a href="http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall" onclick="urchinTracker('/outgoing/wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall?referer=');">How To Install Dropbox In An Entirely Text Based Linux Environment</a><br />
2.<a href="http://unixhater.com/487.html" onclick="urchinTracker('/outgoing/unixhater.com/487.html?referer=');">linux下自动备份blog到dropbox</a> (可惜，大部分工作完成后才发现此文)</p>
]]></content:encoded>
			<wfw:commentRss>http://matrix.windhunter.net/blog/2010/02/how-to-use-dropbox-under-console-mode-95.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

