Skip to content

Instantly share code, notes, and snippets.

View lamoni's full-sized avatar

Lamoni Finlayson lamoni

  • Tesla
  • Austin, TX
View GitHub Profile
@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
@unakatsuo
unakatsuo / raw_udp4.go
Last active July 23, 2024 12:55
Send UDP packet using Linux raw socket.
// +build linux
package main
import (
"fmt"
"net"
"os"
"syscall"

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

@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"
@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:
@anand2312
anand2312 / pymongo-to-motor.md
Last active April 11, 2025 18:01
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