-
Notifications
You must be signed in to change notification settings - Fork 0
/
index3.html
439 lines (307 loc) · 16.7 KB
/
index3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<!DOCTYPE html>
<html lang="zh_cn">
<head>
<meta charset="utf-8">
<title>suphy' Blog</title>
<meta name="description" content="">
<meta name="author" content="suphy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="./theme/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="./theme/bootstrap.min.css" rel="stylesheet">
<link href="./theme/bootstrap.min.responsive.css" rel="stylesheet">
<link href="./theme/local.css" rel="stylesheet">
<link href="./theme/pygments.css" rel="stylesheet">
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href=".">suphy' Blog</a>
<div class="nav-collapse">
<ul class="nav">
<li><a href=".">首页</a></li>
<li><a href="./categories.html">分类</a></li>
<li><a href="./archives.html">归档</a></li>
<li><a href="./about.html">关于</a></li>
<li><a href="./search.html">搜索</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="content">
<div class="row">
<div class="span9">
<div class='article'>
<a href="./android/android_bitmap_cache.html"><h2>Android图片缓存</h2></a>
<div class= "well small"> 2014-03-11 11:37:00
by <a class="url fn" href="./author/suphy.html">suphy</a>
</div>
<div class="summary"><h3>开源lib Universal Image Loader</h3>
<ol>
<li>ImageLoader根据ImageView的width,height确定图片的宽高。</li>
<li>
<p>经常出现OutOfMemory:</p>
<ul>
<li>减少线程池数目.threadPoolSize(1 - 5 is recommended)</li>
<li>使用.bitmapConfig(Bitmap.Config.RGB_565)减少图片占用内存数目</li>
<li>memoryCache(new WeakMemoryCache()) 及时释放内存</li>
<li>imageScaleType(ImageScaleType.IN_SAMPLE_INT)或者imageScaleType(ImageScaleType.EXACTLY)</li>
<li>避免使用RoundedBitmapDisplayer;他会创建新的ARGB_8888格式的Bitmap对象;</li>
<li>使用.memoryCache(new WeakMemoryCache()),不要使用.cacheInMemory();</li>
</ul>
</li>
<li>
<p>内存缓存,sd卡缓存,显示图片,可以使用已经初始化过的实现;</p>
</li>
<li>为了避免使用list,grid,scroll,你可以使用:</li>
</ol>
<div class="highlight"><pre><span class="n">boolean</span> <span class="n">pauseOnScroll</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span> <span class="c1">// or true ...</span></pre></div> <a class="btn btn-info xsmall" href="./android/android_bitmap_cache.html">read more</a></div>
</div>
<div class='article'>
<a href="./linux/linux_main_crontab.html"><h2>Linux crontab定期执行命令</h2></a>
<div class= "well small"> 2014-03-09 18:37:00
by <a class="url fn" href="./author/suphy.html">suphy</a>
</div>
<div class="summary"><h3>什么是crond,crontab</h3>
<p>Linux下面定期任务分为二部分,一部分是后台程序crond;另一部分是crontab往crond输入指令的接口。</p>
<p>crond 是linux用来定期执行程序的命令。当安装完成操作系统之后,默认便会启动此任务调度命令。crond命令每分钟会定期检查是否有要执行的工作,如果有要执行的工作便会自动执行该工作。</p>
<p>linux任务调度的工作主要分为以下两类:</p>
<ol>
<li>系统执行的工作:<br />
系统周期性所要执行的工作,如备份系统数据、清理缓存 </li>
<li>个人执行的工作:<br />
某个用户定期要做的工作,例如每隔10分钟检查邮件服务器是否有新信,这些工作可由每个用户自行设置</li>
</ol>
<p>Crontab是UNIX系统下的定时任务触发器,其使用者的权限记载在下列两个文件中:</p>
<table>
<thead>
<tr>
<th>文件</th>
<th>含义</th>
</tr>
</thead>
<tbody>
<tr>
<td>/etc/cron.deny</td>
<td>该文件中所列的用户不允许使用Crontab命令</td>
</tr>
<tr>
<td>/etc/cron.allow</td>
<td>该文件中所列的用户允许使用Crontab命令</td>
</tr>
<tr>
<td>/var/spool/cron/</td>
<td>是所有用户的crontab文件</td>
</tr>
<tr>
<td>/var/spool/cron/crontabs</td>
<td>/var/spool/cron/crontabs</td>
</tr>
</tbody>
</table>
<p>crond是linux的内置服务,但它不自动起来,可以用以下的方法启动、关闭这个服务:</p>
<div class="highlight"><pre><span class="o">/</span><span class="n">sbin</span><span class="o">/</span><span class="n">service ...</span></pre></div> <a class="btn btn-info xsmall" href="./linux/linux_main_crontab.html">read more</a></div>
</div>
<div class='article'>
<a href="./linux/linux_main_curl.html"><h2>Linux curl命令</h2></a>
<div class= "well small"> 2014-03-09 17:37:00
by <a class="url fn" href="./author/suphy.html">suphy</a>
</div>
<div class="summary"><p>Linux curl命令是一个功能强大的网络工具,它能够通过http、ftp等方式下载文件,也能够上传文件。其实curl远不止,类似的工具还有wget。</p>
<p>Linux curl命令使用了libcurl库来实现,libcurl库常用在C程序中用来处理HTTP请求,curlpp是libcurl的一个C++封装,这几个东西可以用在抓取网页、网络监控等方面的开发,而curl命令可以帮助来解决开发过程中遇到的问题。</p>
<h3>curl命令常用参数:</h3>
<div class="highlight"><pre><span class="na">-A</span><span class="err">或</span><span class="o">--</span><span class="nb">user</span><span class="na">-agent</span> <span class="p">:</span><span class="err">随意指定自己这次访问所宣称的自己的浏览器信息</span>
<span class="na">-b</span><span class="o">/--</span><span class="nb">cookie</span> <span class="o"><</span><span class="n">name</span><span class="o">=</span><span class="kt">string</span><span class="p">/</span><span class="nb">file</span><span class="o">></span> <span class="p">:</span><span class="nb">cookie</span><span class="err">字符串或文件读取位置,使用</span><span class="nb">option</span><span class="err">来把上次的</span><span class="nb">cookie</span><span class="err">信息追加到</span><span class="nx">http</span> <span class="nx">request</span><span class="err">里面去。</span>
<span class="na">-c</span><span class="o">/--</span><span class="nb">cookie</span><span class="na">-jar</span> <span class="o"><</span><span class="nb">file</span><span class="o">></span> <span class="p">:</span><span class="err">操作结束后把</span><span class="nb">cookie</span><span class="err">写入到这个文件中</span>
<span class="na">-C</span><span class="o">/--</span><span class="nb">continue</span><span class="na">-at</span> <span class="o"><</span><span class="nx">offset</span><span class="o">></span> <span class="p">:</span><span class="err">断点续转</span>
<span class="na">-d</span><span class="o">/--</span><span class="kd">data ...</span></pre></div> <a class="btn btn-info xsmall" href="./linux/linux_main_curl.html">read more</a></div>
</div>
<div class='article'>
<a href="./linux/linux_main_wget.html"><h2>Linux wget命令详解</h2></a>
<div class= "well small"> 2014-03-09 16:37:00
by <a class="url fn" href="./author/suphy.html">suphy</a>
</div>
<div class="summary"><p>wget是一个命令行的下载工具。对于我们这些 Linux 用户来说,几乎每天都在使用它。下面为大家介绍几个有用的 wget 小技巧,可以让你更加高效而灵活的使用 wget。</p>
<div class="highlight"><pre>wget -r -np -nd http://example.com/packages/
</pre></div>
<p>这条命令可以下载http://example.com网站上packages目录中得所有文件。其中:</p>
<ul>
<li>-np: 表示不遍历父目录</li>
<li>-nd: 表示不在本机重新创建目录结构</li>
</ul>
<div class="highlight"><pre>wget -r -np -nd --accept<span class="o">=</span>iso http://example.com/centos-5/i386/
</pre></div>
<p>与上一条命令相似,但多加一个<code>--accept=iso</code>选项,这指示wget仅下载 i386 目录中所有扩展名为 iso 的文件。你也可以指定多个扩展名,只需用逗号分隔即可。</p>
<div class="highlight"><pre>wget ...</pre></div> <a class="btn btn-info xsmall" href="./linux/linux_main_wget.html">read more</a></div>
</div>
<div class='article'>
<a href="./linux/linux_info.html"><h2>查看Linux系统信息命令</h2></a>
<div class= "well small"> 2014-03-09 15:37:00
by <a class="url fn" href="./author/suphy.html">suphy</a>
</div>
<div class="summary"><p>Linux中查看系统信息的常用命令:</p>
<ul>
<li>查看CPU信息</li>
</ul>
<div class="highlight"><pre><span class="n">cat</span> <span class="o">/</span><span class="n">proc</span><span class="o">/</span><span class="n">cpuinfo</span>
</pre></div>
<ul>
<li>查看内存信息 </li>
</ul>
<div class="highlight"><pre><span class="n">cat</span> <span class="o">/</span><span class="n">proc</span><span class="o">/</span><span class="n">meminfo</span>
</pre></div>
<ul>
<li>查看内存大小</li>
</ul>
<div class="highlight"><pre><span class="n">grep</span> <span class="n">MemTotal</span> <span class="o">/</span><span class="n">proc</span><span class="o">/</span><span class="n">meminfo</span>
</pre></div>
<ul>
<li>查看所有PCI设备</li>
</ul>
<div class="highlight"><pre><span class="err">$</span> <span class="o">/</span><span class="n">sbin</span><span class="o">/</span><span class="n">lspci</span>
</pre></div>
<ul>
<li>查看所有的usb设备</li>
</ul>
<div class="highlight"><pre><span class="err">$</span> <span class="o">/</span><span class="n">sbin</span><span class="o">/</span><span class="n">lsusb</span>
</pre></div>
<ul>
<li>显示系统中所有加载的模块</li>
</ul>
<div class="highlight"><pre><span class="err">$</span> <span class="o">/</span><span class="n">sbin</span><span class="o">/</span><span class="n">lsmod</span>
</pre></div>
<ul>
<li>显示当前的内存使用情况</li>
</ul>
<div class="highlight"><pre><span class="n">free</span> <span class="o">-</span><span class="n">m</span>
</pre></div>
<ul>
<li>查看系统各分区的使用情况(已用空间、可用空间等)</li>
</ul>
<div class="highlight"><pre><span class="n">df</span> <span class="o">-</span><span class="n">h</span>
</pre></div>
<ul>
<li>查看磁盘的分区及文件系统格式(需root权限)</li>
</ul>
<div class="highlight"><pre><span class="n">fdisk</span> <span class="o">-</span><span class="n">l</span>
</pre></div>
<ul>
<li>查看系统中CPU利用率、空闲率及各进程CPU、内存、IO等资源占用情况</li>
</ul>
<div class="highlight"><pre><span class="n">top</span>
</pre></div>
<ul>
<li>另一个查看统中CPU利用率、空闲率的方法</li>
</ul>
<div class="highlight"><pre><span class="n">vmstat</span> <span class="mi">5</span> <span class="err">#</span><span class="mi">5</span><span class="err">秒刷新一次</span>
</pre></div>
<ul>
<li>查看系统运行时间及负载情况</li>
</ul>
<div class="highlight"><pre><span class="n">uptime</span>
</pre></div>
<ul>
<li>查看IDE硬盘参数</li>
</ul>
<div class="highlight"><pre><span class="n">hdparm ...</span></pre></div> <a class="btn btn-info xsmall" href="./linux/linux_info.html">read more</a></div>
</div>
<div class='article'>
<a href="./life/my_mac_repair.html"><h2>不作死不死</h2></a>
<div class= "well small"> 2014-03-04 23:07:00
by <a class="url fn" href="./author/suphy.html">suphy</a>
</div>
<div class="summary"><h3>No zuo No die</h3>
<p><img alt="image" src="../static/images/mac_adventrue.jpg" /></p>
<p>上周日在家没事做,又不想看书或敲程序,就开始想捣鼓下电脑(Macbook pro 13'),打算光驱位改装为硬盘形成双硬盘,一块固态硬盘256G,一块普通原装硬盘500G;</p>
<p>于是头脑一热说干就干,拆解后盖、拔电源线、拆光驱、安装硬盘,再重新安装上各线,开机。。。
尼玛,出问题了。。。怎么按电源都没反应,链接外置电源还是没反应---无法开机了,这要肿么办啊。。。! </p>
<p>难道电脑无法改装成双硬盘,于是赶紧在把光驱重新安装上去,可是还是无法开机,各种按电源键都没反应啊!!! 这是要作死的节奏吗? 好几千块的电脑不会就报废了吧?</p>
<blockquote>
<p>我无法接受啊,苍天啊,大地啊! 电脑对于一个屌丝程序员来说就是命啊</p>
</blockquote>
<p>赶紧查电话联系苹果官网,询问是什么原因? </p>
<p>客服MM还是很热情的,细心询问问题,建议我去最近的苹果官方售后去检测下。于是,我就赶紧打的去了售后;尼玛,周日苹果售后人超多啊!取号、等候,最后终于等到我了。维修师傅接过电脑,我向他描述了问题所在,然后他按几下快捷键说 ...</p> <a class="btn btn-info xsmall" href="./life/my_mac_repair.html">read more</a></div>
</div>
<div class="pagination">
<ul>
<li class="prev"><a href="./index2.html">← Previous</a></li>
<li class=""><a href="./index.html">1</a></li>
<li class=""><a href="./index2.html">2</a></li>
<li class="active"><a href="./index3.html">3</a></li>
<li class=""><a href="./index4.html">4</a></li>
<li class=""><a href="./index5.html">5</a></li>
<li class="next"><a href="./index4.html">Next →</a></li>
</ul>
</div>
</div>
<div class="span3">
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Site
</li>
<li><a href="./archives.html">Archives</a>
<li><a href="./tags.html">Tags</a>
</ul>
</div>
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Categories
</li>
<li><a href="./category/android.html">android</a></li>
<li><a href="./category/java.html">java</a></li>
<li><a href="./category/life.html">life</a></li>
<li><a href="./category/linux.html">linux</a></li>
<li><a href="./category/scm.html">Scm</a></li>
<li><a href="./category/tech.html">Tech</a></li>
<li><a href="./category/tool.html">tool</a></li>
<li><a href="./category/vehicle.html">vehicle</a></li>
</ul>
</div>
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Links
</li>
<li><a href="https://www.google.com/ncr">Google</a></li>
<li><a href="http://python.org/">Python</a></li>
<li><a href="http://docs.getpelican.com/">Pelican</a></li>
</ul>
</div>
<div class="social">
<div class="well" style="padding: 8px 0; background-color: #FBFBFB;">
<ul class="nav nav-list">
<li class="nav-header">
Social
</li>
<li><a href="https://github.com/suphy2009">Github</a></li>
<li><a href="https://www.facebook.com/profile.php?id=100003251594803">Facebook</a></li>
<li><a href="http://www.linkedin.com/profile/view?id=273447004">Linkedin</a></li>
<li><a href="http://weibo.com/suphy2010">微博</a></li>
</ul>
</div>
</div>
</div>
</div> </div>
<footer>
<br />
<p><a href=".">suphy' Blog</a> © suphy 2012</p>
</footer>
</div> <!-- /container -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-collapse.js"></script>
<script>var _gaq=[['_setAccount','UA-47831467-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'))</script>
</body>
</html>