General Technical

From tekkies.co.uk
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 192.168.0.1 -from blackhole@tekkies.co.uk -to blackhole@tekkies.co.uk -subject "Greetings" -body "Hello World"

Google Play Music

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

C:\Users\<username>\AppData\Local\Programs\Google\MusicManager\MusicManager.exe

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 ftp.tekkies.co.uk'
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    172.16.1.149:1845      74.125.77.101:80       ESTABLISHED     300
 TCP    172.16.1.149:1846      74.125.8.166:80        ESTABLISHED     300
 TCP    172.16.1.149:6989      172.16.1.3:1025        ESTABLISHED     6108
 TCP    172.16.1.149:7007      172.16.1.3:1190        ESTABLISHED     6108
 TCP    0.0.0.0:25857          0.0.0.0:0              LISTENING       4184
 TCP    172.16.1.149:1113      204.9.163.158:80       CLOSE_WAIT      4184
 TCP    172.16.1.149:1612      89.215.57.87:15212     ESTABLISHED     4184
 UDP    0.0.0.0:443            *:*                                    4184
 UDP    0.0.0.0:25857          *:*                                    4184
 UDP    127.0.0.1:1112         *:*                                    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

http://tekkies.co.uk/utils/error.php?status=201