- Create a bot using @BotFather, get it's token
- Start conversation with bot
- Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
<a class="btn btn-default btn-info bookmarklet" href="javascript:(function(d){var a=d.document,h=function(){},c=a.body||a.getElementsByTagName("body")[0],f=a.documentElement||a.getElementsByTagName("html")[0],k=[c,f,a],l=["webkit","khtml","moz","ms",""],g=["contextmenu","selectstart","select","mousedown","mouseup"],b=d.Selection,e=b&&b.prototype;e&&(e.removeAllRanges=h,b=a.selection)&&(b.clear=h);for(e=k.length;e--;)if(f=k[e]){for(b=g.length;b--;)f["on"+g[b]]=null;if(a=f.style)for(a.cursor="",a.webkitTouchCallout="initial",b=l.length;b--;)a[((c=l[b])?"-"+c+"-":c)+"user-select"]="initial"}(c=d.jQuery||d.Zepto)&&c(d).off(g)})(this);"> | |
Enable Select | |
</a> |
""" | |
MIT License | |
Copyright (c) 2016 Pipat Methavanitpong | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
# Use this script to test that your Telegram bot works. | |
# | |
# Install the dependency | |
# | |
# $ gem install telegram_bot | |
# | |
# Run the bot | |
# | |
# $ ruby bot.rb | |
# |
This simple script uses netcat
to check if - for instance - a webserver is running on a server. If the service is not running, it utilizes the telegram bot API for sending a message to inform the operator of the server.
Go to the BotFather bot-account and create a bot by writing /newbot
. Then, copy the token.
Send a message to you newly created bot (you can find the link to your bot in the success message sent by BotFather).
<?php | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
use PhpAmqpLib\Connection\AMQPConnection; | |
use PhpAmqpLib\Message\AMQPMessage; | |
define('AMQP_DEBUG_FM', true); | |
$host = '127.0.0.1'; | |
//$host = '192.168.2.3'; |
$ uname -r
This tutorial is about setting up a Github account to commit (via SSH) to an existing/new repository and common commands to handle that repository.
git config --global user.email "your_email@example.com"
git config --global user.name "Your Name"
Create the certificate:
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
Create a strong Diffie-Hellman group:
$ openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
Create an Apache Configuration Snippet with Strong Encryption Settings
Create the certificate:
$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
Create a strong Diffie-Hellman group:
$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
Create a new configuration snippet file for Nginx: