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 | |
# | |
# Script to control the fan on the XG-7100. | |
# The EMC2104 is accessed via the smbus on the ICH. | |
# | |
# SteveW 24/01/2019 | |
# | |
# Variables | |
smb_dev="/dev/null" |
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 | |
/* | |
Script that syncs remote zfs snapshots to a local zfs target. | |
Can sync remote encrypted datasets without ever needing to know the key on the local machine. | |
It will automatically search for the last snapshot in common with the remote host and only sync the differences. | |
If it doesn't find any local ones or has none in common, it will sync the oldest snapshot of the remote machine. | |
Meant to be run as cronjob |
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 | |
$remoteIP = $argv[1]; | |
$remoteDataset = $argv[2]; | |
$localDataset = $argv[3]; | |
if($argc!=4) exit('usage: php sync.php <remote ip> <remote dataset> <local dataset>'.PHP_EOL); | |
$cmd_zfs = "zfs list -t snapshot $remoteDataset | cut -d ' ' -f 1 | cut -d '@' -f 2 | tail -n +2"; |
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 | |
while :; do | |
verf=$(cat /dev/urandom | tr -dc '0-9' | fold -w 8 | head -n 1) | |
pin=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1) | |
ip=$(printf "%d.%d.%d.%d\n" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))") | |
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 requests | |
import json | |
url = 'https://nsfw-categorize.it/api/upload' | |
files = {'image':('1.jpg', open('1.jpg', 'rb'))} | |
r = requests.post(url, files=files) | |
result = json.loads(r.content) | |
if(result["status"]=='OK'): | |
print("This image is classified as "+str(result["data"]["classification"])) |
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 request = require('request') | |
const fs = require('fs'); | |
var req = request.post("https://nsfw-categorize.it/api/upload", function (err, resp, body) { | |
if (err) { | |
console.log('Error!'); | |
} else { | |
var json = JSON.parse(body) | |
if(json.status=='OK') | |
console.log("This image has been classified as",json.data.classification) |
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 | |
# Test image1.jpg | |
curl -s -F "image=@image1.jpg" "https://nsfw-categorize.it/api/upload" | |
# Let the API analyze an externally hosted image | |
curl -s "https://nsfw-categorize.it/api/upload?url=https://i.imgur.com/wubvFTM.jpeg" | |
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 | |
$nsfw = new NSFW(); | |
// Example 1: upload images to check later | |
// | |
$results = $nsfw->uploadFile('image1.jpg',true); | |
if(is_array($results)) | |
echo "Classification done. Image is {$results['classification']}".PHP_EOL; |
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 <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#define wifi_ssid "YourWIfiName" | |
#define wifi_password "YourWifiPassword" | |
const char* mqttServer = "192.168.1.61"; //IP of your MQTT Server | |
const int mqttPort = 1883; // Port of your MQTT server | |
//pins change these if you used different pins |
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
### Keybase proof | |
I hereby claim: | |
* I am geek-at on github. | |
* I am geek_at (https://keybase.io/geek_at) on keybase. | |
* I have a public key ASAvzF9dHs0BRtZBYM5m2LiyWafirsvb6qDoy5Bn7B5p6wo | |
To claim this, I am signing this object: |
NewerOlder