Tuesday, December 08, 2009

Linux command to find which dynamic library defines the function getaddrinfo

find /lib /usr/lib -name '*.so*' -exec nm --dynamic --demangle --defined-only --print-file-name {} \; | grep getaddrinfo

busybox root bootstrap

echo root:x:0:0:root:/root:/bin/sh > /etc/passwd
chmod 755 /etc/passwd
touch /etc/shadow

now run login -f root, then you can use adduser to add other users

Monday, December 07, 2009

public DNS server


This is a list of public DNS server
Courtesy: http://radoff.com/blog/2009/12/07/google-dns-benchmarking-and-rationale/

Wednesday, December 02, 2009

development environment of VS2008 Express

To Get started using command line, do this:

1. Copy file c:\program files\Visual Studio 9.0\common7\tools\vsvars32.bat to your directory such as c:\tools
2. run c:\tools\vsvars32. This sets up the environment variables, most importantly $PATH
3. use "vcbuild" to build VC project or solutions. You can also use "msbuild" which is want vcbuild calls.

VCBUILD Command Line

The VCBUILD tool uses the following command line syntax to build Visual C++ projects and solutions.

VCBUILD [options] [project | solution] [config | $ALL]

Flags

options

Build options. For more information, see VCBUILD Options.

VCBUILD also reads options from the VCBUILD_DEFAULT_OPTIONS environment variable.

project

The name of a project file.

If the project parameter is not specified and only one .vcproj file is in the directory, the project specified by the .vcproj file is built.

solution

The name of a solution file.

config

The name of a project configuration to build; for example, DEBUG.

If no configuration is specified, and the VCBUILD_DEFAULT_CFG environment variable is set, the configuration it specifies is built. If it is not set, all configurations are built.

$ALL

A symbolic name that means build all configurations.

Remarks

To cancel the build process, press CTRL+C or CTRL+BREAK.

VCBUILD Options

VCBUILD has the following options:

Option

Description

/clean (VCBUILD)

Specifies outputting only clean build outputs.

/error

Specifies prefixing error lines that are outputted to stdin, stdout, stderr with the string argument.

/implib

Specifies creating an import library for a DLL configuration.

/info

Specifies prefixing information lines that are outputted to stdin, stdout, stderr with the string argument.

/link

Specifies performing a link without building sources.

/log

Specifies using file as the build log.

/logcommands

Specifies printing commands and response file to the screen.

/M

Specifies the number of concurrent builds to run.

/nocolor

Displays error and warning messages without colorization.

/noimplib

Specifies not generating an import library.

/overrideRefVer

Specifies that .NET Framework 3.5 will be used for all assembly references when upgrading a CLR project from a previous version of Visual Studio.

/pass0

Specifies performing pass 0 (MIDL) of Build.exe.

/pass1

Specifies performing pass 1 (compile) of Build.exe (implies /implib).

/pass2

Specifies to perform pass 2 (link) of Build.exe (implies /noimplib).

/platform

Only builds configurations for the given platform.

/rebuild (VCBUILD)

Specifies cleaning build outputs and then performs a build.

/time

Logs the time it takes to complete the build.

/upgrade

Upgrades the project file to the latest supported format.

/useenv

Uses the environment variables for PATH, INCLUDE, LIBS, and LIBPATH.

/warning

Prefixes warning lines with a user-defined string.

Tuesday, November 10, 2009

Use objdump to do library depency check

Generally, things that are trying to determine shared library
dependencies should use something like objdump, not ldd:

objdump -p $f | awk '/ NEEDED / { print $2 }'

Friday, November 06, 2009

bash history autocomplete

Add the following to your .bashrc file.

# make bash autocomplete with up arrow
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'


A good tcp serial port server on Linux: remserial

This Linux Serial port (RS232) server is simple and works great. check it out.

remserial at http://lpccomp.bc.ca/remserial/

Wednesday, November 04, 2009

Linux process view: top and htop

htop is a nice program to view linux processes, an alternative and simpler top.

http://htop.sourceforge.net/

Tuesday, November 03, 2009

Fix IP Phone for Gizmo

You may want to test first by dialing *0# and you will get one of two recordings.

1. You are behind the router that uses a NAT. You may experience call completion problems behind this router:
2. You are behind the SIP compatible router. You are now ready to make free world-wide calls to other SIP phones...:

From Boatman on the Gizmo forum: Suggested settings for ATAs behind one or more NAT routers.

(under SIP tab)
Handle_VIA_received: yes
Handle_VIA_rport: yes
Insert_VIA_received: yes
Insert_VIA_rport: yes
Substitute_VIA_Addr: yes
Send_Resp_To_Src_Port: yes
STUN_Enable: yes
STUN_Server: stun01.sipphone.com:3478
NAT_Keep_Alive_Intvl: 179

(under Line_1 and Line_2 tabs)
NAT_Mapping_Enable: yes
NAT_Keep_Alive_Enable: yes
NAT_Keep_Alive_Msg: 0000 <-- sometimes just leaving this blank works
NAT_Keep_Alive_Dest: $PROXY
Register Expires: 3600


Sometimes it's preferable to configure the ATA to work without stun. This optional configuration is less easily
portable but allows phone service to continue no matter if the stun server is working.
If you want to do this perform the following steps.

1. Forward the SIP ports and the RTP port range from the router to the ATA.
2. Set "STUN Enable:" no
3. Set "NAT Keep Alive Enable:" no
4. In order for the ATA to know it's public IP address, make sure the ATA is registered with at least one SIP registrar, or enter your public IP address in "EXT IP:".

When done dial *0 or *0# to check that your RTP contact address is correct.

Src: http://www.google.com/support/forum/p/voice/thread?tid=68aac21378df83fc&hl=en