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
<?php | |
/* | |
BOT PENGANTAR | |
Materi EBOOK: Membuat Sendiri Bot Telegram dengan PHP | |
Ebook live http://telegram.banghasan.com/ | |
oleh: bang Hasan HS |
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
<?php | |
/** | |
* Bot PHP Telegram ver Curl | |
* Lebih Bersih | |
* Sample Sederhana untuk Ebook Edisi 3: Membuat Bot Sendiri Menggunakan PHP | |
* | |
* Dibuat oleh Hasanudin HS | |
* @hasanudinhs di Telegram dan Twitter | |
* Ebook live http://telegram.banghasan.com/ |
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
<?php | |
/* | |
Simple File untuk Ngetes Send Pesan ke Bot | |
Memiliki banyak kegunaan dan tujuan | |
misalnya ngetes pesan dengan format tertentu, line break, char khusus, dll. | |
bisa dipergunakan juga untuk test hosting, cronjob, dan segala test lainnya. | |
Jika menggunakan mode GET : |
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
An h1 header | |
============ | |
Paragraphs are separated by a blank line. | |
2nd paragraph. *Italic*, **bold**, `monospace`. Itemized lists | |
look like: | |
* this one | |
* that one |
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
/* | |
* setWebhook: | |
* curl -X POST https://api.telegram.org/botXXXXXXX/setWebhook -F url="SERVER_URL" -F certificate=@/etc/nginx/ssl/YOURPUBLIC.pem | |
* | |
* upload foto | |
* $postFields = array('chat_id' => $chatId, 'photo' => new CURLFile(realpath("image.png")), 'caption' => $text); | |
*/ |
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
# simpan file ke /etc/profile.d/ | |
USERID="ID USER atau GROUP" #contoh 213567634 | |
KEY="TOKENBOT" #contoh 123456789:AASDFASDW21casgW4hjtRLp4GH5wMnWlpT7Eg | |
TIMEOUT="10" | |
URL="https://api.telegram.org/bot$KEY/sendMessage" | |
DATE_EXEC="$(date "+%d %b %Y %H:%M")" | |
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt' | |
if [ -n "$SSH_CLIENT" ]; then | |
IP=$(echo $SSH_CLIENT | awk '{print $1}') | |
PORT=$(echo $SSH_CLIENT | awk '{print $3}') |
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
$tokenbot = $Hook['env']['tokenbot']; | |
$endpoint = "https://api.telegram.org/bot$tokenbot/"; | |
$messages = $Hook["params"]; | |
if (isset($messages['message'])) { | |
$messages = $messages['message']; | |
} else { | |
echo 'URL hook.io: https://'.$Hook['input']['host'].$Hook['input']['path']; | |
} |
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 | |
read -r -p "This will install SoftEther to your server. Are you sure you want to continue? [y/N] " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
echo "Updating the system first..." | |
apt-get update | |
apt-get upgrade | |
apt-get install checkinstall build-essential | |
echo "Downloading last stable release: 4.20" | |
sleep 2 |
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
<?php | |
// from http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/ | |
class Colors { | |
private $foreground_colors = array(); | |
private $background_colors = array(); | |
public function __construct() { | |
// Set up shell colors | |
$this->foreground_colors['black'] = '0;30'; | |
$this->foreground_colors['dark_gray'] = '1;30'; | |
$this->foreground_colors['blue'] = '0;34'; |
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
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
OlderNewer