Skip to content

Instantly share code, notes, and snippets.

View restebanez's full-sized avatar

Rodrigo Estebanez restebanez

  • mailpoet/automattic
  • Maspalomas
View GitHub Profile
@qistoph
qistoph / awk_netstat.sh
Created August 6, 2020 07:55
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Based on gist https://gist.github.com/staaldraad/4c4c80800ce15b6bef1c1186eaa8da9f
# - added TCP states
awk 'BEGIN{states["01"]="TCP_ESTABLISHED"
states["02"]="TCP_SYN_SENT"
states["03"]="TCP_SYN_RECV"
states["04"]="TCP_FIN_WAIT1"
states["05"]="TCP_FIN_WAIT2"
states["06"]="TCP_TIME_WAIT"
states["07"]="TCP_CLOSE"
@bobrik
bobrik / README.md
Last active March 27, 2025 02:16
CFS hiccups
@tyrell
tyrell / docker-install-rpi3.md
Last active January 8, 2026 12:50
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/

@restebanez
restebanez / Understanding JSON Web Tokens
Last active November 24, 2016 16:15
Understanding JSON Web Tokens (JWT)
# Understanding JSON Web Tokens (JWT)
## Decoding a JWT
A JWT is formed of three parts separated by a dot: header, payload and signature.
let's explore a real one from a curl request:
>curl -H"authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc3NWMyYzkwY2JhNzQxMTg3YjhkOTdkY2NiYmIwNGU3MGNlZmVjYzQifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA0MzE5Mzg0OTgxOTM0ODUzODA5IiwiYXpwIjoiNTYyMjgyODc2NjIyLWFqOGdpbWc1M3JmNWcydXYxMzliZG80dmUwdHFudDRnLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJyZXN0ZWJhbmV6QG1kc29sLmNvbSIsImF0X2hhc2giOiJlb3R1R0hvZTloYTZjbHAtZFowMEp3IiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF1ZCI6IjU2MjI4Mjg3NjYyMi1hajhnaW1nNTNyZjVnMnV2MTM5YmRvNHZlMHRxbnQ0Zy5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImhkIjoibWRzb2wuY29tIiwiY19oYXNoIjoiVnRpdUFrbUZBT0JsMXlrT3VyZmltZyIsImlhdCI6MTQyOTc5MTAyMSwiZXhwIjoxNDI5Nzk0NjIxfQ.ivITFQ0BAmWUviY4f_MH2srMFrH1xZM6qFqcN5XZrC9WiidGhpjLMBYIBFH0eBuyRRt_U1GxR4Ko33ivF4jlqDQegcBNWQvbI5uStMk60Nu8w0_YbSr25b_7_pgt0kFrnSKEA_wTlTHhZK2oYJVbvCFAed_qETS-i74-ftXyZ3k" http://localhost:
@restebanez
restebanez / identify javascript types
Last active November 24, 2016 16:15
JavaScript types identification is not straight forward. This gist checks every possible type including primitives and references built-in types
/* Primitive types:
Boolean true or false
Number Any integeror floating-point numeric value
String A character or sequence of characters delimited by either single or double quotes
Null A primitive type that has only one value, null
Undefined A primitive type that has only one value, undefined (undefined is the value assigned to a variable that is not initialize)
*/
/* Primitive Wrapper Types
@speric
speric / poodir-notes.md
Last active March 25, 2025 01:06
Notes From "Practical Object-Oriented Design In Ruby" by Sandi Metz

Chapter 1 - Object Oriented Design

The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.

SOLID Design:

  • Single Responsibility Principle: a class should have only a single responsibility
  • Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
  • Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.