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 | |
/** | |
* FileServe | |
* | |
* Class that serves a file from disk to a client. | |
* | |
* @package FileServe | |
* @author Kenny <[email protected]> | |
* @license The Unlicense (http://unlicense.org) | |
*/ |
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 | |
/* wit.ai speech recognition in PHP */ | |
$request = curl_init('https://api.wit.ai/speech'); | |
$headers[] = 'Authorization: Bearer YOURAPIKEY'; | |
$headers[] = 'Content-Type: audio/wav'; | |
curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($request, CURLOPT_POSTFIELDS, file_get_contents("soundfile.wav")); | |
curl_setopt($request, CURLOPT_HTTPHEADER, $headers); |
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 | |
$chat = json_decode(file_get_contents("php://input"))->message->chat->id; | |
header("Content-Type: application/json"); | |
echo json_encode(array("method" => "sendMessage", "text" => "Hello World", "chat_id" => $chat)); |
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 | |
class Telegram { | |
const API_ROOT = "https://api.telegram.org/bot%KEY%/%METHOD%"; | |
private $botkey; | |
private $methods = [ | |
"getUpdates" => [ | |
"meta" => [ | |
"type" => "POST" | |
], |
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 | |
class CheckMKLocalcheck { | |
private $text = "Value returned: :value:"; | |
private $metrics = array(); | |
private $name; | |
private $value; | |
private $kpis = array( | |
self::STATE_WARN => "1", | |
self::STATE_CRIT => "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
<?php | |
echo $output = (new CheckMKLocalcheck("test-email-rtt")) | |
->setValue(305) | |
->setText("Some other text: :value:") | |
->setMetric("seconds", 20) | |
->setKPI(CheckMKLocalcheck::STATE_WARN, 300) | |
->setKPI(CheckMKLocalcheck::STATE_CRIT, 500) | |
->export() . 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 <WiFiUDP.h> | |
#include <Adafruit_Sensor.h> | |
#include <DHT.h> | |
#include <DHT_U.h> | |
WiFiUDP Udp; | |
const char* ssid = "ky-fi devices"; | |
const char* password = "passwordremovedyayayaya"; |
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
FQDNLookup true | |
LoadPlugin syslog | |
<Plugin syslog> | |
LogLevel info | |
</Plugin> | |
LoadPlugin cpu | |
LoadPlugin df | |
LoadPlugin disk |
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 | |
CYAN=$(echo -ne "\033[00;36m") | |
GREEN=$(echo -en '\033[01;32m') | |
MAG=$(echo -en '\033[01;35m') | |
YEL=$(echo -en '\033[00;33m') | |
NOCOL=$(echo -ne "\E[0m") | |
CREATED=$(date) | |
cd /vz |
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/expect | |
set username [lindex $argv 0] | |
set newpassword [lindex $argv 1] | |
spawn telnet 127.0.0.1 106 | |
expect "*ready*" | |
send "USER postmaster\r" | |
expect "300 please send the PASS" | |
send "PASS postmaster_password_here\r" |
OlderNewer