Skip to content

Instantly share code, notes, and snippets.

View sid-r-singh's full-sized avatar
:shipit:

Sidharth R sid-r-singh

:shipit:
  • India
View GitHub Profile
#Releavant code
def run(updater):
PORT = int(os.environ.get("PORT", "8443"))
HEROKU_APP_NAME = os.environ.get("HEROKU_APP_NAME")
updater.start_webhook(listen="0.0.0.0",
port=PORT,
url_path=TOKEN)
updater.bot.set_webhook("https://{}.herokuapp.com/{}".format(HEROKU_APP_NAME, TOKEN))
2021-03-16T07:30:42.124218+00:00 heroku[web.1]: Starting process with command `python fresh_bot.py`
2021-03-16T07:30:45.862792+00:00 app[web.1]: 2021-03-16 07:30:45,862 - apscheduler.scheduler - INFO - Scheduler started
2021-03-16T07:30:46.230201+00:00 app[web.1]: 2021-03-16 07:30:46,229 - telegram.ext.updater - ERROR - Error while bootstrap set webhook: Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443
2021-03-16T07:30:46.230248+00:00 app[web.1]: 2021-03-16 07:30:46,229 - telegram.ext.updater - ERROR - Failed bootstrap phase after 0 retries (Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443)
2021-03-16T07:30:46.236940+00:00 app[web.1]: 2021-03-16 07:30:46,230 - telegram.ext.updater - ERROR - unhandled exception in Bot:1670826992:updater
2021-03-16T07:30:46.236942+00:00 app[web.1]: Traceback (most recent call last):
2021-03-16T07:30:46.236942+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 236, in _thread_wrapper
20
Procfile
web: python fresh_bot.py
requirements.txt
certifi==2020.12.5
chardet==4.0.0
idna==2.10
python-telegram-bot
2021-03-16T08:04:51.000000+00:00 app[api]: Build succeeded
2021-03-16T08:04:53.420172+00:00 app[web.1]: 2021-03-16 08:04:53,418 - apscheduler.scheduler - INFO - Scheduler started
2021-03-16T08:04:54.048348+00:00 app[web.1]: 2021-03-16 08:04:54,048 - telegram.ext.updater - ERROR - Error while bootstrap set webhook: Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443
2021-03-16T08:04:54.049035+00:00 app[web.1]: 2021-03-16 08:04:54,048 - telegram.ext.updater - ERROR - Failed bootstrap phase after 0 retries (Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443)
2021-03-16T08:04:54.062135+00:00 app[web.1]: 2021-03-16 08:04:54,049 - telegram.ext.updater - ERROR - unhandled exception in Bot:1670826992:updater
2021-03-16T08:04:54.062138+00:00 app[web.1]: Traceback (most recent call last):
2021-03-16T08:04:54.062138+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 236, in _thread_wrapper
2021-03-16T08:04:54.062140+00:00 app[web.1]
@sid-r-singh
sid-r-singh / SpotifyWhitelist
Created March 29, 2021 13:44 — forked from captainhook/SpotifyWhitelist
Spotify whitelist, Pi-hole compatible. Original source: https://github.com/x0uid/SpotifyAdBlock
# Spotify's Anti-Adveritsing blocking servers, tricking services to stop music services (DONT BLOCK THESE!):
gcdn.2mdn.net
r9---sn-n4v7kn76.c.2mdn.net
gew1-accesspoint-b-zzfg.ap.spotify.com
ns1.p23.dynect.net
ns3.p23.dynect.net
ns4.p23.dynect.net
dns1.p07.nsone.net
dns2.p07.nsone.net
dns3.p07.nsone.net
@sid-r-singh
sid-r-singh / app.py
Created May 2, 2021 11:52 — forked from nvbn/app.py
Sound lights with spotify, esp8266 and neopixel strip
from __future__ import annotations
import array
import asyncio
from bisect import bisect_left
from dataclasses import dataclass
import logging
import os
import socket
import time
@sid-r-singh
sid-r-singh / playlist.ipynb
Created May 2, 2021 11:53 — forked from nvbn/playlist.ipynb
Playlist analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
My aim: To create a serverless funcion which:
1. receives a POST request
2. forwards the same to Firebase
I didn't want to directly send data to firebase URL from my website since in that way my firebase URL will be exposed.
So I thought of creating a serverless function which can accept POST request from my endpoint/website &
then forward it to Firebase, so that in the whole process my firebase URL is not exposed anywhere.
As a summary: this function acts as an intermediate between my website & Firebase
I just wish to have one security mechanism in place in this function i.e. I check whether the request was from allowed origins or not.
---
title: Firewalld config
description: Learn how to Setup Firewalld
---
<PageDescription>
In this article you will learn how how to Setup Firewalld.
❗️ Closed issue #34 in sid-r-singh/status
🗣 Commented on #34 in sid-r-singh/status
❗️ Opened issue #34 in sid-r-singh/status
❗️ Closed issue #33 in sid-r-singh/status
🗣 Commented on #33 in sid-r-singh/status