Nov. 5th, 2012

sibuser: (Default)

Каждый раз, как мне надо было обновить данные на сервере, юзал команду scp. Это требовало некоторого времени и внимательности, чтобы не затереть нужные данные.
Решив немножко оптимизировать свою работу, разобрался как смонтировать на локальный комп удаленный каталог.
Теперь можно работать на прямую и это экономит уйму времени.

Connecting to a server across the internet is much more secure using SSH. There is a way that you can mount a folder on a remove server using the SSHFS service.

First we’ll install the module:

sudo apt-get install sshfs

Now we will use the modprobe command to load it

sudo modprobe fuse

We’ll need to set up some permissions in order to access the utilities. Replace <username> with your username.

sudo chown root:fuse /dev/fuse

sudo chmod +x /dev/fusermount

Now we’ll create a directory to mount the remote folder in.

mkdir ~/remoteserv

Now we have the command to actually mount it. You’ll be prompted to save the server key and for your remote password.

sshfs <username>@<ipaddress>:/remotepath ~/remoteserv

sibuser: (Default)
Вот уже некоторое время решаю классические задачи из учебников по программирования на языке С++ на http://www.programr.com/ , но только сейчас посетила мысль "А почему бы мне не сохранять решения?". Ведь пройдет пол года и я не вспомню как их решал. А может я найду более интересное решение? В общем теперь буду сюда писать решения и отмечать тэгами Work, C++. 

 

 

sibuser: (Default)
Write a program that takes input array daily temperatures, as floats. and findout the maximum and minimum values. Example:
1.If array element are: 10.0 11.3 4.5 -2.0 3.6 -3.3 0.0 then the output will be :
Maximum: 11.3
Minimum :-3.3

2.If array element are: 5.0 11.0 12.5 -2.0 3.6 -4.3 9.0 then the output will be :
Maximum: 12.5
Minimum :-4.3

float arr[] = {7, 10.0, 11.3, 4.5, -2.0, 3.6, -3.3, 0.0};
for (size_t i = 1; arr[i] != '\0'; ++i){
 if (MaxTemp < arr[i]){
MaxTemp = arr[i];
}
if (MinTemp > arr[i]) {
MinTemp = arr[i];
    }
}
Потратил 15 минут на решение этой задачи, ошибка спряталась в выводе по умолчанию. Необходимо было убрать лишние переходы на новую строку.

Sibuser

sibuser: (Default)
sibuser

April 2015

S M T W T F S
   12 34
567891011
12131415161718
19202122232425
2627282930  

Most Popular Tags

No cut tags
Page generated Sep. 29th, 2025 03:47 am
Powered by Dreamwidth Studios