The web page contains this line: var zx_fn = “string with any possible character”; I download the web page, then I try to to take the part between quotes and store it in a variable my code: It doesn’t work because it says: sed: can’t read And it returns the whole page content Also what…
Tag: linux
How do jps, jinfo, jstat, jmap and jstack get information about local Java processes?
How does jps get information about all the local java processes? Does it connect to some local server process to fetch the information? How do jinfo, jstat, jmap, and jstack get information about a local java process? Do they connect to some local server process(es) to fetch the information? Is jstatd only us…
How to install libvips on Alpine 3.8?
I try to install vips-dev package to alpine linux 3.8. But get following error: How to solve it? Answer This is a known packaging issue of vips-dev on edge/testing: https://bugs.alpinelinux.org/issues/9561 As a workaround, make sure to add both edge/main and edge/testing repositories to your apk command: Upda…
L2CAP IOS + Linux (Bluez)
I’m trying to make a simple L2CAP Socket communication between IOS and a Linux PC. I’ve been able to: Create an L2CAP connection between two Linux machines (using example code from https://github.com/atwilc3000/sample/tree/master/Bluetooth) Create an L2CAP connection between two Iphones (using exa…
How to fix occasional EINVAL error when calling pthread_create
The Problem When I create a detached thread using the code below, pthread_create will sometimes return EINVAL. I would like to know why this is happening and what I should do to fix it. When the error occurs, the code below will print the following line: Error creating thread. errno = 22: Invalid argument Wha…
Reverse sort 3rd numeric column in file
In bash shell scripting, I have users.txt file. sort -t: -k 3n users.txt gives me This is ok. But I need 3rd column which contain only phone number in reverse order i.e. descending order. How to achieve that? I need like Answer You could add an r (short for “reverse”) to the order column specifica…
How do I pass –homedir to git when signing using GPG?
I have a custom location where I have my GPG keys, which is different from the default ~/.gnupg directory. I need to sign a git commit using GPG, but I can’t find any option to specify the custom location to Git: it always searches in the default one. Is there an option for this? I tried modifying: prog…
`sudo` with command substitution
I’m working with a remote machine that requires sudo for most docker commands. I often have to perform multiple repetitive commands to stop docker containers, etc: sudo docker stop <container_name>. Normally, I’d use docker stop $(docker ps -q) to stop all the results of docker ps -q, but si…
How do I get just the filename from lsof?
I want to use lsof to create a list of open files in a folder. I’m using macOS, but understand this is common to *nix. In man lsof, it seems the the -Fn option is closest to what I want, but I can’t get further than that. I’m piping to cut to get to just the filename. So this is
Gnuplot : 2 questions about my histograms X axis and add percentage
I need to generate a gnuplot histogram in order to see the CPU and RAM evolution of my cluster per month : I want to generate the histogram from this file : To do that, this my code : For the moment, I have this result : But as you can see, I have a problem with my x axies.