If you need to include some C++ 2011 libraries into your NS-3 code, you have to add a flag to waf in order to build your code.

To make this happen, considering Ubuntu 13.04 and GCC 4.7.3, add an option to CXXFLAG, using this:

CXXFLAGS="-std=c++0x" ./waf configure

Keep Sharing!

source: stack overflow


The easy way:

Just install Funter in your machine and be happy!

The hard way:

Run the following command in the terminal window:

defaults write com.apple.Finder AppleShowAllFiles TRUE

And then, the command killall Finder to restart it.

To hide the files again:

defaults write com.apple.Finder AppleShowAllFiles FALSE

Keep Sharing!


To serialize a string in ns-3, when adding a new Header type, do the following:

MyHeader::Serialize (Buffer::Iterator start) const

    string randomStr = "some_random_string";
    char tmpBuffer [randomStr.length() + 1];
    strcpy (tmpBuffer, randomStr.c_str());
    start.Write ((uint8_t *)tmpBuffer, strlen(tmpBuffer) + 1);

To deserialize this string use the following method:

MyHeader::Deserialize (Buffer::Iterator start)
    Buffer::Iterator i = start;
    uint8_t c;
    uint32_t len = 0;

        c = i.ReadU8 ();
    } while (c != 0);

    char tmpBuffer [len];
    start.Read ((uint8_t*)tmpBuffer, len);
    string randomStr = tmpBuffer;

Keep Sharing!


Install ethtool:

sudo apt-get install ethtool

Run the command:

sudo ethtool eth0

Keep Sharing!

source: Ubuntu Geek

Just use the unxz command:

$ unxz image_to_be_converted.img.xz

It is worth saying that the original file will be replaced by the conterted one.


Keep Sharing!

Source: stack exchange