I've googled til my brain went boom... So the short story goes; I have lots of ip address ranges in multiple files which need to go into an iptables firewall... Sounds simple right?
Example of files:
1.0.1.0-1.0.1.255
1.0.1.0-1.1.0.255
I am trying to remember the procedure used to determine the ip address range when given a network address and its subnet mask. Does anyone have any documentation on the steps that are done to accomplish this?
One of our clients uses a mobile client, which "helo"s with a non-resolvable hostname (which contains the correct IPv4 address in the name but does not resolve). I'd like to be able to config PERMIT "joeblow@mydomain" when the helo-names "*.mobilepool.carrier.net". Can anybody give me a hint how to do this, if it is even possible?Right now it just rejects based on not resolving the HELO name.
As awk programmers may know, we can print range of lines with awk, from an initial pattern until a final pattern as follow:
Code:
awk '/Initial_String/,/Final_String/' inputfile
Well, I have this inputfile:
Code:
[code]...
Once having those elements in that way within an array(a[]), I want to be able to manipulate the array (a[]) and copy its elements to another array (b[]) in different order (all lines joined in a single line separated with commas), as follow:
Each line represents a portion of a data matrix. I want to convert the numbers after the "=" to the range of that partition in the matrix such that the output file looks like this:
I am trying to compress a folder and the contents within, while keeping the permissions the same. I then need to check if the compress file is corrupt or not. Base on that result I need to transfer the file.
cd /home/ops/Desktop/temp tar cvzfp backup-"$(date +%d-%b-%y)".tar.gz /home/ops/Desktop/dir1 gunzip -tl backup-"$(date +%d-%b-%y)".tar.gz
I'm creating a script that creates files from svn checkout and compress them using tar.gz the script gets the repository name from command line argument i need to capture a number from the last line of the output and create a file name from it.
The svn returns output of all the file names from the repository and in the end it says: revision number xxxxx. i need to get this number and then rename the tar.gz to it. how do i save the output to a variable and get this number.
I want to pass ip address,port address and some parameters from command line using python script.The ip address and port address for establishing socket connection and remaining parameters to execute different connection.
I need a small shell based program that prints the mac address of physical ethernet adapter from it's firmware. I need this utility for license generation and appliance activation. I have tried several example but none of them is flawless, The easiest method I have found is to parse the output of "ifconfig" command but it has also some drawbacks.
1. Firstly program should differentiate between physical and virtual adapters. Physical means installed on board(wired or wireless) or installed additionally. Virtual adapters are those created by VPN or created by virtualization apps such as VirtualBox/VMWare etc. I am not interested in virtual ones.
2. In case of more them one physical adapters(wired and wireless), it should print the mac address and description(name & vendor) of both/all adapters.
3. If media is disconnected then also it should be able to read the mac address and description(name, vendor) of card.
4. This one is bit complex. I know that 'ethtool' can show you the universal mac address but it's limited to use only 2 types of drivers and won't work in all cases.
When I try to access at physical address (0xD0000), we known that it is necessary to convert physical address to virtual address using function IOREMAP(0xD0000, 1024) and return me 0xC00D0000.
Now our doubt is when I have a board with I/O in address 0x150, is it necessary to convert this address to other virtual address??? or with inb(0x150) return me state of I/O in this address? How can I known where is this I/O address in my map memory?
I am trying to find out the mac address of the eth0 port on linux probe. This port is controlled by kernal and hence I don't have control over it. How do I find out the mac address of this port ? Is there any system call which will take the ip address and will do the lookup on the linux's ip table to get the mac address ?
I use speech for a lot of notifications, email, time every 30 minutes, system alerts, etc... but there are times when I do not want the speech, because I am on a conference call or have an open mic.
I am currently running Debian 6. I would like to know if there is a way and how i would go about blocking a certain IP range from connecting to my server within a certain port range. Say for example.
i want to block ip range 123.123.123.* from connecting to my server on the ports 33000 - 43000. But, i want to allow them to connect on any other port range, and i want to be able to allow connections from my server to the blocked ip range on those same ports. so, blocking incoming only on the above port range.
I have a large list of folders that I want to compress using tar.the script I want to right is to travers all the folders and for each I would tar the contents to a tar file with the same name of that folder. and the it should be stored inside the same forlder.
I'm trying to create an application that monitors, among other things, what site the user is currently viewing. I would like to know if there is any way to get the current URL from the Firefox's address bar on a Linux machine. I know that under Windows I can use the DDE server approach, but under Linux this task is proving very tricky. I've considered an approach involving an extension to Firefox, but this would require the user to install the said extension himself. Which is not something I want. If an extension can be installed by a different program's installer than that could work, but I don't know if that's possible or not.
I'm using at struct sockaddr_in to receive multicast data sent out from another machine. When I print out the source address using inet_ntoa it gives me the source address of the PC that sent the data. This is ok but I would like to know if there is a way of getting the multicast address that the data was 'sent to'. I know I can see the multicast address in tcpdump being directed to my PC but I would like to be able to display the multicast address too? Is this possible or does the sockaddr_in give me the source address of the packet not the multicast address that the packet was sent to?
I am connecting to linux server(RHEL4.7) using putty from my windows machine. Is there any way to get the ip address of my windows machine using C program in linux.
Running into a weird issue when packing sockaddr_storage with either v4 or v6 address.
To demonstrate the problem, I created a sample test program(limiting it to v4 only addresses). The problem was observed on MAC OS 10.5.8 and Linux RHEL kernel 2.6.9-42 with gcc as the compiler.
* Function packAddrs() runs a for loop packing v4 addresses into a single structure. The input address is same for every iteration, output memory size is adjusted using realloc.
* After successfully packing an address, it prints the packed structure contents using displayPackedAddrs()
* The output is fine for first two iterations. However, at the 3rd iteration, the packed contents seem to have got corrupted. It prints only the first packed address. I have tried using (malloc and memcpy) instead of realloc but no improvement.
I want to package my application for linux, I use zip/tar.gz/7z/rar to do the compress in Windows.Because I do the compress in Windows, so when I extract the package in Linux, the file permission is reset.The problem is Only the tar.gz can let me extract runable files, other format (zip/7z/rar) not (the file permission is reset to 644).So my question is how to compress my files using zip/7z/rar while reset the permission to 755.