- Google Cloud Platform with Billing enabled.
- Bot created using the @BotFather on Telegram.
- Bot Token issued by the @BotFather.
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 pymupdf | |
def generate_markdown_table(rows): | |
"""Generates a Markdown table string wrapped in <pre> tags.""" | |
if not rows: | |
return "No incidents reported" | |
headers = ["Station", "Date / Time", "Location", "Incident"] |
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
server { | |
listen 80; | |
server_name _; | |
server_name_in_redirect off; | |
location ~ ^/~(.+?)(/.*)?$ { | |
alias /home/$1/public_html$2; | |
autoindex on; | |
} |
I hereby claim:
- I am leandrotoledo on github.
- I am leandrotoledo (https://keybase.io/leandrotoledo) on keybase.
- I have a public key whose fingerprint is A4D4 1D6C 70CF 394E 6EE2 A281 F20F 4B10 1AE4 197C
To claim this, I am signing this object:
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 logging | |
import telegram | |
from telegram import ReplyKeyboardMarkup, KeyboardButton | |
from telegram.ext import Updater, CommandHandler, MessageHandler, filters | |
# Enable logging | |
logging.basicConfig( | |
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
level=logging.INFO) |
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
#!/usr/bin/env python | |
'''Using Webhook and self-signed certificate''' | |
# This file is an annotated example of a webhook based bot for | |
# telegram. It does not do anything useful, other than provide a quick | |
# template for whipping up a testbot. Basically, fill in the CONFIG | |
# section and run it. | |
# Dependencies (use pip to install them): | |
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot |
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 telegram | |
__author__ = 'mehrdad' | |
def handleTgMessage(tgBot,tgMessage,tgChatID,tgUpdateID): | |
"""do something with message""" | |
tgBot.sendMessage(chat_id=tgChatID, text=tgMessage) |
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 telegram | |
import time | |
from rq import Queue | |
from redis import Redis | |
from handleMessage import handleTgMessage | |
__author__ = 'mehrdad vesal' | |
_botToken='<TOKEN>' | |
_raziBot=telegram.Bot(token=_botToken) |
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
If you have a simple installation, in other words, a basic installation without self-compiled programs or a complicated setup, you just need to follow three steps: | |
1) Change squeeze to wheezy in source.list | |
# vi /etc/apt/source.list | |
:%s/squeeze/wheezy/g | |
:wq! | |
2) Update new repository | |
# aptitude update |
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
Section "ServerLayout" | |
Identifier "X.org Configured" | |
Screen 0 "Screen0" 0 0 | |
Screen 1 "Screen1" RightOf "Screen0" | |
Screen 2 "Screen2" RightOf "Screen1" | |
InputDevice "Mouse0" "CorePointer" | |
InputDevice "Keyboard0" "CoreKeyboard" | |
EndSection | |
Section "Files" |
NewerOlder