This file contains 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 collections import defaultdict, deque | |
import pandas as pd | |
import datetime | |
import queue | |
from threading import Thread | |
import time | |
import random | |
# Data structure to store tick data for each instrument | |
candles = defaultdict(lambda: defaultdict(lambda: list)) |
This file contains 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
upstream upstream-apache2 { | |
server 127.0.0.1:8080; | |
} | |
upstream upstream-nodejs { | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen 80; |
This file contains 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 traceback | |
from itertools import cycle | |
import bs4 as bs # pip intsall bs4 | |
import re | |
import csv | |
import requests # pip intsall requests | |
import json | |
from random import randint | |
from time import sleep | |
from lxml.html import fromstring # pip intsall lxml |
This file contains 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
# -*- coding: utf-8 -*- | |
from bs4 import BeautifulSoup | |
import urllib.request | |
import urllib.parse | |
from urllib.parse import quote_plus | |
print("Enter sentence to parse from amazon\n\nExample:'Virtue signalling is society's version of Proof of Stake'\n\n") | |
query = input() |
This file contains 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
#!/bin/sh | |
set -e | |
HOST=localhost | |
DB=test-entd-products | |
COL=asimproducts | |
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" | |
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz | |
S3LATEST=$S3PATH"latest".dump.gz | |
/usr/bin/aws s3 mb $S3PATH |
This file contains 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
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
This file contains 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
upstream updateMe_dev { | |
server unix:/webapps/updateMe/run/uwsgi.sock; | |
} | |
server { | |
listen 80; | |
server_name your-IP-or-address-here; | |
charset utf-8; | |
client_max_body_size 128M; |
This file contains 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
[Unit] | |
Description=uWSGI instance to serve updateMe project | |
After=network.target | |
[Service] | |
User=bunny | |
Group=webapps | |
WorkingDirectory=/webapps/project_name/src | |
Environment="PATH=/webapps/project_name/bin" | |
ExecStart=/webapps/project_name/bin/uwsgi --ini /webapps/project_name/conf/uwsgi.ini |
This file contains 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
[uwsgi] | |
# telling user to execute file | |
uid = bunny | |
# telling group to execute file | |
gid = webapps | |
# name of project you during "django-admin startproject <name>" | |
project_name = updateMe |
This file contains 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
[uwsgi] | |
# name of project you during "django-admin startproject <name>" | |
project_name = updateMe | |
# just a directory name i use for different server deployment | |
branch = develop | |
# building base path to where project directory is present [In my case this dir is also where my virtual env is] | |
base_dir = /home/ubuntu/webapps/%(project_name)/%(branch) |