Filed under General

Building and viewing pdflatex on Win XP

While Adobe Acrobat Pro has been working well with TexnicCenter in earlier versions, Acrobat Pro 9 does not accept the DDE command to bring back the PDF document at the same position as it was closed before the build. I.e., the DDE command [MenuitemExecute("GoBack")] does not work with Adobe Acrobat Pro 9.

Instead of accepting this, there actually exists an alternative, namely throwing out Acrobat in favor of the free PDF-XChange Viewer. After installing the PDF-XChange Viewer, go into TexnicCenter and define the output profile for LaTeX => PDF. Under the Viewer tab, set the output and forward search to command line argument and write
 "%bm.pdf"
as the command. Make sure to have a space in front of the first “. Set also the “Close document before running (La)TeX” to command line argument and write this as the command:
 /close "%bm.pdf"
Make sure that there is a space before the slash here to.

Voila, there you have it. A PDF viewer that works seamlessly with TexnicCenter.

Data centric networking

I came across Van Jacobson‘s talk at Google Tech Talks, where he presents “A new way to look at networking“. Quite an interesting perspective!

Save your harddrive

sudo hdparm -B 255 /dev/sda

root@linux-hero.com writes:

A recent bug report for Ubuntu Linux has confirmed that both the Feisty and Gutsy versions of Ubuntu cause some unnecessary wear and tear on a hard drive. The bug report…

ref: http://www.linux-hero.com/…

Problems with DNS in Linux?

sudo ethtool -K eth1 rx off tx off

Eric writes: (https://bugs.launchpad.net/ubuntu/…)

I found this problem on a new server I built. This system acts as a local router and DNS server, and also runs vmware-server. VMware is configured with vmnet0 as a bridge to eth1, which physically links to a 10/100Mbps switch for the local LAN.
VMware instances could communicate with the host system’s IP over TCP but not UDP, so DNS queries would fail. Other systems on the physical LAN can query DNS just fine.

A tcpdump capture and subsequent wireshark analysis revealed that all UDP replies coming from the host server system included a bad UDP checksum. Even UDP replies going to other systems on the physical LAN show bad checksums, but I assume those systems ignore it. VMware Server’s vmnet-bridge driver might silently drop these packets.

After turning off hardware checksum offloading (ethtool -K eth1 rx off tx off), everything worked perfectly. Wireshark revealed the reply packets from the host server include a correct UDP checksum.

Make nodes in ns-2 go for the nearest gw

This has only been tested with the UM-OLSR routing protocol.
We change our script so that the addresses of the receiving nodes to be identical, and not equal to either of the nodes:

set node_(40) [$ns_ node 42]
$node_(40) random-motion 0
set node_(41) [$ns_ node 42]
$node_(41) random-motion 0

Now we can establish a flow to one of the nodes 40 or 41, and the packets will reach the nearer of the two, based on the routing table of each node.

To avoid ns-2 error, we need to comment two lines in the ns2/classifier/classifier.cc and ns2/classifier/classifier-addr.cc files (Changes in bold face):
classifier.cc:

NsObject* Classifier::find(Packet* p)
{
NsObject* node = NULL;
int cl = classify(p);
if (cl = nslot_ || (node = slot_[cl]) == 0) {
if (default_target_)
return default_target_;
/*
* Sigh. Can't pass the pkt out to tcl because it's
* not an object.
*/

// Tcl::instance().evalf("%s no-slot %ld", name(), cl);
if (cl == TWICE) {
/*
* Try again. Maybe callback patched up the table.
*/
cl = classify(p);
if (cl = nslot_ || (node = slot_[cl]) == 0)
return (NULL);
}
}
return (node);
}

classifier-addr.cc:

NsObject* BcastAddressClassifier::find(Packet* p)
{
NsObject* node = NULL;
int cl = classify(p);
if (cl = nslot_ || (node = slot_[cl]) == 0) {
if (cl == BCAST_ADDR_MASK) {
// limited broadcast; assuming no such packet
// would be delivered back to sender
return bcast_recver_;
}
if (default_target_)
return default_target_;

/*
* Sigh. Can't pass the pkt out to tcl because it's
* not an object.
*/

// Tcl::instance().evalf("%s no-slot %d", name(), cl);
/*
* Try again. Maybe callback patched up the table.
*/
cl = classify(p);
if (cl = nslot_ || (node = slot_[cl]) == 0)
return (NULL);
}

return (node);
}

Bridge på netopia 3351 adsl-router fra nextgentel

Først gjør du som beskrevet i bruksanvisningen her for å sette adsl-ruteren i bridge-mode: http://www.ntavados.net/guide/ngt

Deretter setter du statisk ip på din egen router og setter gateway til f.eks 84.48.72.1 dersom tilordnet WAN IP er 84.48.72.x

Bash command line "while-loop"

Bash-script for parsing ttype0100_gwpos[0 to 6].tr with grep and regular expressions, and count the number of lines with hits.

while [ $c -lt 7 ]; do more ttype0100_gwpos$c.tr|grep “^d.*-Nw COL” -c; let c=c+1; done

Follow

Get every new post delivered to your Inbox.