25 October, 2013

31 October, 2011

Ubuntu: Completely restart wireless network


driver=`sudo ethtool -i wlan0 | grep driver | cut -d ' ' -f 2`;sudo modprobe -r $driver;sudo modprobe $driver;

13 April, 2011

dlopen(0, RTLD_NOW | RTLD_GLOBAL) doesn't work?

You need to compile the binary with -rdynamic flag to expose all the symbols in the  binary, otherwise, it is highly possible that the symbol could not be found.

16 March, 2011

Copy backtrace log to file

According to this link:

gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" --args'

you can use those arguments to dump your huge bt log into a file!

06 January, 2011

Get all network interfaces using SIOCGIFCONF

Use ioctl with SIOCGIFCONF can get the names of every network interface in your machine. It should be faster than parsing the output of "ifconfig" command.