I am sure that there are no extra spaces before or after your hostname(S) in the host file, and using ssh mdw can connect to mdw. The /etc/hosts is like this: The error log: please. Answer How many hosts there are in your greenplum. Your /etc/hosts doesn’t contain any information about mdw and sdw. Assu…
How to use grep in shell with -e option set
In bash -e option stops executing after an error and grep commands returns a non-zero status in case it does not find for the pattern it is looking for. I want to use grep inside an if statement, something like If i use $? to get the statement of last command, then the execution stops after last command as gr…
Exclude directory when grepping with zsh globbing
I have some file structure which contains projects with build folders at various depths. I’m trying to use zsh (extended) globbing to exclude files in build folders. I tried using the following command and many other variants: grep “string” (^build/)# I’m reading this as “Any fol…
VTK/ITK project Requested modules not available on ubuntu
I would like to configure with cmake-gui a VTK/ITK project on ubuntu with QT and I have this error message. I don’t understand. How I can pass this error ? Answer When configuring VTK with CMake, you need to enable either vtkGUISupportQtOpenGL or VTK_Group_Qt. You can also change that setting now, then …
How do I locate a string in a binary file? (No, not the strings command.)
I know about the very useful “strings” command. It will print all the printable strings in a binary file. But what I want is a command that will tell me the location (in bytes or whatever — I’ll take anything.) of a string in a binary file. Is there a way to get this in Linux? Answer T…
AWK – Show lines where column contains a specific string
I have a document (.txt) composed like that. And I want to show some information by column. For example, I have some different information in “info3” shield, I want to see only the lines who are composed by “test” in “info3” column. I think I have to use sort but I’m …
Not able to connect Php application with SharePoint
I am a php developer have no experience with Share Point. I have follow these two links to get Data from Share Point into my Php application. stackoverflow question here. A Library for Share Point here. Share Point team give me 2 IP address. What they said is, I have to login at Forti Client with first IP the…
Renaming long file names in bulk
I have file names like: I want something like: Are there good ways to rename these files in linux? Answer You could try using a loop to extract the important part of the filename: This will simply give you a new list of filenames. You can then move them: To break this down a little: loop over the *.gz files
Executing HTTP POST using curl in bash with environment variables as data
I am trying to make a HTTP POST to a server using curl but I can’t seem to make it work. The server has the Content-Type set to application/json so I need to send a json object to the server. My object looks something like this If I try to use the following command it works But if I store
How to use get_random_bytes() in linux kernel module?
I have made simple kernel module. I printed out rand variable using seq_printf function. cb_funct function is called five times. Below is the result. random number : 66 random number : -5 random number : 135 random number : 178 random number : -42 Why negative variable is printed out? How to use get_random_by…