Skip to content

Instantly share code, notes, and snippets.

View ratijas's full-sized avatar
🔓
gpg --recv-keys 16FE1EF864EAFBE8209247FAAE69C4B00B02FC69

ratijas ratijas

🔓
gpg --recv-keys 16FE1EF864EAFBE8209247FAAE69C4B00B02FC69
View GitHub Profile
@ratijas
ratijas / 1-Webhooks_pyTelegramBotAPI.md
Last active June 14, 2022 15:35
Examples of webhook using pyTelegramBotAPI (BaseHTTPServer, Flask and CherryPy).

Webhook examples using pyTelegramBotAPI

There are 3 examples in this directory using different libraries:

  • Python (CPython): webhook_cpython_echo_bot.py
    • Pros:
      • Official python libraries, it works out of the box (doesn't require to install anything).
      • Works with Python 2 and Python 3 (need to be converted with 2to3).
  • Cons:
@ratijas
ratijas / coredumpctl gdb and backtrace
Last active February 4, 2022 02:48
GammaRay crash in GammaRay::RemoteModel::Node::~Node()
$ coredumpctl gdb 42834
PID: 42834 (gammaray-client)
UID: 1000 (ratijas)
GID: 1000 (ratijas)
Signal: 11 (SEGV)
Timestamp: Thu 2022-01-27 18:36:57 MSK (26s ago)
Command Line: /usr/lib/gammaray/libexec/gammaray-client tcp://127.0.0.1:11732
Executable: /usr/lib/gammaray/libexec/gammaray-client
Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.kde.yakuake-5ff7e14344c34635b05cbe5c74112da6.scope
Unit: user@1000.service
@ratijas
ratijas / stacktrace.log
Created February 3, 2022 22:39
GammaRay: Stacktrace for QSGTextureGrabber::requestGrab crash
❯ coredumpctl gdb
PID: 57547 (jumpy-desktop-b)
UID: 1000 (ratijas)
GID: 1000 (ratijas)
Signal: 11 (SEGV)
Timestamp: Fri 2022-02-04 01:36:34 MSK (12s ago)
Command Line: ./jumpy-desktop-button
Executable: /home/ratijas/projects/playground/jumpy-desktop-button/build/Desktop_Qt_5_15_2_GCC_64bit_system/Debug/jumpy-desktop-button
Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.kde.konsole-60c4801dd60945c5ab4dd5482178a6fe.scope
Unit: user@1000.service
@ratijas
ratijas / DSUS.lua
Created October 2, 2020 14:52
DSUS (DualShock Udp Server) protocol dissector for Wireshark
-- cache globals to local for speed.
local format = string.format
local tostring = tostring
local tonumber = tonumber
local sqrt = math.sqrt
local pairs = pairs
-- declare DSUS protocol
local dsus_proto = Proto.new("DSUS", "DualShock UDP Server/Client for Cemuhook")
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://raw.githubusercontent.com/J-Rios/BASH-Scripts/master/install/install_qt5 \
&& chmod +x install_qt5 \
&& ./install_qt5 \
import QtQuick 2.12 as QQ
import QtQuick.Window 2.12 as QQW
import Qt.labs.platform 1.1 as QLP
import QtQuick.Controls 2.12 as QQC2
QQW.Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
@ratijas
ratijas / playground.rs
Created April 8, 2020 13:37 — forked from rust-play/playground.rs
Using Box<[T]> in Rust for multi-dimensional arrays
use std::{fmt, ops};
pub struct Array2D<T> {
width: usize,
height: usize,
data: Box<[T]>,
}
impl<T> Array2D<T> {
pub fn new(size: (usize, usize)) -> Self
@ratijas
ratijas / RegQueryValueEx.rs
Last active March 11, 2020 15:18
Stable, safe, fast wrapper for RegQueryValueEx
/* common uses */
pub use std::ptr::{self, null, null_mut};
pub use widestring::*;
pub use winapi::shared::minwindef::*;
pub use winapi::shared::winerror::*;
pub use winapi::um::errhandlingapi::*;
pub use winapi::um::winbase::*;
pub use winapi::um::winnt::*;
pub use winapi::um::winreg::*;
@ratijas
ratijas / installXLDVorbisDecoder.sh
Created February 17, 2016 20:58
decoding .ogg music files with XLD
#!/bin/sh
# copyright 2016 Ratijas & Mac-J studio
# WTF Public Licence
# sadly, XLD still does not support .ogg files decoding out of the box.
# there's instruction with outdated download link: https://hydrogenaud.io/index.php/topic,81239.0.html,
# so here we'll recreate all necessary steps needed to patch up your XLD installation.
# we will need git, svn and Xcode (with command line tools)
# REWRITE following line if your XLD.app is not at /Applications

rage-quit plugin for oh-my-zsh

based on rage-quit support for bash

HOW TO INSTALL

Put the files below inside ~/.oh-my-zsh/custom/plugins/fuck

Add fuck to the loaded plugins inside your .zshrc, and enjoy. Autocomplete is included.