Skip to content

Instantly share code, notes, and snippets.


Suraj Nath electron0zero

View GitHub Profile
electron0zero /
Created Apr 22, 2021
GitHub rename master to main for local repos.

The default branch has been renamed!

master is now named main

If you have a local clone, you can update it by running:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
electron0zero /
Created Mar 6, 2021
Rails new without all the extra stuff
rails new . my-app --database=postgresql --skip-webpack-install --skip-test --skip-turbolinks --skip-javascript --skip-spring --skip-sprockets --skip-action-cable --skip-active-storage --skip-active-job --skip-action-text --skip-action-mailbox --skip-action-mailer
electron0zero / sidekiq_monitoring
Created Jul 7, 2020 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
View sidekiq_monitoring
stats =
View monitor.rb
# Copyright (c) 2014 Lukas Fittl <>
# Released in the public domain - fork as you wish.
require 'rubygems'
require 'mixlib/cli'
require 'pg'
require 'pg_query'
require 'curses'
electron0zero /
Created Jun 30, 2020
Using Logstasher in Rails

Setting Logstasher for Rails

Logstasher's tagline is Awesome Logging for Rails !!, and it does what it says.

we have been using it in prod, and it's working fine.

Our logging setup is Logstasher -> Filebeat Sidecar -> Logstash -> Elasticsearch -> Kibana

  • Logstasher for json fomatted logs
electron0zero / httparty_logger_and_debug.rb
Created Jun 16, 2020
Playing Around with httparty request logger and debug feature
View httparty_logger_and_debug.rb
require 'httparty'
require 'rails'
# Or wrap things up in your own class
class StackExchange
include HTTParty
# make sure logger is at info for HTTParty Logger to work
Rails.logger.level = 0
electron0zero /
Last active Aug 1, 2021
Dell Inspiron 15 7000 (7591) setup for linux - Ubuntu 18.04 LTS


This is guide on how to configure linux (Ubuntu 18.04 LTS) on Inspiron 15 7591 Laptop, it assumes it's already installed and running, but you want to make it better and configure

Ubuntu on Dell Inspiron 7591 - Certification Details:

Canonical have tested this device and it's suppoed to work with Linux (Fingerprint will not work due to lack of drivers from Goodix).

This system was tested with 18.04 LTS, running the 5.0.0-1016-oem-osp1 kernel, so we will run same for better experience

Product Page:

electron0zero / perf.rb
Created May 28, 2020
Perf - low overhead, dead simple way to time you code, useful when you want to time things in prod
View perf.rb
# frozen_string_literal: true
# time some code with name, and dump it in logfile
# can be used to find how much time is going in each part
# set perf markers in the code
# pros:
# - low overhead, gives high level picture
# cons:
# - needs marking
electron0zero /
Last active Jun 16, 2021
Deploy sentry-kubernetes in multiple Kubernetes (gke) clusters
electron0zero / flipper_get_all.rb
Created Apr 27, 2020
Getting things from flipper with Active Recrod backend
View flipper_get_all.rb
# flipper with ActiveRecord backend, taken from
# get all features
ap Flipper::Adapters::ActiveRecord::Feature.all
# get all actors which have a feature enabled
feature_name = "scope_by_tag_group.pg_lookup"
ap Flipper::Adapters::ActiveRecord::Gate.where(feature_key: feature_name)