Wednesday, July 30, 2014

Android - How to capture net work traffic

Here are some useful links:
http://code.tutsplus.com/tutorials/analyzing-android-network-traffic--mobile-10663
http://cpiekarski.com/2013/05/02/sniffing-android-emulator/


In a nutshell, you can telnet into the emulator and start and stop the capture. This seems to work really well.
You can define any file name instead of emulator.cap and it shows up under your root directory.

telnet localhost 5554
network capture start emulator.cap
-- Do Something Cool --
network capture stop


emulator -avd myavd -verbose -tcpdump emulator.cap




Sunday, October 2, 2011

Odashow


A Turkish version of fiverr.com:   www.odashow.com

Friday, March 11, 2011

Do you want to find out what application pool in IIS is running in which w3wp.exe?
  • Start a new cmd window
  • Go to system32
  • Run "cscript iisapp.vbs"

It will generate a list...

Tuesday, February 3, 2009

Paged exec stored procedure



CREATE PROCEDURE [dbo].[PagedExec]
(
@sqlIn NVARCHAR(4000),
@PageIndex INT=1,
@PageSize INT=10,
@OrderBy NVARCHAR(255)='',
@OrderByType NVARCHAR(10)='ASC',
@NumberOfTotalPages int out,
@NumberOfTotalRecords int out
)
AS
SET NOCOUNT ON
DECLARE @sql NVARCHAR(4000)
DECLARE @sqlInLower NVARCHAR(4000)
DECLARE @SelectIndex int;
DECLARE @FromIndex int;
DECLARE @StartExtractIndex int;
DECLARE @EndExtractLen int;
DECLARE @WhereIndex int;
DECLARE @GroupByPresent int

Select @sqlInLower = Lower(@sqlIn)
SELECT @SelectIndex=CHARINDEX ( 'select', @sqlInLower)
SELECT @FromIndex=CHARINDEX ( 'from', @sqlInLower)
SELECT @GroupByPresent=CHARINDEX ( 'group by', @sqlInLower)
Set @StartExtractIndex = @SelectIndex + LEN('Select')
-- Add the row count stuff
-- The Order By in the ROW_NUMBER functiuonality is dummy. Overriden by the order by in select statement
Set @sql = N'Select ROW_NUMBER() OVER (ORDER BY ' + @OrderBy + N' ' + @OrderByType + N') AS RowNumber, '
Set @sql = @sql + right(@sqlIn, LEN(@sqlIn) - @StartExtractIndex)
-- Now wrap the with stuff
set @sql = N'WITH sqlWithRowNumbers AS(' + @sql + N')'
-- Find the selected fields
Declare @sqlSelectedFields NVARCHAR(2000)
Declare @sqlOriginalFields NVARCHAR(2000)
set @sqlOriginalFields = substring (@sqlIn, @StartExtractIndex, @FromIndex-@StartExtractIndex)
set @sqlSelectedFields = ' '
Declare @loop int
set @loop=1
declare @index1 int
declare @index2 int
SELECT @index1=CHARINDEX ( '''', @sqlOriginalFields)
SELECT @index2=CHARINDEX ( '''', @sqlOriginalFields, @index1+1)

while @loop=1
Begin
BEGIN TRY
Declare @FieldName NVARCHAR(500)
Set @FieldName = '"' + Substring(@sqlOriginalFields, @index1+1, @index2-@index1-1) + '"'
print @FieldName
if @FieldName <> '" "'
Begin
if @sqlSelectedFields <> ' '
set @sqlSelectedFields = @sqlSelectedFields + ', '
Set @sqlSelectedFields = @sqlSelectedFields + @FieldName
End
set @index2 = @index2+1
set @index1 = @index2;
SELECT @index1=CHARINDEX ( '''', @sqlOriginalFields, @index1+1)
if @index1=0
Begin
Set @loop=0
break;
End
SELECT @index2=CHARINDEX ( '''', @sqlOriginalFields, @index1+1)
END TRY
BEGIN CATCH
Set @loop=0
END CATCH
End
print @sqlSelectedFields
print @PageIndex
set @sql = @sql + N' Select ' + @sqlSelectedFields + N' from sqlWithRowNumbers'
set @sql = @sql + ' Where RowNumber between '
set @sql = @sql + STR(((@PageIndex - 1) * @PageSize) + 1)
set @sql = @sql + N' and '
set @sql = @sql + STR(@PageIndex*@PageSize)
EXEC sp_executesql @sql
DECLARE @ParmDefinition NVARCHAR(500)
SET @ParmDefinition = N'@NumberOfTotalRecords int OUTPUT'
if @GroupByPresent>0
Set @sql = N'select @NumberOfTotalRecords = count(*) from (Select Count(*) as cnt ' + right(@sqlIn, LEN(@sqlIn) - @FromIndex+2) + ') as grpcnt'
else
Set @sql = N'Select @NumberOfTotalRecords = Count(*) ' + right(@sqlIn, LEN(@sqlIn) - @FromIndex+2)
EXEC sp_executesql @sql, @ParmDefinition, @NumberOfTotalRecords out
Declare @floatTemp float
Declare @floatTemp1 float
Declare @floatTemp2 float
-- If we do not use temp float variables, the CEILING function does not work, down below.
Set @floatTemp1 = @NumberOfTotalRecords
Set @floatTemp2 = @PageSize
set @floatTemp = CEILING(@floatTemp1 / @floatTemp2)
Set @NumberOfTotalPages = CEILING(@floatTemp)
if @NumberOfTotalRecords is NULL
set @NumberOfTotalRecords= 0
if @NumberOfTotalPages is NULL
set @NumberOfTotalPages= 0
print @NumberOfTotalRecords
print @NumberOfTotalPages
RETURN 0

Monday, January 26, 2009

About Baytek

We are boutique software Development Company, based in Los Angeles, California. Our forte is .Net development of any kind. Our business model is very simple.
1- We place in house developers for expedited development. This helps us understand your business quickly.
2- We use offshore developers to accompany in-house developers. This cuts cost down.
3- We take on only limited projects, so we don’t dilute our resources.
4- Quality is our main focus. Cost comes second. We only hire good programmers and pay them well. Our experience shows that work done by unqualified people is a waste of money, time and a source of a big mess that is only to be cleaned up by someone else.
We have created sample useful applications for our potential client to download and evaluate our capabilities. These applications are absolutely free and yours to keep. They will prove to be useful to you as well as giving you sense of how we can help you. Enjoy…

Wsdldisco
This is a very useful tool for SOA developers. You can use this tool to create a single access point, a portal, for all your web services. Please visit the link to get more info on the tool.
Wsdldisco is a very good ASPX.Net sample. This tool illustrates our depth of knowledge of ASP.Net platform. Here are some key points:
1- Usage of Reflection technology.
2- Dynamic code generation.
3- Dynamic code compilation.
4- Dynamic assembly manipulation and Web page adaptation.
5- Static and dynamic web page generation.
6- Modular design using UserControl and assemblies.
7- Implementation of Ajax.
8- Implementation of Interfaces and abstract classes.
9- Implementation of documentation using MS Sandcastle.


MovieCatalog
This tool demonstrates our Flash and Flex capabilities. MovieCatalog is an easy-to-use application which helps users to organize their movies.

TraceExtension
Log messages going in and out of a Webservice. ASPX.Net sample
1. Support for multi-thread. Original code would work fine until you had ‘real traffic”. Log file would get corrupted while handling simultaneous request.
2. Log file name is no longer hard coded. Directory name is Web.config driven. File names are stamped with date, so you get a new file for each day.
3. Capability to make the ‘log file’ browser compatible, so you can view it in IE or FireFox.
4. Extended control in Web.config to turn logging on and off.
5. Exception handling. You may want tailor the exception handling to your needs…

Thursday, December 11, 2008

IMDB Movie Catalog with Adobe AIR

Hey guys,

I recently needed a program to lookup the IMDB ratings of the movies in my Movies folder. My movies are each in its own folder. It goes like this:

Casablanca
Click
Cloverfield
Conspiracy Theory
Die Hard 1
Die Hard 3
Eastern Promises
.
.
.

and so on. So regarding the number of movies it is a very difficult thing to find a movie to watch which has a good IMDB rating. So I decided to write a program which iterates through all the folder names in my Movies folder and looks them up in IMDB.

[UPDATE] - I recently updated the program to be able to read the filenames like: "Saving.Private.Ryan.720p.HDTV.Premiere.DTS.x264-ESiR.mkv". Even if the movie folders and files are in the same directory it should work fine.

the code can be seen here.

Also I am attaching a windows setup file for non-developers out there. You can contact me for its bugs. I will try to update it time to time.

Windows Setup File



Adobe Air File Format



have fun.

Note: Double click on items opens the IMDB page of that movie!


Tuesday, November 18, 2008

Code documentation with SandCastle

1- Install sandcastle (latest release)
2- Sandcastle is command line driven. No GUI. Install this GUI tool to make life easy.
3- You must enable XML documentation file check box for each project. This will create an xml file along with each assembly.
4- Take each assembly and xml file drag and drop it into the tool.
5- Third party LIBS and assemblies that you do not have xml doc for can be excluded using BUILD/Dependencies section.
6- Use VISIBILITY/ApiFilter to cut down on what gets compiled into the help file. Otherwise it becomes too overwhelming
7- Doc for XML tags
Doc1
Doc2
Doc3