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
class PID_classic { | |
private: | |
float error_bak = 0; | |
float error = 0; | |
float error_integration = 0; | |
float error_derivate = 0; | |
public: | |
float target =0; // user target value | |
float system_feedback = 0; // system sensor |
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 <PubSubClient.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
const char* wifi_ssid = "XXXXX"; | |
const char* wifi_password = "XXXXX"; | |
char* mqtt_server = "iot.eclipse.org"; | |
char* mqtt_user = ""; |
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
#!/bin/sh | |
# save dog.sh in /root/dog.sh. | |
# You can use winscp with scp protocol to do this. | |
# Using ssh set executation permission and replace the crontab: | |
# chmod +x /root/dog.sh | |
# echo "* * * * * /root/dog.sh" | crontab - | |
# fix wpad / wpad-mini / hostapd stop working bug | |
logread -l 100 | grep -n "IEEE 802.11: did not acknowledge authentication response" |
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
void setup(){ | |
#define RTC_MEM ((volatile uint32_t*)0x60001200) | |
#define RTC_USER_DATA_START_OFFSET 32 | |
#define RTC_USER_DATA_END_OFFSET 126 | |
#define RTC_USER_DATA_CRC_OFFSET 127 | |
//print current values | |
for(int i=0;i<128;i++){ | |
Serial.printf("offset %d: %04x\r\n",i,RTC_MEM[i]); | |
} |
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
#!/usr/bin/python | |
import threading | |
import time | |
import socket | |
import os | |
import sys | |
import resource | |
import subprocess |
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
ulimit -s 256 | |
ulimit -i 1000000 | |
ulimit -n 1000000 | |
ulimit -a | |
echo 1000000 > /proc/sys/kernel/threads-max | |
cat /proc/sys/kernel/threads-max | |
echo 1000000 > /proc/sys/vm/max_map_count | |
cat /proc/sys/vm/max_map_count | |
echo 1000000 > /proc/sys/kernel/pid_max | |
cat /proc/sys/kernel/pid_max |
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
#! /bin/bash | |
# CREATE openssl.cnf if it doesn't exist | |
function banner() | |
{ | |
echo | |
echo "*****************************************************************"; | |
echo "$@" | |
echo "*****************************************************************"; |
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
#!/bin/bash | |
#add repo | |
echo deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main > /etc/apt/sources.list.d/pgdg.list | |
#add key for repo | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
#get new list of packages | |
sudo apt-get update | |
#install | |
apt-get install postgresql-9.4 |
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
#!/bin/bash | |
#apt-get update | |
apt-get install -y openvpn easy-rsa | |
make-cadir /opt/openvpn-ca | |
cd /opt/openvpn-ca | |
source vars | |
./clean-all | |
./build-ca --batch | |
./build-key-server --batch server |
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
server 10.8.0.0 255.255.0.0 | |
port 1195 | |
proto tcp | |
dev tun | |
topology subnet | |
max-clients 2000 | |
comp-lzo | |
push "comp-lzo" |