Skip to content

Instantly share code, notes, and snippets.

View lamoni's full-sized avatar

Lamoni Finlayson lamoni

  • Tesla
  • Austin, TX
View GitHub Profile
@anand2312
anand2312 / pymongo-to-motor.md
Last active April 23, 2024 06:59
pymongo vs Motor

pymongo vs Motor

Motor is an async Python driver for MongoDB.

When should I use Motor?

You should use Motor when you're trying to interact with a MongoDB database in an asynchronous context. When you're making something that needs to be asynchronous (like a web server, or most commonly from what I've seen here, Discord bots), you also want all the database calls to be done asynchronously. But pymongo is synchronous, i.e it is blocking, and will block the execution of your asynchronous program for the time that it is talking to the database.

Okay, How do I switch now?!

Thankfully for us, switching from pymongo to Motor isn't too hard, and won't need you to change much code. This process can be roughly summarized as:

Step 1: Install Motor, and import it

Installing can be done with pip - pip install motor

@KireinaHoro
KireinaHoro / snmp.yml
Last active February 10, 2022 08:12
snmp_exporter config for Geist (Vertiv) IMD PDUs
# WARNING: This file was auto-generated using snmp_exporter generator, manual changes will be lost.
geist_imd:
walk:
- 1.3.6.1.4.1.21239.5.2.3
metrics:
- name: pduMainIndex
oid: 1.3.6.1.4.1.21239.5.2.3.1.1.1
type: gauge
help: Table entry index value - 1.3.6.1.4.1.21239.5.2.3.1.1.1
indexes:
@eycorsican
eycorsican / rawudp.go
Created June 24, 2019 23:57 — forked from chrisnc/rawudp.go
constructing ip/udp packets in go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"

Tcpdump

Tcpdump is a commandline tool that is used to dump traffic on a network. This tool comes in hand when you want to analyse network captures within the command line. Basically it can do most of the wireshark job.

NOTE This guide might not be complete it just serve as a reference to me.

Additional Note & Reference

@unakatsuo
unakatsuo / raw_udp4.go
Last active April 17, 2024 12:51
Send UDP packet using Linux raw socket.
// +build linux
package main
import (
"fmt"
"net"
"os"
"syscall"
@avullo
avullo / push_file_to_github_repo_branch.py
Created November 13, 2017 20:18
Push file update to GitHub repository using GitHub API in Python
import requests
import base64
import json
import datetime
def push_to_repo_branch(gitHubFileName, fileName, repo_slug, branch, user, token):
'''
Push file update to GitHub repo
@StevenACoffman
StevenACoffman / _MicroService Proxy Gateway Solutions.md
Last active September 28, 2023 14:54
Microservice Proxy/Gateway Solutions

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@vxgmichel
vxgmichel / udpproxy.py
Created February 2, 2017 10:05
UDP proxy server using asyncio
"""UDP proxy server."""
import asyncio
class ProxyDatagramProtocol(asyncio.DatagramProtocol):
def __init__(self, remote_address):
self.remote_address = remote_address
self.remotes = {}
@chrisnc
chrisnc / rawudp.go
Last active February 9, 2024 15:29
constructing ip/udp packets in go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
@leonjza
leonjza / netcat.py
Last active July 30, 2023 16:28
Python Netcat
import socket
class Netcat:
""" Python 'netcat like' module """
def __init__(self, ip, port):
self.buff = ""
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)