This file contains hidden or 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
groups: | |
- name: ping | |
rules: | |
- alert: host_down | |
expr: ping_loss_percent{ip_version="4",job="ping"} == 1 | |
for: 10s | |
labels: | |
severity: page | |
annotations: | |
summary: "{{ $labels.target }} / {{ $labels.ip }}" |
This file contains hidden or 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
global: | |
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. | |
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. | |
# scrape_timeout is set to the global default (10s). | |
# Alertmanager configuration | |
alerting: | |
alertmanagers: | |
- static_configs: | |
- targets: | |
- localhost:9093 |
This file contains hidden or 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 iptables -F | |
sudo iptables -P INPUT ACCEPT |
This file contains hidden or 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 <avr/io.h> | |
#include <util/delay.h> | |
#include <avr/interrupt.h> | |
#ifndef _UART_H_ | |
#define _UART_H_ | |
#define UART_RX_ENABLED (1) // Enable UART RX | |
#define UART_TX_ENABLED (1) // Enable UART TX |
This file contains hidden or 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
package main | |
import ( | |
"github.com/gorilla/mux" | |
"log" | |
"net/http" | |
) | |
func main() { | |
r := mux.NewRouter() |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"github.com/itchyny/volume-go" | |
"github.com/micmonay/keybd_event" | |
"github.com/tarm/serial" | |
"log" | |
"strconv" | |
"strings" |
This file contains hidden or 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
#define MESSAGE_TOTAL_LENGTH 301 | |
#include <SoftwareSerial.h> | |
SoftwareSerial mSerial(2, 3); // RX, TX | |
char message[MESSAGE_TOTAL_LENGTH]; | |
int messageLen = 0; | |
bool readyToDeleteAllMessages = false; | |
bool messageStartsWith(const char *str) { |
This file contains hidden or 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
package main | |
import ( | |
"github.com/tarm/serial" | |
"log" | |
"strings" | |
"time" | |
) | |
var phoneNumers = map[string]bool{ |
This file contains hidden or 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
#define MESSAGE_TOTAL_LENGTH 301 | |
#define BIT_PERIOD 350 | |
#define DATA_PIN 4 | |
#include <SoftwareSerial.h> | |
int data[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; | |
int size = sizeof(data) / sizeof(int); | |
SoftwareSerial mSerial(2, 3); // RX, TX |
This file contains hidden or 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
var SerialPort = require('serialport'); | |
var createInterface = require('readline').createInterface; | |
var moment = require('moment'); | |
const PHONE_NUMBER = "+989XXXXXXXXX"; | |
var port = new SerialPort('COM3'); | |
var lineReader = createInterface({ | |
input: port |