Skip to content

Instantly share code, notes, and snippets.

View sskorol's full-sized avatar
🇺🇦
Stand with Ukraine

Serhii Korol sskorol

🇺🇦
Stand with Ukraine
View GitHub Profile
@ghedo
ghedo / sound_playback.c
Last active June 19, 2024 02:00
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples:
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 12, 2024 11:15
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@Lahorde
Lahorde / 0_README.md
Last active August 11, 2023 16:52
Initialize an external I2C RTC module on raspberry using udev and systemd

Description

Enable i2c RTC using systemd. A udev rules triggers an I2C systemd service on I2C kernel module adding. Service then loads I2C driver adding a new I2C device to /sys Then kernel loads I2C RTC driver and adds an RTC device It triggers a udev rules that updates hardware clock

Application on raspberry pi

Enable I2C

  • enable I2C in config.txt, adding device_tree_param=i2c1=on
@ruffsl
ruffsl / Dockerfile
Last active July 12, 2024 20:25
Small ROS Network Example
FROM ros:indigo-ros-base
# install ros tutorials packages
RUN apt-get update && apt-get install -y \
ros-indigo-ros-tutorials \
ros-indigo-common-tutorials \
&& rm -rf /var/lib/apt/lists/
@aallan
aallan / throttled.sh
Last active March 17, 2024 04:42
Script to parse the output of the 'vcgencmd get_throttled' command on a Raspberry Pi
#!/bin/bash
# https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling
#Flag Bits
UNDERVOLTED=0x1
CAPPED=0x2
THROTTLED=0x4
HAS_UNDERVOLTED=0x10000
HAS_CAPPED=0x20000
@Liblor
Liblor / volume.sh
Created May 21, 2019 20:30
Volume notification: Pulseaudio and dunst
#!/usr/bin/bash
# Volume notification: Pulseaudio and dunst
# inspired by gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a
icon_path=/usr/share/icons/Adwaita/64x64/status/
notify_id=506
sink_nr=1 # use `pacmd list-sinks` to find out sink_nr
@wshayes
wshayes / logging.yml
Created July 1, 2019 13:33
[Logging tip] #fastapi #python
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(message)s"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
formatter: simple
@zcapper
zcapper / canary.yaml
Created July 1, 2020 02:05
AWS Synthetics Canary CloudFormation template
Parameters:
CanaryName:
Type: String
Default: my-canary
MaxLength: 21
Resources:
CloudWatchSyntheticsRole:
Type: AWS::IAM::Role
Properties:
@Cemu0
Cemu0 / hassio_jetson_nano.sh
Last active April 17, 2021 19:45 — forked from det-peralta/hassio_jetson_nano.sh
Install Hassio on Nvidia Jetson Nano
sudo -i
apt-get install software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat
#The jetson already has docker installed
#curl -fsSL get.docker.com | sh
curl -sL "https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh" | bash -s -- -m qemuarm-64
@amaembo
amaembo / stream_chain.svg
Created September 4, 2021 08:22
Stream Chain visualization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.