[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4678: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4680: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4681: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4682: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
virt2real.ru • Просмотр темы - Где посмотреть пример программы на с/с++ для vir2real ?
Страница 2 из 5

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 21 сен 2013, 20:06
Mirmik
Ох... Это что... Я все инклуды обрезал??? Ща верну...
***********************************

Впилил назад

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>

Наверное половина из них не нужна, но это прога раз двадцать переписывалась, так что я не помню, что нужно, а что нет...

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 22 сен 2013, 12:32
Mirmik
Следующий expect скрипт автоматизирует работу по компиляции и заливке нашего хелловорлда на удаленную машину...


#!/usr/bin/expect -f

#prog compilation
spawn virt-gcc hello.c -o hello
# connect via scp
spawn scp hello "root@192.168.1.128:/root/"
#######################
expect {
-re ".*es.*o.*" {
exp_send "yes\r"
exp_continue
}
-re ".*sword.*" {
exp_send "PASSWORD\r"
}
}
interact

Честно говоря, я сам не особо понимаю, как оно работает...
... Если вкратце, вызов spawn выполняет команду, а
вызов expect позволяет висеть на линии. Если приходит запрос от удаленной машины, expect сравнивает запрос с шаблонами и если находит соответствие выполняет прописанные действия... но...
-re ".*sword.*" {
Что сие означает и почему оно работает... Для меня тайна.

З.Ы. Установка expect:
apt-get install expect

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 22 сен 2013, 18:26
merofeev

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 08 окт 2013, 16:25
Alyoha
А не могли бы дать пример кода на c/c++, чтобы программно помигать светодиодом, или, как тааам, подергать ногами, ногой, хотя бы одной!!!
Плиз!
До полного ощущения таинства!

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 08 окт 2013, 17:48
Noor
А я тут на HiAsm пробую писать под виндой. Вебморду управляющую пинами и считывающую данные примо из файлов.

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 08 окт 2013, 19:05
Smit

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 08 окт 2013, 20:05
Noor
А еще есть под линукс. Там вообще все сразу под среду можно писать

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 02 дек 2013, 03:07
Alyoha
Подскажите, пишу в putty ssh:
scp ./prg root@192.168.1.128:/root/ (Предполагается, что 192.168.1.128 -адрес ЦМ)
в ответе: не могу найти файл ./prg

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 02 дек 2013, 03:41
Gol

Re: Где посмотреть пример программы на с/с++ для vir2real ?

СообщениеДобавлено: 02 дек 2013, 17:13
Alyoha