In principle what I want is very simple. Two executables ./read and ./write respectively read and write from a resource (let’s say a file). Using flock(2) it is easy to prevent race conditions between arbitrary invocations of ./read and ./write at arbitrary times. The requirement is that each invocation…
Tag: linux
Strange output in shell script
I’m encountering a very strange thing while writing a shell script. Initially I have the following script. When I ran this script, every 60 seconds, I’ll see the $DATETIME,$FIELD1 values in my log file. What is very strange, is that every 30 seconds or so, after the first minute has passed, I̵…
iwlib trying to get access point name – u.addr.sa_data contains suspicious characters resulting empty QString
I have following simple method: Now, I would like to extract Access Point MAC address using this method from wrq structure – its u.addr.sa_data member, which (I THINK SO, AM NOT SURE) containts MAC address of Access Point. Follownig debug screenshot shows value of u.addr.sa_data member: Why am I getting…
Binding callbacks to minimize and maximize events in Toplevel windows
I’ve read through related answers and it seems that the accepted way to do this is by binding callbacks to <Map> and <Unmap> events in the Toplevel widget. I’ve tried the following but to no effect: I’m running python 2.7 on Linux. Could this be related to window manager code in …
infinite loop malloc in a 32 bit kernel with 4 Gb RAM and 10 Gb Swap Partition
Let’s say I have a 32-bit kernel. 4 Gb RAM, 10 Gb Swap Partition. I have a process which has malloc in an infinite loop. So, eventually system’s OOM would kill the process. Here are two arguments. Argument 1: Since, it’s 32 bit Kernel with a Virtual address split of 3:1 i.e. 3Gb for user spa…
mesos-master can not found mesos-slave, and elect a new leader in a short interval
I follow this doc to setup mesos cluster. There are three vm(ubuntu 12, centos 6.5, centos 7.2). config in each mathine: After start zookeeper, mesos-master and mesos-slave in three vm, I can view the mesos webui(10.142.55.190:5050), but agents count is 0. After a little time, mesos page get error: Failed to …
How can I write CUDA in Visual Studio on Windows and deploy it to Linux?
I’m assisting a professor in setting up a lab for a class in parallel programming. The process will be the following: A student logs into a virtual machine running Windows 7. This machine has no GPUs available. It has version 7.5 of the CUDA toolkit installed along with Visual Studio 2013. Students are …
Does linux “gdb a.out param1 param2” pass param1 and 2 to “gdb” or “a.out”?
Is there any case that param1 and param2 are passed to gdb, and some cases passed to a.out, and some cases, 1 for each? How does linux shell parse and decide which param for which program? Thanks. Answer How does linux shell parse and decide which param for which program? Linux shell simply passes all params …
What is text syntax in ImageMagick
I use following code convert text to image what is x, y means in text x, y ‘string’? Answer Method 1 label: You can either use label: which provides a canvas large enough to hold your text – notice I didn’t provide a canvas size: Method 2 -annotate Or, you can use -annotate to write on…
Does Linux system load account for throttling of the Completely Fair Scheduler?
On Linux, system load is defined as the exponentially decaying average of num runnable processes + num uninterruptable processes. I am wondering if it will correctly account for CFS cgroup quota used to limit the number of cpu shares a group of processes may use in a given interval. In other word: If a proces…