Skip to content

Instantly share code, notes, and snippets.

View zhum's full-sized avatar

Zhumatiy Sergey zhum

View GitHub Profile
@zhum
zhum / gtk-test.rb
Created October 17, 2021 15:32
Incorrect columns edit example
#!/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 )
@zhum
zhum / bot.rb
Last active September 22, 2021 12:23 — forked from dideler/bot.rb
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@zhum
zhum / TelegramIdWith Bot.md
Created September 3, 2021 11:38
Как получить telegram id группы, если есть бот
  1. Добавить бота в нужную группу;
  2. Написать хотя бы одно сообщение в неё;
  3. Отправить GET-запрос: curl https://api.telegram.org/bot<YourBOTToken>/getUpdates
  4. Взять значение "id" из объекта "chat". Это и есть идентификатор чата. Для групповых чатов он отрицательный, для личных переписок положительный.
@zhum
zhum / gitproxy-socat
Created April 19, 2021 09:57 — forked from sit/gitproxy-socat
A simple wrapper around socat to use as a git proxy command
#!/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
@zhum
zhum / ruseng2.sh
Created April 17, 2021 12:32
Исправление раскладки выделенного текста
#!/bin/bash
# Необходимые программы; всё доступно через apt.
# ╔════╦═══════╦══════╦═════════╗
# ║xsel║xdotool║xmacro║setxkbmap║
# ╚════╩═══════╩══════╩═════════╝
# ╔═══════════════════════════════════════════════════════════════════════════════╗
# ║ 1.)Данные для скрипта исправляющего раскладку выделенного текста… ║
# ╚═══════════════════════════════════════════════════════════════════════════════╝
@zhum
zhum / zbx-exim-stats.sh
Last active November 28, 2020 13:03 — forked from crashdump/zbx-exim-stats.sh
A simple Zabbix statistics pusher for Zabbix-5. zbx-exim-stats.sh should be set to crontab, template should be imported.
#!/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
@zhum
zhum / flags-howto.txt
Created October 27, 2020 16:51
Флаги на раскладке
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.
@zhum
zhum / update_pubkey.sh
Created October 25, 2020 08:39
Fix "NO_PUBKEY XXXXXXX" problen on apt repo add
#!/bin/sh
while [ "x$1" != x ]; do
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "$1"
shift
done
@zhum
zhum / mysql-trouble-fix.sh
Last active July 27, 2021 06:48
Reset password fro ANY mysql/mariadb installation
# 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'
@zhum
zhum / 20-natural-scrolling.conf
Created July 20, 2020 04:46 — forked from kakra/20-natural-scrolling.conf
xorg.conf.d/20-natural-scrolling.conf
Section "InputClass"
Identifier "Enable natural scrolling by default"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
MatchDriver "libinput"
Option "NaturalScrolling" "on"
EndSection