Monday, March 31, 2014

Changing DNS in Ubuntu 12.10 and 12.04

This should be the right way to change the DNS servers without loosing the dnsmaq functionality, making it global for all you connections through dhcp and keeping NetworkManager aware of which DNS servers are you using.

Editing the file

Code:
sudo gedit /etc/dhcp/dhclient.conf
Adding your DNS(s) server(s) here.
Code:
prepend domain-name-servers x.x.x.x, y.y.y.y;
Source:

http://askubuntu.com/questions/13045...ia-resolv-conf

Thursday, March 13, 2014

BASH - remove (or do something) with a list of files (in text file)

Slow: 

while read -r filename; do
  rm "$filename"
done <list.txt


For a few arguments):
 rm -f $(<list.txt)



I think it should work:

xargs -a list.txt -d'\n' rm

Thursday, February 13, 2014

Where does the compiler look for default headers?


`gcc -print-prog-name=cc1plus` -v

This command asks gcc which C++ preprocessor it is using, and then asks that preprocessor where it looks for includes. You will get a reliable answer for your specific setup.

Likewise, for the C preprocessor:

`gcc -print-prog-name=cc1` -v