- Добавить бота в нужную группу;
- Написать хотя бы одно сообщение в неё;
- Отправить 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
#!/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 |
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
user www-data; | |
worker_processes auto; | |
pid /run/nginx/nginx.pid; # only line changed from default | |
include /etc/nginx/modules-enabled/*.conf; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} |
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 bash | |
# latest version is here: https://gist.github.com/zhum/b00b6c55e0559d0684796191eecf21d9 | |
# shellcheck disable=all | |
#-------------- options -------------- | |
set -e # stop on any command fail | |
set -E # generate ERR exception on aliases, functions, and commands in if/while/until conditions | |
set -u # stop on any unbound variable | |
set -o pipefail # stop on any fail with pipe |