I guess there should be some standard method for this, just to avoid everybody retyping dull constants for their applications. 😉 I am looking for a function (usable in a php web app on linux) that can take two ISO639 language codes and returns the name of the first language in the second language, i.e. foo(&#…
Tag: linux
Are mlock()-ed pages static, or can they be moved in physical RAM?
According the the mlock() man page: All pages that contain a part of the specified address range are guaranteed to be resident in RAM when the call returns successfully; the pages are guaranteed to stay in RAM until later unlocked. Does this also guarantee that the physical address of these pages is constant …
Why XGrabKey generates extra focus-out and focus-in events?
Does anyone know an xlib function to trap a keypress event without losing the original focus? How to get rid of it? (or “to use XGrabKey() without generating Grab-style focusout”?) (or “How to get rid of NotifyGrab and NotifyUngrab focus events at system level?) The XGrabKey will lose focus …
how to give more than one c file as input to GNU Cflow?
I was able to generate the callgraph of one file using gnu – cflow, but I was not able to find out how to generate the call graph for multiple files using cflow. I tried following cflow test.c,hello.c It generates the callgraph for test.c and not creating it for hello.c cflow test.c hello.c It generates…
Linux: Use parameter as file shortcut
Cheers everyone 🙂 I’m trying to make a linux script. This script shall be called with one parameter, a file stored in my home directory. I can’t seem to use So i have this variable $var1 and I want to save it in a file that does exist and its name is given in $1 Anyone help me please! Answer
connect() returns “Operation now in progress” on blocking socket?
I have a blocking socket (at least it appears so in following code): And this is from log: Mar 6 10:42:04 tcpclient: fcntl ret=0, ret & O_NONBLOCK = 0 Mar 6 10:42:04 tcpclient: after select fcntl ret=0, ret & O_NONBLOCK = 0 Mar 6 10:42:14 tcpclient: authenticate: error on connect -> Operation now i…
How to read a property value of json file located local on Ubuntu Terminal
I have a json file like below: and how can I read this value on Ubuntu Terminal. Answer You didn’t mention which version of ubuntu but as a 1 liner from the terminal this works for me (assumes json file is in same directory and called json_file.json)
What should TCP/IP do if one computer changed its IP address which we are sending data to?
What’s the standard behavior of TCP/IP protocol stack when a computer which we are sending data to suddenly changed its IP address? When this happens, the ARP table in our system is out of date, but the entry for this IP is not timed out? Is there a way to discover the new IP-mac mapping or we simply dr…
Redirecting stdout with find -exec and without creating new shell
I have one script that only writes data to stdout. I need to run it for multiple files and generate a different output file for each input file and I was wondering how to use find -exec for that. So I basically tried several variants of this (I replaced the script by cat just for testability purposes): but co…
inputrc file cannot be loaded [closed]
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 10 years ago. Improve this question I just figured out we can create a ~/.inputrc file to define keyboard mappings. But I don’t …