[Solved] Download files from url of site directory

[ad_1] 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 [ad_2] solved Download files from url of … Read more

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

[ad_1] 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 … Read more

[Solved] Sending NULL data over a socket

[ad_1] 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 … Read more

[Solved] Create directory structure in unix [closed]

[ad_1] 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 [ad_2] solved Create directory structure in unix [closed]

[Solved] Proper way to make this a shell script

[ad_1] 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 … Read more

[Solved] Grep certain files only

[ad_1] 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 [ad_2] solved Grep certain files only

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

[ad_1] 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 … Read more