Recent Notes
Displaying keyword search results 1 - 10
Created by timo on January 25, 2012 20:13:13
Last update: January 25, 2012 20:13:13
The MIPS CPU is able to run both big-endian and little-endian. So a system built on MIPS can be either big-endian (mips) or little-endian (mipsel).
The file command shows the architecture:
$ file ls
ls: ELF 32-bit LSB executable, MIPS, ...
but readelf will tell the endianness:
$ readelf -h ls
ELF Header:
Magic: 7f 45...
Created by magnum on September 27, 2011 09:32:18
Last update: September 27, 2011 09:33:04
Use tcpdump to monitor traffic on a network: To print all incoming and outgoing packets on host 192.168.0.1 :
tcpdump host 192.168.0.1 To print all incoming and outgoing IP packets on host firebird : tcpdump ip host firebird To write raw packets to a file, rather than parsing and printing them out: tcpdump ip host firebird -w /tmp/firebird.pcap To listen on interface eth0 (without this, tcpdump listens on the lowest numbered, configured up interface except loopback): tcpdump -i eth0 ip Use switch -X for more verbose output: tcpdump -i eth0 ip -X host 192.168.0.1 Outgoing from 192.168.0.1 : tcpdump -i eth0 ip -X src host 192.168.0.1 Incoming to 192.168.0.1 : tcpdump -i eth0 ip -X dst host 192.168.0.1 More verbose output: tcpdump -i eth0 tcp -vvX host 192.168.0.1...
Created by freyo on August 22, 2011 15:32:23
Last update: August 22, 2011 15:32:56
Find ports for emulator devices:
$ adb devices
List of devices attached
emul...
Telnet to emulator console:
$ telnet localhost 5554
Trying 127.0.0.1...
...
Use " sms send " to send a message:
sms send 1234 'A test message'
OK
Created by woolf on August 07, 2011 18:52:12
Last update: August 07, 2011 18:52:12
Running this command:
# /usr/sbin/iptables -t nat -A PREROUTING -p tcp -...
produced this error:
iptables v1.4.6: unknown option `--to-ports'
Tr...
To fix:
# opkg install iptables-mod-nat-extra
Created by freyo on July 29, 2011 16:04:45
Last update: July 29, 2011 16:04:45
To start the Settings application:
# am start -n com.android.settings/.Settings
St...
To start the Browser :
# am start -n com.android.browser/.BrowserActivity...
To start the phone dialer:
# am start tel:210-385-0098
Starting: Intent { ...
Help for am command:
# am
usage: am [subcommand] [options]
...
Created by voodoo on July 11, 2009 15:14:55
Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations.
It's really easy to see HTTP headers with curl:
C:\>curl --head http://www.google.com
HTTP/1.0 ...
or, headers and page together (dump headers to stdout):
$ curl --dump-header - http://www.google.com HTTP/...
Download openssl from openssl.org:
curl http://www.openssl.org/source/openssl-0.9.6m....
C:\>curl --help
Usage: curl [options...] <url>
...
Created by Dr. Xi on February 11, 2010 05:07:48
Last update: February 11, 2010 05:08:20
On Linux, you can use the fuser command to find out who has a file open, or is using a port. For example, if you start Tomcat and get the error "Address already in use: 8080", you want to know which process is already binding to port 8080.
# list processes on port 8080
fuser 8080/tcp
...
Created by voodoo on February 08, 2010 04:57:49
Last update: February 08, 2010 04:57:49
If you don't want to open an extra port for VNC or want extra security with SSH, you can setup an SSH tunnel for VNC. On Windows, you can do this with Putty or openssh .
Open a command window, and enter (using Putty as example):
C:\local\bin\plink.exe -ssh -2 -L localhost:5901:r...
When connecting with vncviewer , use localhost:5901 as server instead of remote_host:5901 .
If you use the setup frequently, it is more convenient to setup the tunnel as a Windows service . Assuming the name of the service is vnc_tunnel , the registry entry would look like:
Windows Registry Editor Version 5.00
[HKEY_...
Created by Dr. Xi on May 19, 2009 19:53:23
Last update: May 19, 2009 19:54:15
sftp -oPort=10022 user@ftp.testsite.com:/home_dir
It's important that you use = between the oPort option and the actual port number. This was what I got without it:
$ sftp -oPort 10022 user@ftp.testsite.com:/home_di...
Created by Dr. Xi on September 15, 2008 19:50:39
Last update: September 15, 2008 20:01:50
Create a properties file to hold the properties for the MailLogger:
MailLogger.mailhost=smtp.example.com
MailLogger...
Invoke from command line:
ant -DMailLogger.properties.file=C:\Build\MailLogg...
Alternatively, invoke from another ant script:
<target name="build" depends="checkout">
<e...
However, the built-in MailLogger doesn't override buildStarted . Therefore, you can't send email to notify of build starting with MailLogger . To achieve that, you can either use the Mail task or override MailLogger with your own derivative.