Skip to content

Instantly share code, notes, and snippets.

View rednafi's full-sized avatar
🏠
Working from home

Redowan Delowar rednafi

🏠
Working from home
View GitHub Profile
@Dev-Dipesh
Dev-Dipesh / rabbitmq_notes.md
Last active May 5, 2024 02:09
Why RabbitMQ is better over Redis and notes on RabbitMq.

Redis is Database whereas RabbitMQ was designed as a message router or message-orientated-middleware (mom), so I'm sure if you look for benchmarks, you'll find that RabbitMQ will outperform Redis when it comes to message routing.

RabbitMQ is written in Erlang which was specifically designed by the telecom industry to route messages, you get clustering out of the box due to it being written in Erlang which means in a clustered environment, RabbitMQ will outperform Redis even further.

Furthermore, you get guaranteed delivery of messages due to the AMQP protocol, in other words, if the network drops while consuming the message, the consumer won't be able to say thanks for the message, so the consumer will drop the message and Rabbit will requeue the message, if you publish a message and the queue didn't say thanks to the publisher due to network problems or timeouts, Rabbit will drop the message and the publisher will keep on trying to publish the message. You can have publish retries with backoff policies, so

@pierre-b
pierre-b / config.fish
Created March 6, 2017 10:03
golang fish shell config
# config file
# vim ~/.config/fish/config.fish
# reload the config
# source ~/.config/fish/config.fish
# set the workspace path
set -x GOPATH /users/my-username/go
# add the go bin path to be able to execute our programs
@nikhita
nikhita / update-golang.md
Last active April 27, 2024 13:09
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@Kalimaha
Kalimaha / proxy.py
Last active January 29, 2024 17:05
Simple Proxy server in Python
import time
from threading import Thread
try:
import socketserver as SocketServer
import http.server as SimpleHTTPServer
except ImportError:
import SocketServer
import SimpleHTTPServer
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 10, 2024 06:00
set -e, -u, -o, -x pipefail explanation
@0xpizza
0xpizza / async_tcp_scan.py
Last active November 20, 2021 15:25
TCP Network scanner using asyncio for Python 3.7
#!/usr/bin/python3.7
import asyncio
import ipaddress
import re
import sys
MAX_NUMBER_WORKERS = 200
@skrawcz
skrawcz / PyBayFormatter.py
Last active October 8, 2021 22:46
JSON Structured Logger
import json
import logging
import sys
logger = logging.getLogger(__name__)
class PyBayFormatter(logging.Formatter):
"""Implementation of JSON structured logging that works for most handlers."""
@2minchul
2minchul / proxy.py
Created October 29, 2019 07:48
Python HTTPS proxy server with asyncio streams
import asyncio
import re
from asyncio.streams import StreamReader, StreamWriter
from contextlib import closing
from typing import Tuple, Optional
import async_timeout
StreamPair = Tuple[StreamReader, StreamWriter]
@Bobmajor
Bobmajor / gist:319e89e9c876cccdb1b77f1783e9a820
Created April 25, 2020 16:06
HOW TO INSTALL POSTMAN ON LINUX WITHOUT SNAP
1. Go to the Postman app download page at https://www.getpostman.com/apps. You can choose the os version from the drop-down. x64 for 64 bit Operating System and x84 for the 32 bit based Linux
2. Open the terminal and go to the directory where you have downloaded the tar file. If you have downloaded on the Downloads folder
cd ~/Downloads/
3. Run the following commands,
sudo rm -rf /opt/Postman/
@gvx
gvx / transform_decorator.py
Created May 18, 2020 13:21
metadecorators to construct decorators that only transform function arguments or return values
from functools import wraps, partial
def transform_return(transformation, decorated=None):
if decorated is None:
return partial(transform_return, transformation)
@wraps(decorated)
def wrapper(*args, **kwargs):
return transformation(decorated(*args, **kwargs))
return wrapper