General Technical

Jump to: navigation, search

Win32 Blat Example

Blat[1] is a command line utility that sends mail via a SMTP server.

c:\>blat -u myusername -pw mypasword -server -from -to -subject "Greetings" -body "Hello World"

Google Play Music

Where is the Google Music Manger EXE located? (Used for Upload MP3)


Specify default credentials for network share

This runs the kerberos utility.

%windir%\system32\rundll32.exe keymgr.dll,KRShowKeyMgr

FTP using xp_cmdshell - sql2k

This script will allow you to ftp a file from a sql2k server to a public ftp server.

Be careful with your password - this script may save your password in a file on the server. Recommend that you create a temp account for the transfer, then delete the account afterwards.

exec master..xp_cmdshell 'echo (username)> c:\temp\ftp.txt'
exec master..xp_cmdshell 'echo (password)>> c:\temp\ftp.txt' 
exec master..xp_cmdshell 'echo cd /upload>> c:\temp\ftp.txt'
exec master..xp_cmdshell 'echo binary>> c:\temp\ftp.txt'
exec master..xp_cmdshell 'echo put c:\temp\myfile.jpg>> c:\temp\ftp.txt'
exec master..xp_cmdshell 'echo quit>> c:temp\ftp.txt'
exec master..xp_cmdshell 'type c:\temp\ftp.txt'
exec master..xp_cmdshell 'ftp -s:c:\temp\FTP.txt'
exec master..xp_cmdshell 'del c:\temp\ftp.txt'

Using Netstat.exe

Here's how to find out which process is listening on which ports, or which ports a program is using

Open a command prompt and run:

c:\>netstat -a -o -n

This results in a long list something like:

  Proto  Local Address          Foreign Address        State           PID
 TCP       ESTABLISHED     300
 TCP        ESTABLISHED     300
 TCP        ESTABLISHED     6108
 TCP        ESTABLISHED     6108
 TCP              LISTENING       4184
 TCP       CLOSE_WAIT      4184
 TCP     ESTABLISHED     4184
 UDP            *:*                                    4184
 UDP          *:*                                    4184
 UDP         *:*                                    4184

I've filtered out most of the items, but the interesting column is the PID and the Local Address. The PID relates to the PID column in Windows Task Manager (if you can't see the colum, click View>Select Columns and check the PID box).

I find that PID 4184 is Skype.exe.

HTC P3300 GPS settings

How to set up your HTC P3300 to allow access to the GPS via a COM port.

Open the GPS Programs Properties page: Start->Settings->System->GPS

Choose a free serial port - generally COM4 is used - this is the port you will choose in your GPS program.

Reduce Android screen resolution

  • Ensure screen is off then:
adb shell wm size 720x1280
  • Take screenshots and then:
adb shell wm size reset

(Thanks @FitNotesApp)

Force HTTP error code