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.
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""MAVLink Monitor | |
Monitor MAVLink packages from a serial port, UDP, or TCP link. | |
Usage: | |
mavlink_monitor.py [--dialect=<dialect>] [-b] <url> | |
mavlink_monitor.py (-h | --help) | |
Options: | |
--dialect=<dialect> MAVLink dialect [default: common] |
import requests | |
r = requests.get('http://192.168.11.136:5000', params={'foo': 123}) | |
print(r.text) |
#!/usr/bin/env python3 | |
# Fetch all GitHub repo stargazers | |
# Usage: REPO=<username>/<repo> ./stars.py | |
# 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 |
TAG=<tag_name> && git tag -d $TAG && git push --delete origin $TAG |
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.
#!/usr/bin/env bash | |
# Usage: copy <filename> | |
SSH=($SSH_CONNECTION) | |
echo scp $1 $(whoami)@${SSH[2]}:$(pwd) |
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
# Running: PYTHONUNBUFFERED=1 python temp_plot.py | tee temp.csv | |
import time | |
import subprocess | |
print('uptime,temperature,throttling') | |
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']) |
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): | |
queue.append(msg) |
#include <iostream> | |
#include <string> | |
using namespace std; | |
struct Node | |
{ | |
public: | |
// Answer constructor | |
Node(string answer) : |