Ruby Tutorials for Serious Ruby Developers

Become a Better Ruby Developer guide

Would you like to improve your Ruby skills?

Then grab your FREE Become a Better Ruby Developer guide while you are here :) This guide contains actionable tips & resources you can start using right now!

Get the free guide

Check Out the Latest Articles:

Black Bytes is the blog of Jesus Castello, focused on helping you become a better Clinica Stomatologie Bucuresti curs valutar Otel Beton Psiholog Cluj Ruby developer with easy to understand tutorials & great content. Below you will find all 85 articles, newest first, from Ruby internals to Linux and security.

Hash Tables Explained

Feb 06, 2017 · Programming

One of my favorite data structures is the hash table because it’s simple & powerful. You probably have used it before since it’s an efficient way to store key-value pairs.…

Read More

How To Spy on Your Ruby Methods

Jan 03, 2017 · Programming

Ruby has a built-in tracing system which you can access using the class. Some of the things you can trace are method calls, new threads & exceptions. Why would you…

Read More

9 New Features in Ruby 2.4

Dec 06, 2016 · Programming

It has become a tradition to release new Ruby versions on Christmas. And in this post I want to cover some of the most interesting changes in the next version…

Read More

Code Analysis: Minitest

Nov 07, 2016

As you may know, Minitest is the default testing library for Rails & DHH’s favorite. Some people prefer it for its simplicity and how little code it has compared to…

Read More

Build Your Own Web Server

Aug 10, 2016

Have you ever built your own web server? I think this is a great learning exercise & in this post you will learn how to do this, step-by-step! So where…

Read More

Ruby Ranges: How Do They Work?

Jun 14, 2016

Have you ever wondered how ranges work in Ruby? Even if you haven’t, isn’t it fun to discover how things work under the hood? That’s exactly what I’m going to…

Read More

How to Generate Weighted Random Numbers

May 03, 2016 · Programming

Random numbers usually follow what we call a ‘uniform distribution’, meaning that there is the same chance that any of the numbers is picked. But if you want some numbers…

Read More

Metaprogramming in The Wild

Apr 11, 2016

You may have read about Ruby metaprogramming before & maybe you have used it in some of your projects, but how are some of the most popular open-source projects making…

Read More

My New Favorite Enumerable Method

Mar 07, 2016 · Programming

Enumerable is an amazing module, and it’s a big part of what makes Ruby such a great programming language. Enumerable gives you all sorts of cool methods like , and…

Read More

Exploring MRI Source Code

Feb 16, 2016

If you have been using Ruby for a while you are probably curious about how some things work under the hood. One way to dig deep into Ruby internals is…

Read More

Ruby Time & Date Classes

Dec 15, 2015

If you want to do anything related with time you probably want to use some sort of class that can store and work with this type of data. In this…

Read More

Introduction to Refactoring

Dec 01, 2015 · Programming

If you aren’t familiar with the term, refactoring is the act of improving the quality of code without changing what it does. This will make your code a lot easier…

Read More

The Many Uses Of Ruby Case Statements

Oct 19, 2015 · Programming

Whenever you need to use some statements you could consider using a Ruby case statement instead. In this post, you will learn a few different use cases and how it…

Read More

Working with APIs

Sep 30, 2015

APIs are great because they let you interact with other applications, but they can be a bit intimidating if you never used one before. In this post I will show…

Read More

Recursion and Memoization in Ruby

Aug 17, 2015 · Programming

Have you ever wondered if there is an alternative to iteration? Well I have good news for you: there is, and it’s called recursion. Recursive functions are those that keep…

Read More

Static Analysis in Ruby

Aug 02, 2015 · Programming

If you want to know something about your source code, like the name and line number of all your methods, what do you do? Your first idea might be to…

Read More

Debugging your Ruby Programs

Jul 12, 2015 · Programming

How often does your program do exactly what you want the first time around? Many times our programs won’t work like you expect, so we have to use the art…

Read More

Using Ruby Threads

Jul 06, 2015

Using ruby threads you can make your applications do multiple things at the same time, making them faster. In MRI (Matz’s Ruby Interpreter) you will only benefit from threads in…

Read More

Mastering Ruby Regular Expressions

Jun 22, 2015 · Programming

Ruby regular expressions ( ruby regex for short) help you find specific patterns inside strings, with the intent of extracting that data for further processing. Two common use cases for…

Read More

Using Struct and OpenStruct

Jun 08, 2015 · Programming

Sometimes you just want an object that can store some data for you, the struct class is very useful in that situation. To create our Struct we pass in a…

Read More

Working with files and folders

May 24, 2015

Data processing is a common task in programming. Data can come from many places: files, network, database, etc. In this post you will learn how to work with files and…

Read More

Mastering Ruby Arrays

May 06, 2015 · Programming

Ruby arrays are a fundamental data structure that is used to store data in memory. Inside a Ruby array you can store anything you want, from strings to integers and…

Read More

Ruby Network Programming

Apr 28, 2015 · Networking

Do you want to create custom network clients and servers? Or just understand how that works? Then you will have to deal with sockets. Join me on this tour of…

Read More

Jquery tips & tricks

Apr 15, 2015

If you have done any web work at all you have probably used jQuery. Let’s go over some jQuery tips that you may find useful. A very common use for…

Read More

How to build a parser with Ruby

Apr 07, 2015

Parsing is the art of making sense of a bunch of strings and converting them into something we can understand. You could just use regular expressions, but they are not…

Read More

Random Numbers and Strings in Ruby

Mar 14, 2015

Randomness can make things more interesting in games or it can help make your sites more secure. In Ruby, there are multiple ways to generate random numbers with various properties.…

Read More

Life of a web request

Mar 01, 2015 · Networking

Every time you click on a link or directly type an address, a number of steps have to happen for the site to show on your screen. It may be…

Read More

Performance analysis with perf

Feb 21, 2015 · Linux

Is Apache or some other process using most of your CPU but you have no idea why? I have the solution for you! Linux has some low-level troubleshooting tools that…

Read More

MySQL – Slow query analysis

Jul 25, 2014

Ever wonder why your application is slow? Then there is a good chance you got slow queries! In this post, you will learn how to enable the slow query log…

Read More

PHP: Top command-line options

Jun 23, 2014

Here are some useful php command line options that you will love. Ever wanted to test a quick snippet of code without having to save it to a file and…

Read More

Redis – the blazing fast datastore

May 01, 2014 · Programming

In the sea of NoSQL databases Redis stands out thanks to its speed and features, it can work as a cache or as a persistent database. Redis stores data in…

Read More

Watching your network

Mar 29, 2014 · Linux, Networking, Security

There is a number of tools you can use in Linux to see what is going on your machine at the network level, one of the most common is netstat…

Read More

The Windows Commandline: Services

Jan 22, 2014 · Uncategorized

Ever wanted to manipulate windows services from the command line (cmd.exe)? Now you can if you read this blog post :) To get us started the first thing is to…

Read More

Data exfiltration from the CLI

Dec 29, 2013 · Networking, Security

If you do pentesting or any kind of security analysis you probably found yourself in the situation of needing to transfer data between your machine and the vulnerable machine. It…

Read More

Bash expansions

Nov 30, 2013 · Linux

In this post you will learn about bash expansions, you probably already used them if you have done something like “ls *.txt”. Basically the shell does some processing on the…

Read More

Wireshark: Quick tips

Oct 10, 2013 · Networking

Do you want to learn some new tricks to make your Wireshark experience better? You have come to the right place, let’s get going! To get a sense of the…

Read More

Network forensics with tshark

Sep 15, 2013 · Security

Let’s say we have a packet capture file (.pcap) and we want to get as much information out of it as possible. One option could be wireshark and its command…

Read More

Nmap: beyond the basics

Jul 27, 2013 · Networking, Security

You probably have used nmap before, but did you know there are plenty of cool options to spice up your scanning sessions? For example, you can specify the –open option…

Read More

Finding windows host on your network

Jul 18, 2013 · Networking

If you ever wondered if there is a quick way to find all the Windows host in your network with exact version information, you are in the right place! We…

Read More

The /proc filesystem

May 28, 2013 · Linux

Have you ever heard of the /proc filesystem before? I’m pretty sure you have if you are a regular Linux user. Here is a quick refresher. /proc is a virtual…

Read More

Linux: Process management

Apr 07, 2013 · Linux

Have you ever come across a miss-behaving process? In this post I will share how you can keep your system under control effectively. If we don’t know the name of…

Read More

Dynamic Arrays in C – part 2

Feb 27, 2013

In the first part we left off laying the foundations for our dynamic array. Now it’s time to test it, this is the code responsible for that: We define a…

Read More

Dynamic Arrays in C – part 1

Feb 03, 2013

While working on my C programming skills I wrote a small program to simulate the functionality of dynamic arrays on other languages. That is arrays that grow as you add…

Read More

Troubleshooting with lsof

Jan 22, 2013 · Linux

Lsof is a standard Linux utility that can help you troubleshoot a range of issues related to open files. If you run it without any options it will display ALL…

Read More

Sorting Java Collections

Dec 04, 2012 · Programming

Java collections are most of the data structures that come with the language. They share the same basics methods thanks to the collection interface. One of the most common things…

Read More

Column formatting

Nov 23, 2012

Here is a quick tip on how to make the output of some tools prettier, for example we can use the mount command which by default looks like this: Using…

Read More

PHP Arrays

Sep 28, 2012

This is an introduction to PHP arrays, so if you are new to the language or you just need a refresher you can get up to speed pretty fast. This…

Read More

SQLite basics

Aug 20, 2012 · Programming

SQLite is a serverless relational database. It is used notably by modern browsers like Chrome and Firefox to store data like history, cookies, saved passwords… We are going to see…

Read More

Java: Regular Expressions

Aug 11, 2012

Regular expressions, regexp for short, allow us to build expressions for pattern matching. If you aren’t familiar with them you may want to check out some resources here. In Java…

Read More

Socat: A very powerful networking tool

Jul 09, 2012

Welcome to this socat tutorial. Socat is a network utility similar to netcat. Socat supports ipv6 and ssl and is available for both windows and linux. The first thing you…

Read More

Ruby tracing – A useful debugging tool

Jun 02, 2012 · Programming

Tracing is following all the steps taken by a program, specially function calls/methods, this can be a useful debugging tool when tracking down some problems with your application. In Ruby…

Read More

Wireshark: Auto-start capturing

May 23, 2012 · Networking

Most of the time when you open wireshark you will want to start capturing right away. You can pass some flags to wireshark so it starts capturing as soon as…

Read More

Squashing spaces

May 15, 2012

If we want to remove extra spaces in a text like this: You could be tempted to use sed, but there is a simpler way using tr And we end…

Read More

Analysis of a backdoored Web shell

May 01, 2012 · Security

I frequent the elearnsecurity student forums, an one of the common questions is about webshells and it ends up with a link to backdoored scripts. Here is my quick analysis…

Read More

Alphanumeric sorting

Apr 20, 2012

Time for a bit more sorting. Today our task is to sort an array of file names based on the numeric value. This what the array looks like: If you…

Read More

Ruby: fine grained sorting

Mar 13, 2012 · Programming

Ruby sorting is really easy, lets see some examples. If we had this array: sorting normally we would get: Let’s say we wanted to sort by the second letter, we…

Read More

Beyond Bash

Mar 04, 2012 · Linux

If you use Linux you are probably using the bash shell, but turns out there is life beyond bash! When using aptitude or apt-get I’m sure you tried this at…

Read More

Ruby vs Java – Strings

Feb 25, 2012

Let’s see how we can do some basic operations with strings with 2 languages, starting with how we declare a string variable. This is Ruby vs Java! As you may…

Read More

CLI ninja: Ping Sweep

Feb 20, 2012 · Linux, Security

Ever wanted to do a ping sweep in this new network you just broke in but you don’t want (or can’t, for some reason, AVs etc…) to upload any tools?…

Read More

Linux: Monitoring resources – CPU

Feb 02, 2012 · Linux

In this post on the Linux resources series we are going to talk about monitoring our CPU usage. When everything slows down this might be a good first suspect to…

Read More

Intro to Awk

Jan 20, 2012 · Linux

Awk is the ideal tool for most of your output processing/formatting needs, we can use it to carefully select and reformat data fields from stdin or a file and even…

Read More

Four ways to extract files from pcaps

Jan 16, 2012

It’s time to extract files from pcaps. If you ever played with packet captures you probably thought it would be cool that you could actually get downloaded files so let’s…

Read More

Parsing HTML in Ruby

Jan 15, 2012

If you ever tried to write a scrapping tool you probably had to deal with parsing html. This task can be a bit difficult if you don’t have the right…

Read More

Ruby String Formatting

Jan 14, 2012

Let’s talk about how you can format strings in ruby. Why would you want to format a string? Well, you may want to do things like have a leading zero…

Read More

Popular posts