Submitted by gouki on 2013, June 27, 11:09 AM
在mac下面,居然没有好的抓包工具,这让我十分纠结,毕竟不可能为了抓一个http包就跑到win下折腾。或许有人说tcpdump这么好的工具,你怎么不用。说实话,tcpdump太复杂了,我还没有细看,再加上不是所见所得,所以,用起来不是那么习惯
又有人说,wireshark怎么不用?好吧,其实我是有装wireshark,只是启动的时候会启动XQuartz,有点慢,当然这不是主要的,而是wireshark功能太强大了,以至于都不会写过滤器。
也有人说,图方便的话,完全可以用chrome自带的抓包工具啊?在没有找到这个工具之前,你可以尝试在地址栏输入:chrome://chrome-urls/,你会发现chrome原来有这么多的隐藏工具,嗯。我要说的就是其中的一个:chrome://net-internals/ ,在Events中,你可以进行过滤,不过,针对https的包,内容没法显示
越来越怀念windows下面,smartsniff完全就是wireshark的简化版,抓起包来刷刷的,过滤数据也很方便。
当然,mac下面的charles就真心不错了,试用了一下,果然对于https的包也能够抓取。
这里有一个简单的教程(实际操作略有出入):
在Mac下做开发,用Fiddler抓包由于离不开Windows比较痛苦,还好有Charles,到官网http://www.charlesproxy.com/可下载到最新版本(若不支持rMBP可拖到Retinizer中把文字变清晰)
HTTP抓包
- 打开Charles程序
- 查看Mac电脑的IP地址,如192.168.1.7
- 打开iOS设置,进入当前wifi连接,设置HTTP代理Group,将服务器填为上一步中获得的IP,即192.168.1.7,端口填8888
- iOS设备打开你要抓包的app进行网络操作
- Charles弹出确认框,点击Allow按钮即可
HTTPS抓包
- 下载Charles证书http://www.charlesproxy.com/ssl.zip,解压后导入到iOS设备中(将crt文件作为邮件附件发给自己,再在iOS设备中点击附件即可安装;也可上传至dropbox之类的网盘,通过safari下载安装)
- 在Charles的工具栏上点击设置按钮,选择Proxy Settings…
- 切换到SSL选项卡,选中Enable SSL Proxying,别急,选完先别关掉,还有下一步
- 这一步跟Fiddler不同,Fiddler安装证书后就可以抓HTTPS网址的包了,Charles则麻烦一些,需要在上一步的SSL选项卡的Locations表单填写要抓包的域名和端口,点击Add按钮,在弹出的表单中Host填写域名,比如填api.instagram.com,Port填443
接下来就跟HTTP抓包一样了
---EOF---
上文中的一些操作,其实是有点出入的(HTTPS)抓包
1、如果没有设置ssl的话,那么你看到的ssl的接口中,会有一个报错:SSL Proxying not enabled for this host: enable in Proxy Settings, SSL locations,这个时候,在左侧的域名上点右键:enable ssl,就OK了。(其实就是上面的第4部,不过这个操作是简化操作,上面的第4步太麻烦了)
2、如果这样还是不能抓包,那么官方会有一个说明(http://www.charlesproxy.com/documentation/using-charles/ssl-certificates/):
MAC OS X
Download and unzip the Charles CA Certificate bundle. The bundle contains the Charles CA Certificate file.
Run the Keychain Access utility from the Applications/Utilities folder. This tool enables you to manage your certificates.
Choose the "login" keychain then go to the File menu and choose Import. Choose the .crt file you downloaded above, and ensure that the login keychain is chosen in the dropdown menu.
Complete the import and the Charles CA SSL Certificate will now be trusted for your login account.
Move the Charles Proxy SSL Proxying certificate from your login keychain to the System keychain by drag-and-drop if you want all users on the machine to trust it.
You will need to quit and reopen Safari to see the change.
GOOGLE CHROME
On Mac OS X, please follow the instructions for Mac OS X above. These instructions only apply on Windows.
Open the Options dialog, go to the "Under the Hood" tab, then click the "Manage certificates" button.
Go to the Trusted Root Certification Authorities tab and click Import.
Find the charles-proxy-ssl-proxying-certificate.crt file. On Windows and Linux it is in the docs directory in your Charles installation directory. On Mac OS X (or if you can’t find it) you can download and unzip ssl.zip.
Choose the charles-proxy-ssl-proxying-certificate.crt file, then click Next and Finish, leaving the default options, until you complete the import. Chrome will now always trust certificates signed by Charles.
After importing you can delete the charles-proxy-ssl-proxying-certificate.crt file if you downloaded it.
---如果用chrome,那就直接可以使用/如果firefox,会有插件提示你安装/如果是safari,则需要打开证书管理器,将刚才导入的证书把login改为system(这样所有用户就都能使用了,不过都是自己的电脑,无所谓了),safari可能需要重启下浏览器
经此,我终于可以抓包了。而且https包也不再只是一堆 乱码。黑黑
Tags: charles, wireshark
Flutter | 评论:2
| 阅读:57504
Submitted by gouki on 2013, June 26, 7:31 PM
虽然rmbp出来不少时间了,但很多APP仍然顽固的不支持retina屏,这里面有一些代表APP,比如:google的picasa。在rmbp的屏幕下简直就是一个渣啊。
所幸,有牛人勇敢的站了出来,他在自己的APP里这么写到:
Retinizer is a small app I wrote that allows apps that aren’t retina ready and are displayed pixelated at 1x to displaytheir UI widgets at 2x. That way, only their custom images will look bad and not the whole app.
To use the app, just drag an app (and make sure it’s closed) into the window and click the Retinize! button.
It also allows de-retinization of an app, in case it has problems in 2x mode. Just drag an app that you retinized before and click the button below, which will now read De-retinize.
The app works per-user. That means, retinizing an app in your account will not affect the app in other accounts, where it will display at its usual 1x.
So far, it seems only apps that use Carbon, directly (like Snes9x) or indirectly (wxWidgets, Qt apps) draw their widgets at 1x on a retina display, while Cocoa apps seem to alwas draw widgets at 2x. But some apps, such as Eclipse, draw at 1x and use Cocoa (albeit with some weird Java bindings or something like that, not sure). This app also helps in that case.
Please note that this app won’t make apps get retina images. That means, custom icons in e.g. the Preferences window will still look ugly.
It has only been tested with 10.8 but should work fine with 10.7.4.
Known bugs:
- Cannot tell if apps are retina ready unless they have set NSHighResolutionCapable in their Info.plist.
- DON'T USE IT WITH ADOBE CREATIVE SUITE
- It may have problems with apps that don’t use the defaults system
You must have Gatekeeper disabled or open the app with Ctrl-Click->Open, as I don’t (yet) have a Gatekeeper Certificate.
-----
看看,人家可是好好的说的:不要用在adobe的软件中,在使用前注意,如果你开了安全权限,需要按住 ctrl健,再打开APP。
试用了一下,office的图片明显清楚了一些。
下载地址:https://sites.google.com/a/mikelpr.com/files/home/Retinizer050.zip?attredirects=0
使用方法很简单,先打开 Retinizer 软件,然后将APP拖放到Retinizer的窗口即可
Flutter | 评论:0
| 阅读:16737
Submitted by gouki on 2013, June 26, 7:08 PM
PHP | 评论:0
| 阅读:14783
Submitted by gouki on 2013, June 22, 10:37 PM
这篇文章,我在一个月前已经看到了,但是一直在犹豫,是否要转载,忍了很久很久,最后还是决定,转了。
内容并不多,只有11条,来自于http://www.tzkd.com/hou/5578.html:
(1)依赖性特别强的人:不管你是加盟还是自己创业,你自己是永远的主流,别人帮你都只是支流。
(2)只是想试试看的人:90年代初期你抱着试试看想开店,成功概率很高,现在竞争这样激烈的情况下假如你只是试试看,假如能成功那是运气。所以提醒那些蠢蠢欲动想试试看开个婴儿用品店的人请小心,你的开店失败可能性非常高。
(3)资金有40%以上是借来的人:资金会给你带来压力,压力会让你无法从长远考虑。
(4)自己不参与经营,只是出钱找别人操作的人:除非你是开大型超市,请得是职业经理人,假如只是一个小店还是请别人来经营,成功的概率是很低的。
(5)从没有经商过的人:假如从没有经商经验,做婴儿用品店是很累的,因为婴儿用品品种太多,你要从众多产品中选择出适合的商品是要很有经验的,假如你没有经验,那你只能靠天赋,事实告诉我们,没几人个天生有天赋的。
(6)朋友圈子很少的人:朋友圈子少证明你与人沟通能力不强,开店需要与客户沟通,与供应商沟通,与营业员沟通,假如你原本就不习惯与自己不喜欢的人沟通,想更改这种性格是很不容易的,而问题是:假如你没有很好的沟通能力,你是很难做零售服务业的。
(7)心很急的人:心急就容易出错.对于资金本身不多的业主,错三次以上就没什么戏了。
(8)很容易放弃的人:不管是开婴儿用品店还是做别的事情,容易放弃基本上成不了什么事,就算你再聪明也没用!
(9)理由很多的人:因为产品不全、因为资金不够、因为没人帮忙等等,假如你会经常无意识的说这些话,那千万别去经营婴儿用品。
(10)什么东西都觉得是别人好的人:感觉产品不如对手好;合作商也不如对手;地点也不如别人好;客户也不如别的店面客户好说话 。 这种人很容易对自己和身边的同事失去信心。
(11)想了很久都没动手的人:很多人都会说:我早就想开了,因为什么原因没有行动。假如你想开婴儿用品店已经有3个月以上了还没有开始,那不考虑了,一定不适合的。婴儿用品店是一个很需要行动力的行业。
在上面这十一点里,好象都是指婴儿用品,但仔细看看,对于任何一个创业者来说,难道不都是一个鞭策吗?如果你也是在这11点里,不要说婴幼儿用品店不能开,其他的创业机会也最好只是想想,否则就真是往坑里跳
Misc | 评论:0
| 阅读:15185
Submitted by gouki on 2013, June 20, 10:56 PM
一转眼,5岁了。
今天下午去买了块蛋糕,也算是为它庆祝了一下。时间真的过的好快啊
有些照片没法上传,所以暂时今天就不传了,明天补上
----
后记:一次意外操作,5天内的照片全部被删除了。。。。伤心
Scala & Ruby | 评论:0
| 阅读:17654