Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Hooopo
@hooopo
管理员
第 8 位会员 / 2011-10-28

[email protected]
nil
北京
160 篇帖子 / 3013 条回帖
360 关注者
0 正在关注
74 收藏
聪明的妖怪录下了唐僧的紧箍咒
打赏作者
GitHub Public Repos
  • oh-my-github-circles 47

    GitHub User Circle Generator Using GitHub Actions

  • hackernews-insight 21

    Hackernews Insight using TiDB Cloud

  • repo-track-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any repository to your da...

  • oh-my-github-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any github user to your d...

  • chatgpt-xiaoai 3

    小爱音箱集成LLM,SaaS 服务

  • repo-contributor-circles 1

    GitHub repo contributor circles generator.

  • ossinsight-x 1

    Automatically post trending repos to Twitter every day.

  • mi-service 1

    XiaoMi Cloud Service for mi.com

  • hooopo 0

  • streamlit-echarts-demo 0

    Demo for Streamlit ECharts component

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 在 console 中直接开启编辑器查看源码 at 2013年02月14日

    断点调试最强大,可以结合 proxy 做一个类似 fiddler 的东东?

  • Happycasts: Rails 入门系列视频 (5 期) at 2013年02月14日

    #27 楼 @happypeter 好贵

  • 坑 at 2013年02月11日

    这个问题的原因不是因为 Ruby 里变量出现过就是有定义的么,不一定要执行到。比如:

    if false
      var = 1
    end
    puts defined?(var) # => local-variable
    

    还有一个例子是a = a || 1

    回到 a = a || 1。这里 Ruby 先看到了 a 出现在赋值符号的左手边,于是创建出变量 a,值为 nil;接下来对赋值符号右手边求值,nil || 1 的结果是 1;然后完成赋值,a 的值就是 1 了。单独的 a || 1 则没这待遇,得看前面有没有别的地方让 a 存在,不然就会出错。

    http://rednaxelafx.iteye.com/blog/361770

  • 貌似 Rack 爆安全漏洞了 at 2013年02月10日

    #15 楼 @luikore 这个 timing attack 攻击条件虽然苛刻,难以利用,但是如果成功的话会带来潜在的 SQL 注入和任意代码执行漏洞。序列化换成 json 也是这个原因,yaml 做和外部输入相关的风险太大,json 是最佳的。

    上面也提到了如果是在云平台内部的话延迟是可以很低的,timing attack 还是可行的。

  • 貌似 Rack 爆安全漏洞了 at 2013年02月10日

    #22 楼 @luikore 看了介绍 okjson 是从 go port 过来的,连发布方式也像 go,不做成 gem,直接 copy 到项目里,避免命名冲突和依赖。设计目的是简单便携。

    PS. 上次 Rails 的 json-yaml 漏洞 patch 也引人的这个 okjson。

  • 貌似 Rack 爆安全漏洞了 at 2013年02月10日

    #20 楼 @luikore 看commit message是说 1.6+ 会默认用 JSON,现在使用的 rack 还都是 1.5 的。还加了一个 okjson,不知道是不是速度快一些?

  • 貌似 Rack 爆安全漏洞了 at 2013年02月10日

    #3 楼 @keating 因为 Rails 在三年前已经 fix 了这个问题:https://github.com/rails/rails/commit/5e6dab8b34152bc48c89032d20e5bda1511e28fb

    #1 楼 @bhuztez 大部分 Rails 项目是在 cookie 里存 session 的,因为那是默认设置。

    写了一篇博客解释一下:http://hooopo.herokuapp.com/posts/1

  • 貌似 Rack 爆安全漏洞了 at 2013年02月09日

    #15 楼 @luikore 如果用 Passenger 或 Unicorn 开启OOBGC 客户端遇到 Ruby GC 的概率会很低的。会更利于这种 timing attrack 攻击。

    其实 Rails 的 session 是没有加密的(前面那串就是简单的序列化),只做了防串改/伪造。而防伪造的唯一工具就是那个 secret_token,但是大多数开源项目是直接把这个东西放到源码库里的。所以,大部分 Rails 开源项目的 session 是很容易伪造的。不过 devise 使用 warden 这样的 gem 做法好像有些不同,没只细看。像 Ruby China 的 session 前半部分反序列化回来是这样的:

    "session_id"=>"b8d724a***7f5c27494a51906",
     "_csrf_token"=>"oWVFfkGLJ***MelmIzFnQ+GpFkE7wtn2IM2Wn0=",
     "warden.user.user.key"=>["User", [8], "$2a$****W9LTJb2zsX2y."]} 
    

    Rails4 貌似在引入防 cookie 篡改/伪造的机制,和 session 原理一样。

    跑题:http://python-china.org/member/hooopo 这个漏洞还没修,怎么才能拿到站长 session。。。

    Rack::Session::Cookie 以前是可以伪造的:https://github.com/rack/rack/commit/054bc0203012c0e3ad6e1385cebe9e5d3d072b11

  • RubyConfChina 2012 新浪 SAE Ruby 平台激活码和七牛云存储现金券 at 2013年02月09日

    不知道还有没有了。。

  • 上传文件时 controller 丢失 param at 2013年02月08日

    #4 楼 @snowhs 你应该做一个 demo 重现这个 bug。要不别人很难帮助到你。

  • 上传文件时 controller 丢失 param at 2013年02月08日

    没代码怎么提供线索啊

  • Paperclip 和 Carrierwave 哪个更好? at 2013年02月05日

    I have used CarrierWave and after some hours of frustration I'm switching to Paperclip.

    Here are the problems I have seen with CarrierWave:

    • You can't validate file size. There is a wiki article that explains how to do it, but it does not work.
    • Integrity validations do not work when using MiniMagick (very convenient if you are concerned about RAM usage). You can upload a corrupted image file and CarrierWave will throw an error at first, but the next time will swallow it.
    • You can't delete the original file. You can instead resize it, compress, etc. There is a wiki article explaining how to do it, but again it does not work.
    • It depends on external libraries such as RMagick or MiniMagick. Paperclip works directly with the convert command line (ImageMagick). So, if you have problems with Minimagick (I had), you will lose hours diving in Google searches. Both RMagick and Minimagick are abandoned at the time of this writing (I contacted the author of Minimagic, no response).
    • It needs some configuration files. This is seen as an advantage, but I don't like having single configuration files around my project just for one gem. Configuration in the model seems more natural to me. This is a matter of personal taste anyway.
    • If you find some bug and report it, the dev team is really absent and busy. They will tell you to fix bugs yourself. It seems like a personal project that is improved in spare time. For me it's not valid for a professional project with deadlines.

    http://stackoverflow.com/questions/7419731/rails-3-paperclip-vs-carrierwave-vs-dragonfly-vs-attachment-fu

  • Paperclip 和 Carrierwave 哪个更好? at 2013年02月05日

    paperclip

  • 刚发了个 gem: triez (加了个全文搜索服务器的例子) at 2013年02月04日
    gem ins triez
    Fetching: triez-0.1.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed triez-0.1
    1 gem installed
    
    
  • 刚发了个 gem: triez (加了个全文搜索服务器的例子) at 2013年02月04日

    Awesome!

  • 八卦一下:你放假了吗 at 2013年02月04日

    #5 楼 @fenprace 。。。。。。。。。。

  • rails 使用生成的 destroy 方法时,为什么同时还会将 session 中的数据销毁了? at 2013年02月03日

    你用 flash 保存的?

  • capistrano 之外的选择,用 mina 部署果然快 at 2013年02月02日

    awesome

  • d at 2013年01月26日

    #16 楼 @lmorenbit 是的。关键是如何制止邻居扔屎。去骂哥哥蠢或是骂姐姐蠢都是没意义的。

  • d at 2013年01月26日

    其实我觉得第二种观点并不比第一种高到哪里去。但是微薄/推特上那些连别人观点都没看明白就开始贴标签的也是让人讨厌的。

  • d at 2013年01月26日

    #8 楼 @Saito fixed..

  • rails 开发的简化方案 at 2013年01月25日

    hehe

  • rails 中的ORM概念的疑问。 at 2013年01月25日

    #8 楼 @Saito http://rails-erd.rubyforge.org/ 这个也挺好用。不过其实我都不看的,直接看数据库里的字段。。

  • 同学们,你们是如何实现ORM的? at 2013年01月24日

    datamaper

  • 这段代码怎么去重复? at 2013年01月24日

    #6 楼 @Saito yeah.it's from dhh..

  • 这段代码怎么去重复? at 2013年01月24日

    dry is not always a good idea.

  • randx 加入 gitlab.com, 作为 co-founder 了. at 2013年01月24日

    #8 楼 @bhuztez 怕被监控不要上网哇.......

  • 大家看这个新闻没 at 2013年01月23日

    哪有要摧毁之前还公布出来的。

  • matz 在推特上发的个人介绍小视频 (付译文和墙内载点) at 2013年01月22日

    #7 楼 @iBachue ……

  • 真有什么手机应用都有啊 at 2013年01月22日

    是蓝朋友么...

  • 上一页
  • 1
  • 2
  • …
  • 62
  • 63
  • 64
  • 65
  • 66
  • …
  • 108
  • 109
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English