[Solved] Download files from url of site directory

You must keep in mind: if your web-server disallows to scan a directory then you couldn’t get file names. But if the directory is shared in web-server you can get a list of files with using wget command. For example: wget -nv -r -np ‘*.*’ https://example.com/directory/ 2 solved Download files from url of site directory

[Solved] Find rows with the same value in a column in two files

Let’s say your dataset is big in both dimensions – rows and columns. Then you want to use join. To use join, you have to sort your data first. Something along those lines: <File1.txt sort -k2,2 > File1-sorted.txt <File2.txt sort -k3,3 -S1G > File2-sorted.txt join -1 2 -2 3 File1-sorted.txt File2-sorted.txt > matches.txt The sort … Read more

[Solved] How do I stop a process running using Perl? [closed]

Perl extensions are typically .pl or .pm right? .py is for python I think. Anyway, you can kill a specified program in a Unix environment with something like: system ‘killall’, ‘some_program_name’; or system ‘kill’, ‘-15’, $pid; if the variable $pid holds the pid of your program. 4 solved How do I stop a process running … Read more

[Solved] Sending NULL data over a socket

Try WriteData(std::string(“\0”,1)); using your function or even: const char null_data(0); send(newsockfd,&null_data,1,0); to send it directly. WriteData(“00000000”); Will actually sends 8 octets of 48 [decimal] (assuming your platform is ASCII which all modern systems are compatible with). However \0 is the escape sequence used in string literals to represent the null character (that is the zero … Read more

[Solved] Create directory structure in unix [closed]

current_year=$(date +%Y) next_month=$(($(date +%m) + 1)) locale_next_month=$(date -d$current_year/$next_month/1 +%B) for day_of_month in $(seq 1 31) do if day_of_year=$(date -d$current_year/$next_month/$day_of_month +%j 2> /dev/null) then mkdir -p /home/applications/app_name/$current_year/$locale_next_month/$day_of_year fi done 1 solved Create directory structure in unix [closed]

[Solved] Proper way to make this a shell script

in some directory of your choice do touch [script_name].sh then enter the following into the script #!/bin/bash #if not sudo or root yum fails if [ “$EUID” -ne 0 ] then echo “Please run as root” exit fi yum update -y yum install httpd -y service httpd start yum install mysql-server -y && service mysqld … Read more

[Solved] Grep certain files only

If this is for perl code, as your tags imply, then you would typically use grep: my @all = qw( 12345_lrg.jpg 12445_sml.jpg 14445_sml.jpg 12345_lrg.jpg 42345_lrg.jpg ); my @sml = grep /_sml\.jpg$/i, @all; 2 solved Grep certain files only

[Solved] why get I segmentation fault (core dumped) on compiling my code C (linux) [closed]

you declared the function: int blit_image(char chemin[15],SDL_Surface *fenetre,int posx,int posy) { So that that parameter #1 has 15 characters. But when you call it, you call it with: blit_image(“resources/images/fondblanc.bmp”,fenetre,0,0); That filename is 31-characters by my counting, and will not fit into 15 characters. I also added some printf-statements to your code which will help you … Read more