sudo nmcli dev wifi hotspot ifname wlan0 con-name "my-hotspot" ssid "my-hotspot" password "My HotsPoT Strong Password"
More info here
| #require "plc_engine/daemons/plc_reading_engine" | |
| #require "plc_engine/daemons/plc_writing_engine" | |
| require 'colorize' | |
| require 'rmodbus' | |
| ip="10.0.0.2" | |
| sl1 = ModBus::TCPClient.new(ip).with_slave(1) | |
| sl2 = ModBus::TCPClient.new(ip).with_slave(1) | |
| Thread.new do |
| require 'colorize' | |
| require 'rmodbus' | |
| require 'timers' | |
| ip="10.0.0.2" | |
| sl1 = ModBus::TCPClient.new(ip).with_slave(1) | |
| timers = Timers::Group.new | |
| now_and_every_five_seconds = timers.now_and_every(0.001) { | |
| begin | |
| sl1.holding_registers[0..1000]; puts "read #{Time.now.to_i}".green | |
| rescue Exception =>e |
| pg_dump --host localhost --username "postgres" --format custom --no-privileges --file "/tmp/scada_bys_o239_14_11_2017.backup" "scada_bys" -W |
| pg_dump --host localhost --username "postgres" --format custom --no-privileges --file "/tmp/scada_bys_o239_14_11_2017.backup" "scada_bys" -W |
| ===================== Documentación ================================ | |
| Gema serialport: http://www.rubydoc.info/gems/serialport/SerialPort | |
| IO: http://www.rubydoc.info/stdlib/core/IO | |
| ===================== Documentación ================================ | |
| 1- Simulación puerto serial en linux: | |
| sudo apt-get install socat | |
| #en una consola: | |
| socat -d -d pty,raw,mode=777 pty,raw,mode=777 | |
| 2017/12/13 14:19:54 socat[3641] N PTY is /dev/pts/**21** | |
| 2017/12/13 14:19:54 socat[3641] N PTY is /dev/pts/**22** |
sudo nmcli dev wifi hotspot ifname wlan0 con-name "my-hotspot" ssid "my-hotspot" password "My HotsPoT Strong Password"
More info here
Hay que seguir las notas en https://docs.docker.com/installation/ para el sistema operativo que esten ejecutando.
Vamos a utilizar un container ya listo para trabajar con Postgresql. El siguiente comando se encarga de descargar el container y de ejecutarlo. Si es necesario cambiar el valor de las variables POSTGRES_PASSWORD y POSTGRES_USER a unos más adecuados
$ docker run --name db -e POSTGRES_PASSWORD=manager -e POSTGRES_USER=rails -d postgres
| require 'timers' | |
| timers_scan = Timers::Group.new | |
| scan=[3.0] | |
| scan_started=[] | |
| sleep_time=4.0 | |
| last_time=Time.now.to_f | |
| loop { |
| <link rel="import" href="../paper-button/paper-button.html"> | |
| <link rel="import" href="../paper-ripple/paper-ripple.html"> | |
| <link rel="import" href="../paper-toast/paper-toast.html"> | |
| <link rel="import" href="../core-icons/core-icons.html"> | |
| <link rel="import" href="../core-icons/av-icons.html"> | |
| <link rel="import" href="../paper-fab/paper-fab.html"> | |
| <link rel="import" href="../core-menu-button/core-menu-button.html"> | |
| <link rel="import" href="../core-item/core-item.html"> | |
| <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| <link rel="import" href="../core-toolbar/core-toolbar.html"> |