Questions tagged as 'linux'

1
answer

Script in Python via PHP

I am trying to call a script done in Python via browser with PHP. This script has only one command that serves to turn off my Raspberry Pi. PHP looks like this: <?php exec('sudo python /home/pi/Documents/Programa/Script.py'); ?>...
asked by 20.09.2018 / 20:00
1
answer

How to run the ProcessList periodically from the command line?

Is there any way to see the command SHOW PROCESSLIST of X in X seconds, from the command line? I'm using the Ubuntu 16 Operating System.     
asked by 03.08.2018 / 16:07
2
answers

Write text in Shell Script

I'm doing a Shell Script, and I have to write a lot of lines in a single file, how can I do it in a more automatic way? Well I started doing it in a very manual way: echo "primeira linha do arquivo" >> /diretorio/arquivo.txt echo "segund...
asked by 27.11.2018 / 00:18
1
answer

Return difference between major and minor array values in Assembly

I'm trying to make a code in assembly with arq. x86 using NASM. In this code I should return the difference between the highest value and lowest value of an array, as below. However, while rolling it is returning 14 for the example below a...
asked by 17.06.2018 / 21:52
2
answers

Create directories in c ++ with Linux

I want to create a directory in the home folder with c ++, but there is no way to do this in a cross-platform way. I have found that in the "sys / stat.h" library has the mkdir function that creates directories, but in addition to the directory...
asked by 22.05.2018 / 19:26
2
answers

Specific libraries and C compiler defaults in Windows and Linux

I'd like to know why conio.h and strrev() of library string.h , there is no Linux. Is there anything else that can only be done in Windows? And why this happens? Is there anything that can only be done on Linux? I did some...
asked by 04.06.2018 / 15:57
1
answer

Program without interruption of signal SIGINT

I'm trying to write a program that stays in an infinite loop, and can not be interrupted by the SIGINT (^ C keypad) signal. What I have so far is the following code: void sigint(); int main() { int pid; pid = fork(); if(pid ==...
asked by 21.03.2018 / 12:57
1
answer

Unix Grep command handling the output if there is no result

Good morning !! I'm creating a script and I need when I make a grep on a line and can not find it, it returns the parameter I looked for! grep "192.0.0.1" /file.txt In the .txt file it does not have the string "192.0.0.1" I want it to retu...
asked by 12.02.2018 / 14:39
2
answers

How to block the sending of package-lock.json by gitignore?

I'm not able to "ignore" sending package-lock.json to gitlab, when I run git status it appears to be sent to me. Here is a print showing .gitignore and my terminal when running git status. .gitignorefile     
asked by 05.06.2018 / 22:45
1
answer

Zip folder except for a subdirectory

To a folder in Linux use the command below. zip -r arquivoZipado.zip pastaSerZipada/ How can I zip , except a subdirectory of folderSerZipada ?     
asked by 08.06.2018 / 13:53