A love letter to Objective-C
https://thoughtbot.com/blog/a-love-letter-to-objective-c [thoughtbot.com]
2023-07-21 21:18
tags:
intro-programming
objc
ruby
The nature of software is to always be evolving. COBOL jokes aside, it’s rare to find programming frameworks that reach a level of maturity and support that allow them to just exist without being supplanted by a newer language or a better abstraction. Which naturally is great. Who wants to find themselves writing software with the expectations of today while performing the tasks of manual memory management or manipulating strings that are just raw pointers in a block of memory terminating with a null (\0) character? But sometimes in this constantly evolving space, you find a framework that resonates, and you hold on to it tightly. I wanted to share how this happened for me, first with Ruby (no surprise) but then oddly with Objective-C.
source: L
Bypassing GitHub's OAuth flow
https://blog.teddykatz.com/2019/11/05/github-oauth-bypass.html [blog.teddykatz.com]
2019-11-07 23:14
tags:
auth
exploit
ruby
security
turtles
web
What happens if we send an authenticated HEAD request to https://github.com/login/oauth/authorize? We’ve concluded that the router will treat it like a GET request, so it will get sent to the controller. But once it’s there, the controller will realize that it’s not a GET request, and so the request will be handled by the controller as if it was an authenticated POST request. As a result, GitHub will find the OAuth app specified in the request, and grant it access to the authenticated user’s data.
Help me, framework!
source: HN
Benchmarking Fibers, Threads and Processes
http://engineering.appfolio.com/appfolio-engineering/2019/9/13/benchmarking-fibers-threads-and-processes [engineering.appfolio.com]
2019-09-19 19:37
tags:
benchmark
concurrency
perf
programming
ruby
Awhile back, I set out to look at Fiber performance and how it’s improved in recent Ruby versions. After all, concurrency is one of the three pillars of Ruby 3x3! Also, there have been some major speedups in Ruby’s Fiber class by Samuel Williams.
It’s not hard to write a microbenchmark for something like Fiber.yield. But it’s harder, and more interesting, to write a benchmark that’s useful and representative.
source: L
Weird Ruby: Positive and Negative Strings
https://metaredux.com/posts/2019/05/10/weird-ruby-positive-and-negative-strings.html [metaredux.com]
2019-05-10 15:29
tags:
intro-programming
ruby
Turns out that when frozen string literals were introduced in Ruby 2.3 a couple of unary methods were added to the String class - namely unary + and -. They made it possible to have “positive” and “negative” string literals. What does this mean exactly? Let’s figure this out together!
source: L
Ruby 2.7 — Numbered Parameters
https://medium.com/@baweaver/ruby-2-7-numbered-parameters-3f5c06a55fe4 [medium.com]
2019-03-22 22:46
tags:
beta
ruby
update
Ruby 2.7 is coming out this December, as with all modern releases, but that doesn’t stop us from looking for and writing about all the fun things we find in the mean time! No no no. For this article, we have something that’s very reminiscent of Bash, Perl, and Scala: Numbered parameters.
source: L
Analysis for CVE-2019-5418 File Content Disclosure on Rails
https://chybeta.github.io/2019/03/16/Analysis-for【CVE-2019-5418】File-Content-Disclosure-on-Rails/ [chybeta.github.io]
2019-03-21 10:47
tags:
exploit
programming
ruby
security
turtles
web
What causes Ruby memory bloat?
https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html [www.joyfulbikeshedding.com]
2019-03-15 00:42
tags:
c
investigation
malloc
perf
programming
ruby
systems
visualization
If only there is a way visualize the OS heaps so that I can see what’s going. Unfortunately there are no tools that allow me to do that. So I wrote an OS heap visualizer myself.
source: L
Ruby 2.6.0 Released
https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/ [www.ruby-lang.org]
2018-12-27 17:36
tags:
jit
release
ruby
It introduces a number of new features and performance improvements, most notably:
A new JIT compiler.
The RubyVM::AbstractSyntaxTree module.
The JIT compiler aims to improve the performance of Ruby programs. Unlike traditional JIT compilers which operate in-process, Ruby’s JIT compiler writes out C code to disk and spawns a common C compiler to generate native code. For more details about it, see the MJIT organization by Vladimir Makarov.
Ruby 2.6 introduces the RubyVM::AbstractSyntaxTree module. Future compatibility of this module is not guaranteed. This module has a parse method, which parses the given string as Ruby code and returns the AST (Abstract Syntax Tree) nodes of the code. The parse_file method opens and parses the given file as Ruby code and returns AST nodes.
Ruby 2.x Universal RCE Deserialization Gadget Chain
https://www.elttam.com.au/blog/ruby-deserialization/ [www.elttam.com.au]
2018-11-09 04:20
tags:
exploit
format
library
programming
ruby
security
turtles
This blog post details exploitation of arbitrary deserialization for the Ruby programming language and releases the first public universal gadget chain to achieve arbitrary command execution for Ruby 2.x. This will be described in the following sections which detail deserialization issues and related work, discovery of usable gadget chains, and finally exploitation of ruby serialization.
source: HN
Summer School With The Rust Compiler
http://patshaughnessy.net/2018/10/24/summer-school-with-the-rust-compiler [patshaughnessy.net]
2018-10-25 20:37
tags:
intro-programming
ruby
rust
Not sure if I learned more about rust or ruby here.
Rust is telling me that iter() yielded references to integers, but my code expected an actual integer, not a reference to an integer.
Now the array was mutated! It turns out Ruby passed integers to the closure by value, but strings by reference. Updating each string inside the loop also updated that string inside the array.
I managed to be surprised by both those statements.
Spying on a Ruby process's memory allocations with eBPF
https://jvns.ca/blog/2018/01/31/spying-on-a-ruby-process-s-memory-allocations/ [jvns.ca]
2018-02-04 03:32
tags:
investigation
linux
malloc
programming
ruby
swtools
My idea at the beginning of the day was – what if you could take an arbitrary Ruby process’s PID (that was already running!) and start tracking its memory allocations?
source: L
Reducing Memory Usage in Ruby
https://tenderlovemaking.com/2018/01/23/reducing-memory-usage-in-ruby.html [tenderlovemaking.com]
2018-01-24 01:03
tags:
garbage-collection
programming
ruby
I’ve been working on building a compacting garbage collector in Ruby for a while now, and one of the biggest hurdles for implementing a compacting GC is updating references. For example, if Object A points to Object B, but the compacting GC moves Object B, how do we make sure that Object A points to the new location?
source: HN
Malloc Can Double Multi-threaded Ruby Program Memory Usage
https://www.speedshop.co/2017/12/04/malloc-doubles-ruby-memory.html [www.speedshop.co]
2017-12-04 18:48
tags:
garbage-collection
malloc
programming
ruby
The problem manifests itself as a slow, creeping memory growth in Ruby processes. It is often mistaken for a memory leak. However, unlike a memory leak, memory growth due to fragmentation is logarithmic, while memory leaks are linear.
This starts off with a simpe problem and fix, but lots of info about what’s happening.
source: L
Memory Conscious Programming in Ruby
https://gettalong.org/blog/2017/memory-conscious-programming-in-ruby.html [gettalong.org]
2017-11-03 18:47
tags:
intro-programming
malloc
ruby
When programming in Ruby many people think that egregious memory usage is the norm and unavoidable. However, there are ways and strategies to keep memory usage down and in this post I will show you some of them.
source: L
Splitting Strings
https://chriszetter.com/blog/2017/10/29/splitting-strings/ [chriszetter.com]
2017-11-02 02:58
tags:
library
programming
python
ruby
Most modern programming languages have a function somewhere in their standard library for splitting strings.
What should it return?
source: L
Diploid and Crystal
https://crystal-lang.org/2017/10/27/diploid-and-crystal.html [crystal-lang.org]
2017-10-30 13:49
tags:
development
interview
programming
ruby
At Diploid, we have been using Crystal for quite some time now. We would like to share our experience in this interview, answering questions relevant to companies wanting to use Crystal for production.
source: HN
Why Ruby app servers break on macOS High Sierra and what can be done about it
https://blog.phusion.nl/2017/10/13/why-ruby-app-servers-break-on-macos-high-sierra-and-what-can-be-done-about-it/ [blog.phusion.nl]
2017-10-19 13:55
tags:
bugfix
concurrency
mac
objc
programming
ruby
Remote Code Execution on rubygems.org
https://justi.cz/security/2017/10/07/rubygems-org-rce.html [justi.cz]
2017-10-10 18:11
tags:
exploit
format
ruby
security
turtles
web
I was surprised to learn that parsing untrusted YAML is dangerous. I had always figured it was a benign interchange format like JSON. In fact, YAML allows for the encoding of arbitrary objects, much like python’s pickle.
source: L
Strange Hash Instances in Ruby
https://kate.io/blog/strange-hash-instances-in-ruby/ [kate.io]
2017-10-02 01:26
tags:
hash
programming
ruby
Everything can be patched, except the things that cant.
source: danluu
Accidentally Quadratic: Ruby `reject!`
http://accidentallyquadratic.tumblr.com/post/157496054437/ruby-reject [accidentallyquadratic.tumblr.com]
2017-02-20 23:08
tags:
compsci
perf
programming
ruby
turtles
I find this interesting as a cautionary tale of how several of Ruby’s features (here, ubiquitous mutability, blocks, and nonlocal exits) interact to create suprising edge cases that need to be addressed, and how addressing those edge cases can easily result in yet more problems
source: L