I wrote a script that deactivates all the interfaces available using nmcli commands such as: I would now like to reactivate these interfaces; there is no nmcli dev connect iface … command, and I’m stuck. In particular, my problem is to reactivate the Ethernet interface. Thanks in advance for your help! …
core dumped message is not captured in STDERR
I used to call my program with this line in bash shell to capture all stdout and stderr messages in the log file The log file shows no error but by examining the log, it’s obvious that there’s a problem and program terminates abruptly in the middle of execution. I have also tried these but the res…
Usage of lstat / stat from the linux kernel?
I’m hoping someone can fact check my assumptions on the question “Can lstat and/or stat be called form the Linux kernel 3.10.0 in Centos 7. I’ve been searching and reading as much as I can find and have only been able to confuse myself. I can’t tell if the examples I am finding are ava…
issue on import psutil inside python script
i’m not able to import psutil inside my scripts. But the library is installed on my machine. my library is inside this directory, on which there is also simplejson library: But if i create a script for example this: i get this errors: UPDATE launching pip install psutil i got this: Any ideas on how to r…
sed/awk – remove a multiline block if it contains multiple patterns
In an xml file a multiline block is identified by <start></start>. I need to find and delete these multiline blocks if they contain a set of pattern in any order (pattern1, pattern2, etc). For example, in the following: if searching for pattern1 only, blocks 1, 3, 4 should be deleted if searching …
How can I *only* get the number of bytes available on a disk in bash?
df does a great job for an overview. But what if I want to set a variable in a shell script to the number of bytes available on a disk? Example: But I just want to return 33333333 (bytes available on /), not the whole df output. Answer Portably: The -P option ensures that df will print output in the
Abuse cURL to communicate with Redis
I want to send a PING to Redis to check if the connection is working, now I could just install redis-cli, but I don’t want to and curl is already there. So how can I abuse curl to do that? Basically I need to turn off what’s send here: I was able to get rid of the User-Agent altogether by
C Just Delete Some Part Of File
I have two files. I want to copy source file to destionation file. If they are different, then I just want to copy different line not all file. In the below case, two line are same, but destination has extra line. How can I just delete last line of destination file? For example: Answer On POSIX systems, if yo…
Specify output names on multiple files with curl using ranges
I am trying to download a few hundred URL’s and specify the output name for each, the only difference is an ID in the URL, such as ..something/1/something.., ..something/3/something.., ..something/4/something.. etc. I can use -o filename.zip but it will overwrite for each of the range of files, I am cur…
Openbox. Open different firefox profiles in specific workspaces
I need something like this when I start my openbox session: But all solutions that I’ve found uses the Windows Name parameter, and that doesn’t work very well. (I’ve tried modifying my openbox’s rc.xml and using wmctrl and a couple other solution, but all in vain) Is there a direct sol…