This file contains 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
/** | |
* NeoClock | |
* | |
* Clock using 60 WS2812B/Neopixel LEDs and DS3231 RTC | |
* | |
* Libraries needed: | |
* * Adafruit NeoPixel (Library Manager) - Phil Burgess / Paint Your Dragon for Adafruit Industries - LGPL3 | |
* * Rtc by Makuna (Library Manager) - Michael C. Miller | |
* * Arduino Timezone Library (https://github.com/JChristensen/Timezone) - Jack Christensen - CC-BY-SA | |
* * Time Library (https://github.com/PaulStoffregen/Time) - Paul Stoffregen, Michael Margolis - LGPL2.1 |
This file contains 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
#include <LEDMatrixDriver.hpp> | |
extern "C" { | |
#include "user_interface.h" | |
} | |
// This sketch draw marquee text on your LED matrix using the hardware SPI driver Library by Bartosz Bielawski. | |
// https://github.com/bartoszbielawski/LEDMatrixDriver | |
// Example written 16.06.2017 by Marko Oette, www.oette.info |
This file contains 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
unsigned long last1 = 0; | |
unsigned long last2 = 0; | |
unsigned long lasts = 0; | |
unsigned int dur1 = 0; | |
unsigned int dur2 = 0; | |
byte tgt1 = 128; | |
byte tgt2 = 128; | |
void setup() { | |
Serial.begin(115200); |
This file contains 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
/*************************************************************************** | |
IR Ferraris Reader | |
2019 Adlerweb//Bitbastelei | |
Florian Knodt - www.adlerweb.info | |
Note: Just a few minutes of coding, not heavily tested, etc | |
***************************************************************************/ | |
#include <Arduino.h> |
This file contains 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
<?PHP | |
function getHA($id) { //ID to read - for example sensor.foo | |
$key = ''; //Long-lived access token, can be obtained in HomeAssistant UI→Profile | |
$url = 'http://127.0.0.1:8123/'; //URL to your HA including trailing / | |
$opts = [ | |
"http" => [ | |
"method" => "GET", | |
"header" => | |
"Content-Type: application/json\r\n" . |
This file contains 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 | |
#Taken from https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md, here to allow for simple installation | |
#Use at your own risk. | |
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") | |
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] |
This file contains 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/bash | |
version=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/Jguer/yay.git '*.*.*' | tail --lines=1 | cut --delimiter='/' --fields=3 | tr -d 'v') | |
url="https://github.com/Jguer/yay/releases/download/v${version}/yay_${version}_x86_64.tar.gz" | |
tmp=$(mktemp -d) | |
if [ -d "$tmp" ] | |
then | |
if [ "$(ls -A $tmp)" ]; then | |
echo "Oops. Temporary directory $tmp is not empty" |
This file contains 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
if [ $(file /boot/vmlinuz* | cut -d ' ' -f 9) != $(uname -r) ] ; then echo 'reboot'; else echo 'ok'; fi |
This file contains 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
#!/usr/bin/python3 | |
import os | |
import re | |
os.chdir('/boot') | |
files=(os.listdir('/boot')) | |
keep = [ |
This file contains 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
#!/usr/bin/python3 | |
import os | |
tmp = os.popen('uname -r') | |
kernelO = tmp.read() | |
kernelO = kernelO.replace('-x86_64', '').strip() | |
tmp = os.popen('eselect kernel list | grep [1] | cut -d " " -f 6') | |
kernelN = tmp.read() | |
kernelN = kernelN.replace('linux-', '').strip() |