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
""" | |
There is no direct implementation of Linkedlist in Python even in 3. So we have to implement it first. | |
Please note that we have a collections.deque class but delete operation is nearly the same polynomial time bruh. | |
To get more detail on this please read here: | |
https://realpython.com/linked-lists-python/ | |
""" | |
class Node: | |
def __init__(self, data): | |
self.data = data |
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
# my global config | |
global: | |
scrape_interval: 60s # Set the scrape interval to every 15 seconds. Default is every 1 minute. | |
evaluation_interval: 60s # Evaluate rules every 15 seconds. The default is every 1 minute. | |
# scrape_timeout is set to the global default (10s). | |
# Alertmanager configuration | |
alerting: | |
alertmanagers: | |
- static_configs: |
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/bash - | |
#title :colorscale.sh | |
#description :Show a rainbow of colors. | |
#author :bgw | |
#date :20111002 | |
#version :0.1 | |
#usage :./colorscale.sh | |
#notes : | |
#bash_version :4.1.5(1)-release |
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
vim line nums | |
================ | |
set nu | |
set nonumber | |
find greater than | |
================= | |
find . -type f -size +600MB | |
.bash_profile |
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 zopsm.workers.base_jobs import BaseWorkerJobs | |
from zopsm.lib.log_handler import zlogger | |
from datetime import datetime | |
from zopsm.lib.utility import generate_uuid | |
from zopsm.lib.settings import DATETIME_FORMAT | |
from zopsm.lib.settings import CACHE_ONLINE_SUBSCRIBERS | |
from zopsm.lib.settings import CACHE_IDLE_SUBSCRIBERS | |
from zopsm.lib.settings import CACHE_STATUS |
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 falcon import HTTPBadRequest, HTTPMethodNotAllowed | |
from zopsm.lib.rest.fields import ZopsStringField, ZopsAlphaNumericStringField | |
from zopsm.lib.rest.parameters import ZopsBooleanParam | |
from zopsm.lib.rest.serializers import ZopsBaseDBSerializer | |
from zopsm.roc.validators import invite_approve_validator | |
from zopsm.lib.rest.custom import ZopsRetrieveUpdateDeleteApi, \ | |
ZopsContinuatedListCreateApi | |
from zopsm.lib.cache.subscriber_cache import SubscriberCache |
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 falcon | |
import consul | |
import os | |
from graceful.authentication import Token | |
from zopsm.lib.rest.authentication import ZopsKeyValueUserStorage | |
from zopsm.lib.rest.response_logger import ResponseLoggerMiddleware | |
from zopsm.roc.resources.banned_channel import BannedChannel, BannedChannelList | |
from zopsm.roc.resources.banned_contact import BannedContact, BannedContactList | |
from zopsm.roc.resources.channel import Channel, ChannelList | |
from zopsm.roc.resources.contact import Contact |
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 python:3.6-jessie | |
ENV LANG C.UTF-8 | |
ENV TZ=Europe/Istanbul | |
RUN apt-get update && apt-get install -y gcc musl-dev libpq-dev git libjpeg-dev zlib1g-dev libffi-dev libxml2-dev libxslt1-dev vim xfonts-75dpi xfonts-base | |
RUN pip3 install --upgrade virtualenv \ | |
&& virtualenv zarupa-venv | |
COPY entrypoint.sh /entrypoint.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
#!/bin/bash | |
. /zarupa-venv/bin/activate | |
#git clone https://github.com/kunthar/zarupa | |
pip install -r /zarupa/requirements.txt | |
pip install gunicorn | |
export FLASK_APP=/zarupa/zarupa/server.py | |
export FLASK_CONFIGURATION=production | |
export POSTGRES_USER=zarupa | |
export POSTGRES_PASSWORD= | |
export POSTGRES_HOST= |
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
version: '3' | |
services: | |
db: | |
image: postgres:12 | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgress | |
- POSTGRES_DB=postgres | |
ports: |