I am working on one bash script, in which I have to use the regular expression to match string and then store the output in a variable to reuse it. here is my script, I tried this many ways, but I am getting error : ./check.sh: MET-3-get-issue-id-from-branch-name: not found if I run individual grep command th…
Tag: linux
Is it safe to assume memory page size is a power of two?
I am currently working on a portable C program which makes use of the memory page size (as returned by sysconf(_SC_PAGESIZE)). I know most often page size is a power of two to allow efficient management using bitwise operations; I found no guarantee of this anywhere, though. So how safe is it to assume page s…
client stops connecting to server after 2-3 successful connections. socket programming in c
I am trying out simple client-server program using socket programming in c. The program works fine when I execute server first and then client but after two to three successful executions, the client stops connecting to the server. This again starts working if I execute the programs after a certain amount of …
How to kill a process in a system call?
I found out that sys_kill can be used to kill process from a system call, but when i compile the following code, i get the following error: Answer It is often not possible to call the entry point of a system call from the kernel, since the API is for use from user space. Sometimes the functionality is provide…
Calculating a sum of numbers in C shell
I’m trying to calculate a sum numbers positioned on separate lines using C shell. I must do it with specific commands using pipes. There is a number of commands: comand.. | comand.. | (comands…) printing lines in the following form: The result should be 22, since 1 + 2 + 8 + 4 + 7 = 22. I tried &#…
datanode[slave] running but connect namenode[master]
i can start hadoop sucess but datanode[slave] can’t connect namenode[master] detail /etc/hosts core-site.xml and hdfs-site.xml Answer 1) check if firewall is restricting port if so, flush it To open 9000, 2) check namenode logs for any issues under /var/log/hadoop
Netbeans Cpp compiles and runs project, but not test with cppunit
I have a C++ project using libraries such as wiringPi and MySQL Connector. My regular project compiles normally when I run it. When I try to Test one of my tests, it fails building the project. Here’s the output: The tests used to work before the implementation of the DatabaseAdapter & SerialDriver …
How to run a python script with Raspberry Pi until we stop it manually
Currently I am working with both Raspberry Pi and Arduino at the moment. For Arduino in some cases, if we start running the script, then it will run until we stop them manually. I am wondering if there is a way to do the same with a Raspberry Pi when using it with Python. For Raspberry Pi, when I use,
How we can change OS for Google App Engine flexible? Or can we do this at all?
The one I always ends with is: but I need some another version with glibc 2.14. The current’s one glibc is 2.13: And I can’t upgrade glibc on this OS, because after apt-get update and apt-get install libc6 I getting this: And I can’t modify sources.list because of: So all I need is another O…
How to add text at the end of each line after skipping Last N characters
I’m on Linux command line and I have log file with following content I want to add date before Time Stamp for every line Answer Something like this: sed -r “s/([0-9]+{1}:[0-9]+{1}[A-Z]{2}.*$)/01 Oct 2016 1/g” test.txt > new.txt Where text.txt is your log file and “01 Oct 2016 ”…