Skip to content

Instantly share code, notes, and snippets.

View electron0zero's full-sized avatar
🎯
Focusing

Suraj Nath electron0zero

🎯
Focusing
View GitHub Profile
@electron0zero
electron0zero / convert_go-kit_slog.bash
Created October 25, 2024 13:26 — forked from tjhop/convert_go-kit_slog.bash
Convert go-kit/log to slog calls
#!/usr/bin/env bash
#
# License: Apache-2.0
#
# Description: Convert go-kit/log to slog calls
#
# Authors:
# - Ben Kochie (@superq)
# - TJ Hoplock (@tjhop)
#
@electron0zero
electron0zero / bloom.go
Created August 9, 2024 22:37
Read some blooms in golang using "github.com/willf/bloom" and dump them into stdout, only tested for bloom created using "github.com/willf/bloom"
package main
import (
"encoding/json"
"fmt"
"os"
"github.com/willf/bloom"
)
@electron0zero
electron0zero / bench_object_store.md
Last active December 5, 2023 07:55
Benchmarking Object Store with Minio Wrap

This test is done aginst a local instace of Minio, running on my laptop (Intel® Core™ i7-10510U CPU @ 1.80GHz × 8, Linux x1-carbon 6.2.0-37-generic x86_64 GNU/Linux)

wrap can be found at https://github.com/minio/warp

Benchmarking Object Store

Mixed benchmark

$ warp mixed --host=127.0.0.1:9000 --access-key=$MINIO_KEY --secret-key=$MINIO_SEC --autoterm --bucket=test
@electron0zero
electron0zero / dell-D6000-dock-ubuntu.md
Last active September 19, 2023 17:24 — forked from noahp/dell-D6000-dock-ubuntu.md
Dell Universal Dock D6000 on ubuntu - Updated Sep 19, 2023
@electron0zero
electron0zero / README.md
Created April 22, 2021 12:15
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
electron0zero / rails-new.sh
Created March 6, 2021 16:32
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
electron0zero / sidekiq_monitoring
Created July 7, 2020 12:27 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
# Copyright (c) 2014 Lukas Fittl <[email protected]>
#
# Released in the public domain - fork as you wish.
require 'rubygems'
require 'mixlib/cli'
require 'pg'
require 'pg_query'
require 'curses'
@electron0zero
electron0zero / README.md
Created June 30, 2020 13:37
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
electron0zero / httparty_logger_and_debug.rb
Created June 16, 2020 11:01
Playing Around with httparty request logger and debug feature
# https://frontdeveloper.pl/2018/10/how-to-log-httparty-requests/#easy-footnote-3-298
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