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
<!-- | |
panel_custom: | |
- name: no-love | |
sidebar_title: No love | |
sidebar_icon: mdi:heart-off | |
webcomponent_path: /home/bs/.homeassistant/panels/no-love.html | |
--> | |
<dom-module id="ha-panel-no-love"> | |
<style> |
Scenario:
- multiple USB devices plugged via hub to a host (Linux OS based),
- multiple services/programs interacting with TTY running on top (e.g. GPSd)
Problem:
At boot TTY are randomly assigned to devices causing depending services/programs instabilities. They could indeed fail to start because of different TTY configurations.
Solution:
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
// Usage: phantomjs openload.js <video_url> | |
// if that doesn't work try: phantomjs --ssl-protocol=any openload.js <video_url> | |
var separator = ' | '; | |
var page = require('webpage').create(), | |
system = require('system'), | |
id, match; | |
if(system.args.length < 2) { | |
console.error('No URL provided'); |
These steps will provide a read-only OctoPi installation while still having a read/write home directory. In other words, as long as you don't have to update system files, this installation will be fully functional.
- Install OctoPi on a 8GB (or more) SD card and boot it at least once.
- Mount it with a Linux machine (e.g. Ubuntu).
- Use
sudo gparted
and configure the remaining space as EXT4. - There are now three partitions. Mount the last two.
- Move
/home/pi
to the new and empty partition. - Edit
/etc/fstab
:
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
#pragma SPARK_NO_PREPROCESSOR | |
// DS18B20 Thermometer Stuff | |
#include "DallasTemperature.h" | |
#include "OneWire/OneWire.h" | |
#define ONE_WIRE_BUS D1 | |
#define TEMPERATURE_PRECISION 9 | |
OneWire oneWire(ONE_WIRE_BUS); | |
DallasTemperature sensors(&oneWire); | |
DeviceAddress inWaterThermometer = { 0x28, 0x2E, 0x54, 0x0A, 0x06, 0x0, 0x0, 0xFB }; |
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
'use strict'; | |
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev | |
var gulp = require('gulp'), | |
clean = require('gulp-clean'), | |
cleanhtml = require('gulp-cleanhtml'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
stripdebug = require('gulp-strip-debug'), |
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/env ruby | |
require "srt" | |
require "sanitize" | |
REJECT_LINES = [/Best watched using Open Subtitles MKV Player/, | |
/Subtitles downloaded from www.OpenSubtitles.org/, /^Subtitles by/, | |
/www.tvsubtitles.net/, /[email protected]/, /addic7ed/, /allsubs.org/, | |
/www.seriessub.com/, /www.transcripts.subtitle.me.uk/, /~ Bad Wolf Team/, | |
/^Transcript by/, /^Update by /, /UKsubtitles.ru/ | |
] |
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
#Mounting the share is a 2 stage process: | |
# 1. Create a directory that will be the mount point | |
# 2. Mount the share to that directory | |
#Create the mount point: | |
mkdir share_name | |
#Mount the share: | |
mount_smbfs //username:[email protected]/share_name share_name/ |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
NewerOlder