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 | |
#Megasaturnv 2017-06-08 | |
while true; do sleep 30; newsbeuter -x reload -x print-unread | grep -q "^0 unread articles" && echo -n . || (echo -e "\a"; newsbeuter) ; done |
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
//Megasaturnv 2017-07-05 | |
//Arduino simple digitalRead with software debounce | |
//Digital read an pin with software debounce. Pin should be set as: pinMode(pin, INPUT_PULLUP) in setup(). | |
//Arduino ATMEGA328P (and some other ATMEL chips) have internal pull-up resistors. Pin is active when connected to GND | |
//Projects where pins are active high (with pull down resistors) should modify lines 7 and 11 below, as indicated | |
//This function will return true if input is active for at least 50ms and then released. The function will return false if input is not active | |
bool digitalReadDebounce(int pin) { | |
if (digitalRead(pin) == LOW) { // <- Change to '== HIGH' if pin is active high | |
delay(50); |
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 | |
#Megasaturnv 2017-07-28 | |
#Url of the RSS feed | |
RSS_URL="" | |
##Commented version: | |
#Download the rss feed | |
curl --silent "$RSS_URL" | \ | |
#Only match lines with 'title>' or 'description>' |
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 | |
#Megasaturnv 2017-07-28 | |
echo $(($(date -d 25-Dec +%-j) - $(date +%-j))) days until christmas! |
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 | |
#Megasaturnv 2017-11-17 | |
(tmux ls | grep -q "attached" && echo "[Info] You are already attached to a tmux session") || tmux attach |
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 | |
#Megasaturnv 2017-11-17 | |
#useful examples: /usr/share/doc/tmux/examples | |
SESSION="tmux_$USER" | |
tmux -2 new-session -d -s $SESSION | |
#0 Setup a window for general use | |
tmux rename-window -t $SESSION:0 "General" |
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 | |
#Megasaturnv 2018-01-08 | |
# Uncomment to create checkRcloneVersion_current.txt file: | |
# echo v1.38 > checkRcloneVersion_current.txt | |
# Add following line to crontab (crontab -e) to check once a week (every Monday at 21:21) | |
# 21 21 * * 1 ./checkRcloneVersion.sh | |
LOCAL_VERSION="$(cat checkRcloneVersion_current.txt)" |
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 | |
//Megasaturnv 2018-01-12 | |
$camurl="http://192.168.1.100:8081/"; // Mjpeg URL | |
//$camurl="http://username:[email protected]:8081/" // HTTP Auth mjpeg URL (optional) | |
$boundary="--BoundaryString"; // $boundary = The boundary string between jpegs in an mjpeg stream | |
//NOTE: $boundary changes between mjpeg stream providers. For example, https://github.com/Motion-Project/motion uses '--BoundaryString'. https://github.com/ZoneMinder/ZoneMinder uses '--ZoneMinderFrame'. To find out $boundary for your stream you will need to save 1 or more frames of the mjpeg and open it with a text editor. --<boundary string> should be visible on the first line | |
$f = fopen($camurl, "r"); // Open mjpeg url as $f in readonly mode | |
$r = ""; // Set $r to blank variable | |
if($f) { |
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 | |
//Megasaturnv 2018-01-16 | |
$camurl="http://192.168.1.100:8081/"; // Mjpeg URL | |
//$camurl="http://username:[email protected]:8081/" // HTTP Auth mjpeg URL (optional) | |
$boundary="--BoundaryString"; // $boundary = The boundary string between jpegs in an mjpeg stream | |
//NOTE: $boundary changes between mjpeg stream providers. For example, https://github.com/Motion-Project/motion uses '--BoundaryString'. https://github.com/ZoneMinder/ZoneMinder uses '--ZoneMinderFrame'. To find out $boundary for your stream you will need to save 1 or more frames of the mjpeg and open it with a text editor. --<boundary string> should be visible on the first line | |
$f = fopen($camurl, "r"); // Open mjpeg url as $f in readonly mode | |
$r = ""; // Set $r to blank variable | |
if($f) { |
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 | |
//Megasaturnv 2018-01-16 | |
header("content-type: image/jpeg"); | |
// Change this resolution to match your camera \/ | |
echo passthru("avconv -f video4linux2 -i /dev/video0 -vframes 1 -s 1920x1080 pipe:.jpg 2>/dev/null"); | |
?> |
OlderNewer