When using a PF_PACKET type of socket with protocol type ETH_P_IP, the man packet documentation talks about a socket option for multicast. The socket option is PACKET_ADD_MEMBERSHIP. Assuming you use PACKET_ADD_MEMBERSHIP socket option on a PF_PACKET socket correctly, what features and benefits and use cases …
Tag: linux
How can I add a PPA repository using Ansible?
I’m trying to add a new repository to a server so that I can install Java by Ansible. Unfortunately whenever I try to run the playbook it fails because of a GPG error. Can somebody explain what is going wrong here and what I need to do in order to fix this? I’m using Ansible 1.7.2 and currently on…
Running the same command on several ssh servers using tmux
Is is it possible to type a command once and run it over several servers connected via ssh using tmux? Answer What you are looking for might be “synchronize-panes”. With this option turned on, every keystroke is deliver to every pane of current window. Therefore, you can achieve your goal by: Spli…
s3cmd ImportError: No module named S3.Exceptions
Received an error after installing and trying to run s3cmd 1.0.0 This error came about after upgrading to the latest Amazon Linux distro 2015.03.0 Answer Looks like the error happened because python2.7 is now the default python version in the Amazon Linux 2015.03.0+ If you change python back to 2.6 and run s3…
php using exec with screen
I have a need to start three processes through my PHP script. Those processes live in the /home/user/server directory, named server-one, server-two and server-three. The process are also capable of accepting commands through their consoles, so I would need them to live in their own screen with a name so I can…
I can’t see my data in graph with shinken and graphite
Apache 2.4.7, Ubuntu Server 14.04. Shinken with WebUI Name Server : dev03 I’m on an Ubuntu Server 14, I’ve installed Shinken to make monitoring. Shinken is working good and discover hosts on my network. Then I want to “link” graphite on Shinken to have some graphics. All the install wo…
how to send output of ‘ls-l’ to cp command using pipes?
i want to copy the output of ls -l command into a file say “xyz”. i know i have to take the output of ls -l and then send it to cp command using pipe i.e output of ls-l will be used as an input for cp command Answer Output to file “test.txt”: Sumary of pipes: > Save output to
Make is unable to find the functions
I am trying to compile a C program, while linking the APR library. I am getting the following error message: cc -g -Wall -pthread -I/usr/local/apr/include/apr-1 -I/usr/local/apr/include/apr-util-1 -L/usr/local/apr/lib -L .aprutil-1 -L .apr-1 devpkg.c bstrlib.o db.o shell.o commands.o -o devpkg /tmp/cczC53x5.o…
BASH: check for amount of memory installed on a system as sanity check
As part of a bash install script, I’d like the script to do a sanity check that the target machine has at least a given amount of memory installed. Note that I’m NOT specifically worried about how much memory is currently used or allocated or available – for my purposes the existance of more…
Find command in linux bash shell
the find command is: I want to convert to: so my code (is doesn’t work): Answer What you are attempting cannot be solved in the general case with “classic sh” because you need your script to work correctly with directories named * or ‘”[ ]”‘, and plain old flat string…