This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import requests | |
import json | |
import pdb | |
import time | |
from datetime import datetime | |
def fetch_issues(owner, repo, token, per_page=100): | |
url = f"https://api.github.com/repos/{owner}/{repo}/issues" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{'city': 'Abbeville', 'state': 'Louisiana'}, | |
{'city': 'Aberdeen', 'state': 'Maryland'}, | |
{'city': 'Aberdeen', 'state': 'Mississippi'}, | |
{'city': 'Aberdeen', 'state': 'South Dakota'}, | |
{'city': 'Aberdeen', 'state': 'Washington'}, | |
{'city': 'Abilene', 'state': 'Texas'}, | |
{'city': 'Abilene', 'state': 'Kansas'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib, ssl | |
port = 465 # For SSL | |
smtp_server = "smtp.gmail.com" | |
sender_email = "" # Enter your address | |
receiver_email = "" # Enter receiver address | |
cc_email = "" #Enter cc address | |
bcc_email = "" #Enter bcc address | |
password = "" # password of sender email | |
message_subject = "" # Enter subject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#path : /etc/init.d/service_name | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: myservice | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: My Service | |
# Description: Does some specific work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# path : sudo nano /lib/systemd/system/service_name.service | |
[Unit] | |
Description=Daemon Service | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/python3 /path/to/python/file/example.py | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo import MongoClient , DESCENDING , ASCENDING | |
mongo_uri = "mongodb://localhost:27017/" | |
client = MongoClient(mongo_uri) | |
db = client['medium_gist'] | |
def create_collection(customer_detail): | |
post = {"name": customer_detail["name"], | |
"Address": customer_detail["address"], | |
"items": {} | |
} |