Skip to content

sed fails with errors

I’m trying to replace the next string with sed in all the files in the current directory : (including apostrophe) ‘Control_Reports_Pg.C_Table_Title_Date’ with the string : timeofday()::varchar(250) I tried to escape the special characters ‘ ( ) with the command : The error I got : sed:…

Read the log files and get the entries between two dates

I want to extract some information from the access log file that matches a keyword and between two dates. For ex. I want to find log entries between two dates that contains text “passwd”. For now, I am using the following command but not getting the correct results: Date format is [22/Feb/2017:17:…

How to get local codepage in linux?

In Windows, I can use GetAPC function to get the local codepage. But how should I do to get local codepage in Linux? Thanks. Answer Linux does not use code page identifiers. It has locale identifiers, but different processes can have different locales and a process may be using different locales in different …

Problems establishing connection with DB

Platform: LINUX. I am a beginner of MongoDB and pymongo. After installing pymongo, here is a simple test I tried on ipython: At this point, it chokes. And in the end, spits out a “Error 111: connection refused” error. So, I tried invoking MongoDB straight from the terminal and I still got the erro…

Linux shell script regex match

I have a text file. I want to get lines starting with specific format. I just want to get lines that have x/x/x format. x is a number. But this regex is not working. It is always giving no match : File is : Answer Don’t use bash if you can use a better tool: But if you have to

Issues importing python-pptx on Linux (Ubuntu 17)

I am trying to import the python pptx library in a python programm. I installed it using pip before, which gave me the following output: So this seems to be a success. But as I am trying to import the module using the following code: It says No module named ‘pptx’. It must have something to do wit…