- Добавить бота в нужную группу;
- Написать хотя бы одно сообщение в неё;
- Отправить GET-запрос:
curl https://api.telegram.org/bot<YourBOTToken>/getUpdates - Взять значение "id" из объекта "chat". Это и есть идентификатор чата. Для групповых чатов он отрицательный, для личных переписок положительный.
This file contains hidden or 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 ruby | |
| # frozen_string_literal: true | |
| # | |
| require 'gtk2' | |
| Gtk.init | |
| @window = Gtk::Window.new( Gtk::Window::TOPLEVEL ) | |
| @window.set_size_request( 1500, 500 ) | |
| @window.signal_connect( "delete_event" ) { Gtk.main_quit } | |
| #@window.set_border_width( 5 ) |
This file contains hidden or 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
| # Use this script to test that your Telegram bot works. | |
| # | |
| # Install the dependency | |
| # | |
| # $ gem install telegram_bot | |
| # | |
| # Run the bot | |
| # | |
| # $ ruby bot.rb | |
| # |
This file contains hidden or 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/sh | |
| # Use socat to proxy git through an HTTP CONNECT firewall. | |
| # Useful if you are trying to clone git:// from inside a company. | |
| # Requires that the proxy allows CONNECT to port 9418. | |
| # | |
| # Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run | |
| # chmod +x gitproxy | |
| # git config --global core.gitproxy gitproxy | |
| # | |
| # More details at http://tinyurl.com/8xvpny |
This file contains hidden or 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 | |
| # Необходимые программы; всё доступно через apt. | |
| # ╔════╦═══════╦══════╦═════════╗ | |
| # ║xsel║xdotool║xmacro║setxkbmap║ | |
| # ╚════╩═══════╩══════╩═════════╝ | |
| # ╔═══════════════════════════════════════════════════════════════════════════════╗ | |
| # ║ 1.)Данные для скрипта исправляющего раскладку выделенного текста… ║ | |
| # ╚═══════════════════════════════════════════════════════════════════════════════╝ |
This file contains hidden or 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 | |
| # Set Variables | |
| EXIMLOG=/var/log/exim4/mainlog | |
| MYLOG=/tmp/exim_status.log | |
| OFFSETFILE=/tmp/eximstatusoffset.dat | |
| EXIMSTATS="/usr/sbin/eximstats -emptyok" | |
| LOGTAIL=/usr/sbin/logtail | |
| ZABBIX_SENDER=/usr/bin/zabbix_sender | |
| ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf |
This file contains hidden or 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
| 1. Create ~/.icons/flags | |
| 2. Put ru.png and en.png images | |
| 3. execute dconf-editor, go to org/mate/desktop/peripherals/keyboard/xkb/indicator/show-flags, set YES, apply. |
This file contains hidden or 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/sh | |
| while [ "x$1" != x ]; do | |
| apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1" | |
| shift | |
| done |
This file contains hidden or 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
| # PASSWORD RESET | |
| #!/bin/sh | |
| service mysql stop | |
| sudo mysqld_safe --skip-grant-tables & | |
| mysql_secure_installation | |
| mysql -u root -p shutdown | |
| service mysql start | |
| ########################################### | |
| # Fix error like 'nnoDB: Error: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_index_stats uses space ID' |
This file contains hidden or 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 "InputClass" | |
| Identifier "Enable natural scrolling by default" | |
| MatchIsPointer "on" | |
| MatchDevicePath "/dev/input/event*" | |
| MatchDriver "libinput" | |
| Option "NaturalScrolling" "on" | |
| EndSection |