Skip to content

Instantly share code, notes, and snippets.


Oleg Kalachev okalachev

View GitHub Profile
okalachev /
Last active Jan 20, 2022
MAVLink monitor tool
okalachev /
Last active Oct 20, 2021
Networking examples
import requests
r = requests.get('', params={'foo': 123})
okalachev /
Last active Aug 10, 2021
Keep track of who stars and unstars your repos 😈
#!/usr/bin/env python3
# Fetch all GitHub repo stargazers
# Usage: REPO=<username>/<repo> ./
# Results are saved in JSON and TXT format into ./<username>-<repo>/ directory (by timestamp)
import os, os.path
from datetime import datetime
import requests
import json
okalachev /
Last active Jul 28, 2021
git: remove local and remote tag
TAG=<tag_name> && git tag -d $TAG && git push --delete origin $TAG
okalachev /
Last active May 23, 2021
Show high CPU usage process (xbar plugin)

Show high CPU usage process

The plugin for xbar, thath detects a high CPU consuming process (>50% CPU by default) and shows it in the top menu bar. If there is no high CPU usage the plugin stays quiet.

okalachev / copy
Created May 16, 2021
Generate scp command for copying a file to host
View copy
#!/usr/bin/env bash
# Usage: copy <filename>
echo scp $1 $(whoami)@${SSH[2]}:$(pwd)
okalachev /
Last active Apr 23, 2021
DT overlay to run OV7251 camera on CAM0 port of Compute Module 4

Device Tree overlay to run OV7251 camera on CAM0 port of Compute Module 4

This will work on Raspberry Pi OS 2021-01-12 (related DT files were changed in later release).

Copy the binary device tree overlay file to /boot/overlays/:

sudo cp ov7251cam0.dtbo /boot/overlays/ov7251cam0.dtbo
okalachev /
Last active Apr 21, 2021
Script for plotting RPi temperature graph
# Running: PYTHONUNBUFFERED=1 python | tee temp.csv
import time
import subprocess
while True:
uptime = float(open('/proc/uptime', 'r').readline().split()[0]) / 60
temp = float(open('/sys/class/thermal/thermal_zone0/temp').read()) / 1000
throttled = subprocess.check_output(['vcgencmd', 'get_throttled'])
okalachev /
Last active Feb 26, 2020
rospy subscriber that doesn't loose messages
import rospy
from collections import deque
from threading import Event, Thread
def subscribe_deque(name, data_class, callback=None, callback_args=(),
queue_size=1, **kwargs):
def cb(msg):
okalachev / tree.cpp
Created Dec 12, 2019
Tree game implemented in C++
View tree.cpp
#include <iostream>
#include <string>
using namespace std;
struct Node
// Answer constructor
Node(string answer) :