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 | |
dir=$1 | |
minGigs=$2 | |
available=`df --sync $dir | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{print $4}'` | |
#10 Gbytes in Kbytes | |
min=$(($minGigs*1024*1024)) | |
if [ $min -gt $available ] |
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 | |
torrent=$1 | |
#destination=$2 | |
destination="root@172.16.52:/streamer/movie/" | |
extension="\ | |
.avi \ | |
.mp4 \ | |
.mkv \ |
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
@echo off | |
title bigFile.bat | |
set /a x=0 | |
del bigFile | |
mkdir bigFile | |
:loopname | |
fsutil file createnew bigFile\F%x%.tmp 1048576 |
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
:wooot | |
ping -n 5 example.com | |
IF "%ERRORLEVEL%"=="0" GOTO :end | |
GOTO :wooot | |
:end |
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/python | |
import mosquitto, sys, datetime | |
min = float(sys.argv[1]) | |
max = float(sys.argv[2]) | |
stopTime = datetime.datetime.strptime(sys.argv[3], "%H:%M").time() |
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
import os, time, mosquitto, subprocess | |
# cronjon | |
# */2 * * * * /usr/bin/python /root/mqttHeartbeat.py 2>&1 > /dev/null | |
pidFile = '/var/run/mqttHeartbeatPid' | |
def on_connect(userdata, flags, rc): | |
print "connected..." |
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/python | |
import Image, sys, random | |
hash = random.choice(['411A7A164505636AB1A8276395B375A3A30BFF32', | |
'79816060EA56D56F2A2148CD45705511079F9BCA', | |
'f5615dfb80ac995787c1b2219a75df7805278dea', | |
'43b21801f59336b9271a6c5113904fb72de99ed3', | |
'938802790a385c49307f34cca4c30f80b03df59c']) | |
if(len(sys.argv) == 4): |
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
# -*- coding: utf-8 -*- | |
import mosquitto | |
def on_connect(client, userdata, rc): | |
client.subscribe("vw/temp/1") | |
def on_message(client, userdata, msg): | |
rgb = colorWheel(scaleTempToColor(float(msg.payload))) | |
client.publish("vw/neo/color", ','.join(str(x) for x in rgb)) |
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
import os, pymongo, mosquitto, json | |
from pymongo import MongoClient | |
client = MongoClient('mongo') | |
records = client.mqttRecord | |
mqttC = mosquitto.Mosquitto("publishMongoStats-"+str(os.getpid())) | |
mqttC.connect("mqtt", 1883, 60) | |
OlderNewer