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
const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); | |
const tz = require('zigbee-herdsman-converters/converters/toZigbee'); | |
const exposes = require('zigbee-herdsman-converters/lib/exposes'); | |
const reporting = require('zigbee-herdsman-converters/lib/reporting'); | |
const extend = require('zigbee-herdsman-converters/lib/extend'); | |
const utils = require('zigbee-herdsman-converters/lib/utils'); | |
const e = exposes.presets; | |
const ea = exposes.access; | |
const fzLocal = { |
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 -e | |
# /usr/local/sbin/raspi-monitor | |
# Script to enable and disable the HDMI signal of the Raspberry PI | |
# Inspiration: http://www.raspberrypi.org/forums/viewtopic.php?t=16472&p=176258 | |
CMD="$1" | |
function on { | |
/opt/vc/bin/tvservice --preferred |
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 | |
set -e | |
#DOWNLOAD_COMMAND='curl -s -S -C - -L -O' | |
DOWNLOAD_COMMAND='wget --quiet --continue' | |
SIMULTANEOUS_DOWNLOADS=3 | |
one-word-per-line() { | |
xargs -n 1 echo $@ | |
} |
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 | |
# Tip: An executable script given a `.command` suffix will be double-clickable on Mac OS X | |
REMOTE_SSH_USER=pi | |
REMOTE_SSH_HOST=192.168.0.17 | |
REMOTE_VNC_SERVER_PORT=5900 | |
LOCAL_VNC_PORT=5901 | |
# This is the RealVNC Viewer, works with Chicken of the VNC too | |
LOCAL_VNC_CLIENT=/Applications/VNC\ Viewer.app/Contents/MacOS/vncviewer |
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 -ex | |
# | |
# Example usage: | |
# $ ./dropbox-reconciliation.sh 192.168.0.17 | |
# | |
REMOTE_HOST=$1 | |
EXCLUDES="-name '*.DS_Store' -or -path './.dropbox.cache*' -or -name 'Icon*' -or -name .dropbox" |
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
diff --git a/Lib/socket.py b/Lib/socket.py | |
index bd364e7..fd432f6 100644 | |
--- a/Lib/socket.py | |
+++ b/Lib/socket.py | |
@@ -92,6 +92,7 @@ except ImportError: | |
errno = None | |
EBADF = getattr(errno, 'EBADF', 9) | |
EINTR = getattr(errno, 'EINTR', 4) | |
+EAGAIN = getattr(errno, 'EAGAIN', 35) |
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
sudo sysctl fs.inotify.max_user_watches=524288 | |
sudo inotifywait -r -m --format "%e;%w%f" /bin /boot /etc /home /lib /lib64 /opt /root /sbin /srv /tmp /usr /var | ./dirstats.py |
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
(defn euler074 [up-to chain-len] (let [right-chain-len? #(= chain-len (count %)) | |
start-nrs (range 1 (inc up-to))] (count (filter right-chain-len? (map (fn | |
[start-nr] (loop [chain #{start-nr} prev-trm start-nr] (let [next-trm (reduce + | |
(map (memoize (fn [n] (if (= n 0) 1 (reduce * (range 1 (inc n)))))) (map #(- | |
(int %) (int \0)) (str prev-trm))))] (if (contains? chain next-trm) chain (recur | |
(conj chain next-trm) next-trm))))) start-nrs))))) | |
(euler074 1000000 60) |
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
(ns euler002.euler) | |
(defn- fib-fast | |
[i a b limit] | |
(if | |
(< i limit) | |
(fib-fast (inc i) b (+ a b) limit) | |
b)) | |
(defn fib |
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
(ns euler001.euler) | |
(defn- zerorem? | |
[numer denom] | |
(= 0 (rem numer denom))) | |
(defn divis? | |
[a] | |
(or | |
(zerorem? a 3) |
NewerOlder