Skip to content

Instantly share code, notes, and snippets.

View obahareth's full-sized avatar
🧉
In the Zone

Omar Bahareth obahareth

🧉
In the Zone
View GitHub Profile
@czj
czj / Gemfile
Last active August 28, 2022 09:06
Outputting Rails app logs to Logz.io via logstash
gem "lograge"
gem "logstash-event"
gem "logstash-logger"
@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active March 12, 2024 22:46
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@lirantal
lirantal / terminal-with-powerline.sh
Last active December 2, 2022 09:19
Hyper terminal + Powerline 9k terminal theme for oh-my-zsh
# Use hyper.is or iTerm2 as terminal emulators
# Install ohmyzsh
# https://github.com/robbyrussell/oh-my-zsh
# Copy over configs from ~/.bash_profile
# For example, it may have the nvm setup or any aliases like exa=ls and cat=bat
# ~/.hyper.js configuration:
copyOnSelect: true
@baweaver
baweaver / ruby_books.md
Last active April 24, 2024 19:24
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

@itod
itod / split_keyboards.md
Last active April 25, 2024 16:26
Every "split" mechanical keyboard currently being sold that I know of

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@goncalvesjoao
goncalvesjoao / Gemfile
Last active November 13, 2020 01:52
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@aspyatkin
aspyatkin / generate_csr.rb
Last active October 7, 2023 18:20
Generate X509 CSR with SAN extension in Ruby
require 'openssl'
# Generate X509 CSR (certificate signing request) with SAN (Subject Alternative Name) extension and sign it with the RSA key
def generate_csr(common_name, organization, country, state_name, locality, domain_list)
# create signing key
signing_key = OpenSSL::PKey::RSA.new 2048
# create certificate subject
subject = OpenSSL::X509::Name.new [
['CN', common_name],
@drmalex07
drmalex07 / README-container-as-systemd-service.md
Last active March 17, 2024 07:42
Wrap a docker container in a systemd service. #docker #systemd.service #systemd #cgroups

README

Suppose we want to wrap a container running a Redis instance as a service.

Override unit file for docker daemon

We must override the service unit file that ships with docker (under /lib/systemd/system) in order to pass some cgroup-related options to the docker daemon. So, following the usual method to override parts of a unit file, we create the file /etc/systemd/system/docker.service.d/10-service.conf with contents: