This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this is a sample script which is testing if there is available ESSID on the WiFi | |
# and according to the result it is starting/stopping aawgd | |
# more info: https://github.com/nisargjhaveri/WirelessAndroidAutoDongle/issues/212#issuecomment-2692423007 | |
delaytime=5 | |
essid="searchedAPName" | |
while [ true ]; do | |
wifiavail='iw dev wlan0 scan|grep SSID' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::error::Error; | |
use std::io; | |
use rppal::gpio::{Gpio, Trigger}; // 0.16.1 | |
pub const BTN1: u8 = 13; | |
pub const BTN2: u8 = 4; | |
fn main() -> Result<(), Box<dyn Error>> { | |
let mut btns = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as in title - you have no `man` installed but sometimes you need to quick search for a manual page | |
# add this to your .zshrc | |
man() { | |
xdg-open https://man.archlinux.org/man/$1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a systemd service file to be able to monitor battery level on a windows laptop | |
# The Windows side is described in this gist: | |
# https://gist.github.com/manio/95ad95dc5eba708b12d658f2e6f478ea | |
# This unit is listening on specified UDP port and it is writing data | |
# to specified output file. It is overwriting the data with every new | |
# UDP frame. | |
[Unit] | |
Description=laptop battery monitoring daemon | |
After=local-fs.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ABOUT: | |
# I needed to have a battery level percentage of my Windows laptop reported to a linux host somehow. | |
# I am then able to monitor this value and automate switching ON/OFF power supply to keep the laptop | |
# battery charged in ranges about 20-80%, totaly automatically | |
# first you need to download this helper script for sending UDP: | |
# https://gist.githubusercontent.com/PeteGoo/21a5ab7636786670e47c/raw/30cc9ca860154429bcef500fa2d0e96811ad0292/Send-UdpDatagram.ps1 | |
# the scripts neeed to be "unblocked" to be able to run from PowerShell using this method: | |
#dir .\battery_level.ps1|block-File |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The following snipset is for reading the AJ-SR04M (JSN-SR04T compatible) ultrasonic distance sensor | |
under rust (esp-rs + embassy). | |
It is intended for mode 0 (which is the default) and it is counting the resulting echo pulse timing. | |
Finaly the useconds value is converted to centimeters value. | |
ESP32 wiring: | |
Vcc -> 5V | |
Trigger -> GPIO 19 | |
Echo -> GPIO 21 (via level shifter) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/fp-lib-table b/fp-lib-table | |
index b7032ccc..43ccd284 100644 | |
--- a/fp-lib-table | |
+++ b/fp-lib-table | |
@@ -98,6 +98,7 @@ | |
(lib (name Sensor_Current)(type KiCad)(uri ${KISYSMOD}/Sensor_Current.pretty)(options "")(descr "Specialized footprints for current sensors")) | |
(lib (name Sensor_Motion)(type KiCad)(uri ${KISYSMOD}/Sensor_Motion.pretty)(options "")(descr "Specialized footprints for motion sensors")) | |
(lib (name Sensor_Pressure)(type KiCad)(uri ${KISYSMOD}/Sensor_Pressure.pretty)(options "")(descr "Specialized footprints for pressure sensors")) | |
+ (lib (name Sensor_Temperature)(type KiCad)(uri ${KISYSMOD}/Sensor_Temperature.pretty)(options "")(descr "Specialized footprints for temperature sensors")) | |
(lib (name Sensor_Voltage)(type KiCad)(uri ${KISYSMOD}/Sensor_Voltage.pretty)(options "")(descr "Specialized footprints for voltage sensors")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sample program to obtain a humidity from DS2438 | |
//more info: | |
//https://skyboo.net/2017/03/ds2438-based-1-wire-humidity-sensor/ | |
//compile with: gcc -o humid get_humid.c | |
#include <stdio.h> | |
void get_humidity() | |
{ | |
FILE *fp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fs_prepare.sh | |
# more info: https://skyboo.net/2017/04/rpi-creating-a-ram-disk-running-linux-environment-from-nfs-booted-raspbian/ | |
set -x | |
mkdir -p /usr/lib/arm-linux-gnueabihf | |
mkdir -p /lib/arm-linux-gnueabihf | |
cp /old_root/usr/lib/arm-linux-gnueabihf/libarmmem.so /usr/lib/arm-linux-gnueabihf | |
cp -P /old_root/lib/arm-linux-gnueabihf/libutil* /lib/arm-linux-gnueabihf | |
cp -P /old_root/lib/arm-linux-gnueabihf/libcrypt* /lib/arm-linux-gnueabihf | |
cp -P /old_root/lib/arm-linux-gnueabihf/libnss_files* /lib/arm-linux-gnueabihf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# a sample /etc/init.d/rcS script | |
# more info: https://skyboo.net/2017/04/rpi-creating-a-ram-disk-running-linux-environment-from-nfs-booted-raspbian/ | |
set -x | |
#prepare a new RAM filesystem copying needed libraries and binaries from the old fs | |
/old_root/fs_prepare.sh | |
#ssh server | |
/usr/sbin/dropbear -s | |
#convert the openssh key to the dropbear format |
NewerOlder