I get linker error while compiling a minimal program that uses getaddrinfo_a on Linux. The program in question Compiler output: Answer You are using command in wrong way. Use -lanl should come after not before file name. https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html -l It makes a difference where in t…
Linux – cannot find shared library
Using Code::Blocks (13.12) / g++ to create some test code using the DVB V5 libraries on Ubuntu 14.04. The library was downloaded, built and installed following instructions in the download. Had it all working then had a disk crash. Decided to reinstall everything from scratch rather than use a backup, and dow…
Apache & SFTP permissions on AWS EC2 Linux hosting
Using SSH I’ve granted access to my SFTP clients user “ec2-user” with the following command: sudo chown -R ec2-user /var/www/html However I also need to grant access to Apache which I can do with the following command: sudo chown -R apache:apache /var/www/html I assumed this would grant acce…
Why does posh fail to perform pathname expansion when a part of the path is specified within double-quotes?
Consider the following simple shell script: I get the expected output with bash, ksh, zsh and dash, but I don’t get it with posh: I am trying to understand if the behaviour of posh is correct as per the POSIX standard or if it is a bug. The relevant section in the POSIX documents seem to be “2.6 W…
device in lspci can’t find in dmidecode
lspci 02:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1) the pci bus is 02 the deivce id is 00 and why can’t find this info in dmidecode thisi is dmidecode dmidecode 2.12-dmifs SMBIOS 2.7 present. 104 structures occupying 5095 bytes. Table at 0x000EB110. Answer The SMB…
Why does shell command “{ command1; command2: } &” open a subshell?
As we all know, placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. But when using “&” after “{}”, why two subshells are created? pid 1002 and 1003. when using “./a.out &”, only a subsh…
Puppet-Apt fails to install package because of verification
Environment: Running CentOs 7.2 Server in a virtual machine, which has a local proxy set up with CNTLM. I have installed vagrant version 1.8.1. In addition i installed the vagrant-proxyconf plugin. Goal: Set up a virtual machine on the CentOs 7.2 Server with vagrant. Yes: A virtual machine in a virtual machin…
Extracting lines by pattern matching from multiple files and writing them to another file in linux
I have 20 files. I want to extract lines by matching pattern ‘<script src=”{%.*%}>’ from those 20 files and write those lines to new file. I also want to delete those lines from the original files. Is there a better way to do it other than what I have tried which is terrible? This is m…
How does Anacron works in linux?
How does the Anacron runs even after the system shutdowns in linux? How does it look for the commands to run after the system shutdown? Answer If you have a backup script scheduled everyday at 11 PM as a regular cron job, and if your laptop is not up at 11 PM, your backup job will not be executed. However,
Connect local git repos on windows and raspberry pi
I have a windows machine and a raspberry pi, each with a git repo. I was able to set it up so I can pull from the pi to windows with the following command: This should be stable since the pi is set to a static local IP. I’d like help with an equivalent command to run on the pi