Wednesday, November 29, 2006

Patterns and Practices of Software Development

It appears to be low profile so I hadn't heard of this until a co-worker pointed out this MS Wiki where they are putting together a community to work on documenting patterns and practices.

Microsoft's Patterns and Practices Guidance Library


This is useful in two ways, (1) in defining some templates for creating better documentation. For instance there is a template for writing a Mini How To. It lists a number of good ideas to consider while writing a How To. (2) It provides documentation, an example How To: How To: Use Regular Expressions to Constrain Input in ASP.NET. Another example is they have checklists for instance they have a Web Services Security Checklist.

From my observation there are not necessarily 'deep' thoughts here. The statements all make sense, to the point that it seems like stating the obvious. The value is in that the thought have been persisted, collected and present in a clean and concise way. This means that in our haste to get a product out the door, we can walk through a relatively simple list to verify we didn't miss something obvious.

A good idea. I hope it continues to have contributions and a community is built around this.

Tuesday, November 28, 2006

HOWTO Forge (linux)

A friend of mine sent me this link. This is really my blog, on steroids and then some. A community of people making howtos for Linux. Smart. I wish I thought of it :-).

http://www.howtoforge.org/ - HOWTO Forge

I am definitely adding this to my resources. Maybe I should start to contribute.

Monday, November 27, 2006

HOWTO use microsoft's logparser to analyze IIS logs with example sql/code

Logparser can be your good friend if you have a large set of data (text form or otherwise) and you would like to summarize it. It can be used to analyze Microsoft’s Internet Information Server (IIS) logfiles, text based logfiles, XML files, Eventviewer data, Registry, Active Directory Objects, CSVs and more (see all the input formats at the end of blog entry).

The below is my documenting a howto use logparser with a number of examples. Most of the examples of IIS log parsing were not developed by me, rather there is a MS team that can be employed to do an IIS health check, these were the logparser SQLs they used.

Logparser to start

I recommend become familiar with:
logparser -h
In all truth all my needs have been answered in the command-line help. I may have googling for a solution, but the problem was solvable with careful reading.

Logparser and IIS logs.

Logpaser automatically reads the IIS header. In fact, I highly suspect that the reason for the tool’s existence began with the need to analyze IIS logs - the history and lore, I have not taken that much time to learn. I'll let you correct me?

Queries (examples):
updated March 2007 to add reverse DNS lookup, Referer URLs (sic), and Referer Summary (sic).
• Merge Multiple Log files
To consolidate log files into a single file.
logparser -o:IIS "select * into merged.log from ex*.log"
• A count of the Total Requests
logparser "select count(*) into IISLOG_TOTAL_REQ.csv from ex061023.log"
• How many unique clients
logparser "select count(distinct c-ip) into IISLOG_DISTINCT_CLIENTS.csv from ex061023.log"
• Top 20 URLs Hit
logparser "SELECT TOP 20 cs-uri-stem, COUNT(*) AS Hits INTO Analysis.csv from ex061023.log group by cs-uri-stem order by Hits DESC"
• Top 20 ASP pages Hit
logparser "SELECT TOP 20 cs-uri-stem, COUNT(*) AS Hits INTO Analysis.csv from ex061023.log where cs-uri-stem like '%%.asp' group by cs-uri-stem order by Hits DESC"
• Hit Frequency (how many hits per hour)
logparser "SELECT TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)), COUNT(*) AS Hit_Frequency INTO IISLOG_ANALYSIS_HIT_FREQ.CSV FROM ex061023.log GROUP BY TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) ORDER BY TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) ASC"
• Bytes per Extension
What is the percentage of the bytes served per extension-type?
logparser "SELECT EXTRACT_EXTENSION(cs-uri-stem) AS Extension, MUL(PROPSUM(sc-bytes),100.0) AS PercentOfTotalBytes INTO IISLOG_ANALYSIS_BYTES_PER_EXT.CSV FROM ex061023.log GROUP BY Extension ORDER BY PercentOfTotalBytes DESC"
• Top 20 Clients Hitting this server
logparser "SELECT top 20 c-ip AS Client_IP,count(c-ip) AS PageCount from ex061023.log to IISLOG_ANALYSIS_TOP20_CLIENT_IP.CSV GROUP BY c-ip ORDER BY count(c-ip) DESC"
• REVERSEDNS of Top 20 Clients Hitting this server (reversedns(...) is a long running function for obvious reasons)
logparser "SELECT top 20 c-ip AS Client_IP, REVERSEDNS(c-ip),count(c-ip) AS PageCount from ex061023.log to IISLOG_ANALYSIS_TOP20_CLIENT_IP_WITH_DNS.CSV GROUP BY c-ip ORDER BY count(c-ip) DESC"
• Referrer Host Names directing traffic to this server with count of pages referred (summary)
logparser "SELECT ReferringHost, count(*) AS TotalReferrals, Min(cs(Referer)) AS ExampleRefererURL USING CASE EXTRACT_TOKEN(cs(Referer),2, '/') WHEN null THEN 'NoReferer' ELSE EXTRACT_TOKEN(cs(Referer),2, '/') END as ReferringHost into IISLOG_ANALYSIS_REFERER_HOSTS.CSV FROM ex061023.log group by ReferringHost order by count(*) DESC"
• Referrer URLs directing traffic to this server (full report)
logparser "SELECT EXTRACT_TOKEN(cs(Referer),2, '/') as RefererHostName, cs(Referer) AS RefererURL, count(cs(Referer)) AS TotalReferrals into IISLOG_ANALYSIS_REFERERURLs.CSV FROM ex061023.log group by cs(Referer) order by count(cs(Referer)) DESC"
• Unique Clients per Hour
This is two separate SQLs.
1. logparser -o:CSV "Select TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) as Times, c-ip as ClientIP into IISLOG_ANALYSIS_DIST_CLIENT_IP.LOG from ex061023.log group by Times, ClientIP"
2. logparser -i:CSV "Select Times, count(*) as Count from IISLOG_ANALYSIS_DIST_CLIENT_IP.LOG to IISLOG_ANALYSIS_HOURLY_UNIQUE_CIP.CSV group by Times order by Times ASC"
• IIS Errors and URL Stem (Error code > 400)
logparser "SELECT cs-uri-stem, sc-status,sc-win32-status,COUNT(cs-uri-stem) from ex061023.log to IISLOG_ANALYSIS_ERROR_COUNT.CSV where sc-status>=400 GROUP BY cs-uri-stem,sc-status,sc-win32-status ORDER BY COUNT(cs-uri-stem) DESC"
• IIS Errors by hour (Error code > 500)
Can answer if the errors are load related
logparser "SELECT TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)), COUNT(*) AS Error_Frequency FROM ex061023.log TO IISLOG_ANALYSIS_ERROR_FREQ.CSV WHERE sc-status >= 500 GROUP BY TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) ORDER BY TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) ASC"
• Status Code distribution
logparser "SELECT sc-status, COUNT(*) AS Times from ex061023.log to IISLOG_ANALYSIS_STATUS_CODE.CSV GROUP BY sc-status ORDER BY Times DESC"
• Top 20 Longest time-taken (on average) pages
logparser "SELECT top 20 cs-uri-stem,count(cs-uri-stem) As Count,avg(sc-bytes) as sc-bytes,max(time-taken) as Max,min(time-taken) as Min,avg(time-taken) as Avg from ex061023.log to IISLOG_ANALYSIS_TOP20_AVG_LONGEST.CSV GROUP BY cs-uri-stem ORDER BY avg(time-taken) DESC"
• Top 50 longest requests
logparser "SELECT top 50 TO_LOWERCASE(cs-uri-stem),time,sc-bytes,time-taken INTO IISLOG_ANALYSIS_TOP50_LONGEST.CSV FROM ex061023.log ORDER BY time-taken DESC"
• Average Response time by Hour
logparser "SELECT TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)), avg(time-taken) INTO IISLOG_ANALYSIS_AVG_RESP_TIME.CSV FROM ex061023.log WHERE cs-uri-stem like '%%.asp' GROUP BY TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) ORDER BY TO_LOCALTIME(QUANTIZE(TO_TIMESTAMP(date, time),3600)) ASC"
• Percentage Processing time by extension
logparser "SELECT EXTRACT_EXTENSION(cs-uri-stem) AS Extension, MUL(PROPSUM(time-taken),100.0) AS Processing_Time INTO IISLOG_ANALYSIS_PROCTIME_PER_EXT.CSV FROM ex061023.log GROUP BY Extension ORDER BY Processing_Time DESC"

As an added bonus, I’ve created a small cmd (windows) shell script that runs thru all (but the first) of these queries below against a log file. It is located at the following link
download it
Note it requires logparser on the path and has a commandline invocation of:
logparseranalysis.cmd ex061023.log

Logparser and creating separate SQL files (the file: argument)

You may have noticed that these SQLs can get a long, as is the way with SQL. Logparser provides the means to create a text file with these long sqls in it. Additionally the ability to pass arguments is of course a given. Next, an example is in order. To use the commandline below you will need to create a little text file (extension sql) with the contents of the below.

Command Line:
logparser file:iis.sql?logfile=ex061113.log

Text file: iis.sql
-- Start of SQL file --
SELECT
c-ip AS ClientIP,
cs-host AS HostName,
cs-uri-stem AS URIStem,
sc-status AS Status,
cs(User-Agent) AS UserAgent,
count (*) as Requests
INTO output.csv
FROM %logfile%
where time > to_timestamp('18:20:00', 'hh:mm:ss') and time < to_timestamp('18:45:00', 'hh:mm:ss') GROUP BY c-ip, cs-uri-stem, cs-host, cs(User-Agent), sc-status ORDER BY Requests DESC
-- End of SQL file --


Logparser and the files without headers

Don’t have a header in your csv file? With a little work we can define a logparser SQL that will map the empty fields to names with meaning. The automatic header row parsing will need to be turned off.
Command Line:
logparser -i:csv -headerRow:OFF file:dslog.sql?logfile=logwoutheader.log+outputfile=out.csv
Text file: log.sql
-- Start of SQL file --
select To_TimeStamp(MyDate, MyTime) as DateTime, field3 as MachineNane, field4 as PID, field5 as TID, To_Int(field6) as ErrorLevel, field7 as RegExp, field8 as Line, field9 as SID, field12 as Message using TO_TIMESTAMP(field1,'MM/dd/yyyy') as MyDate, TO_TIMESTAMP(field2, 'hh:mm:ss.lx') as MyTime into %OUTPUTFILE% from %LOGFILE% where ErrorLevel >= 35
-- End of SQL file --


Logparser and the eventviewer
Although already covered in a previous article, logparser can also connect to eventviewer and analyze those logs. It can even do this on remote machines. The below SQL is an example on how to detect locked out accounts.

Command Line:
logparser file:lockedoutaccounts.sql?DOMAINCONTROLER=HQDC01C

Text file: lockedoutaccounts.sql
-- Start of SQL file --
SELECT timegenerated AS TimeLockedout,
extract_token(strings, 0, '|') As UserName ,
extract_token(strings, 1, '|') AS OriginatingMachine,
EventID,
SourceName,
Message,
CASE EventID
WHEN 529 THEN 'Invalid userid/password'
WHEN 531 Then 'Account disabled out'
WHEN 539 Then 'Account locked out'
WHEN 530 Then 'Outside of logon time'
WHEN 532 THEN 'Account Expired'
WHEN 535 THEN 'Password Expired'
WHEN 533 THEN 'User not from allowed system'
WHEN 644 THEN 'Account Auto Locked'
WHEN 540 THEN 'Successful logon'
ELSE 'Not specified' END AS EventDesc,
strings
INTO lockedact.csv
FROM \\%DOMAINCONTROLER%\Security
WHERE EventID=644
-- End of SQL file --


Reference Material:
http://www.logparser.com/ the unofficial logparser site. It hosts a great knowledge base and an active forum.

How logparser 2.2 Works

To download: Download Logparser

Logparser Blog Entry

Logparser 2.2 Input formats:
• IISW3C: This is the IIS W3C Extended log file format.
• IIS: This is the IIS log file format.
• IISMSID: This is the log format for files generated by IIS when the MSIDFILT filter or the CLOGFILT filter is installed.
• NCSA: This is the IIS NCSA Common log file format.
• ODBC: This is the IIS ODBC format, which sends log files to an ODBC-compliant database.
• BIN: This is the IIS binary log file format.
• URLSCAN: This is the format for URLScan logs.
• HTTPERR: This is the IIS 6.0 HTTP error log file format.
• EVT: This is the Microsoft Windows Event Messages format.
• TEXTWORD: This is a generic text file, where the TEXT value is any separate word.
• TEXTLINE: This is a generic text file, where the TEXT value is any separate line.
• CSV: This is a comma-separated list of values.
• W3C: This is a generic W3C log file, such as a log generated by Windows Media Services or Personal Firewall.
• FS: This provides information about file and directory properties.
• XML: Reads XML files (requires the Microsoft® XML Parser (MSXML)) •
• TSV: Reads tab- and space- separated values text files
• •ADS: Reads information from Active Directory objects
• REG: Reads information from the Windows Registry
• NETMON: Makes it possible to parse NetMon .cap capture files
• ETW: Reads Event Tracing for Windows log files and live sessions
Logparser 2.2 Output formats:
• W3C: This format sends results to a text file that contains headers and values that are separated by spaces.
• IIS: This format sends results to a text file with values separated by commas and spaces.
• SQL: This format sends results to a SQL table.
• CSV: This format sends results to a text file. Values are separated by commas and optional tab spaces.
• XML: This format sends results to an XML-formatted text file.
• Template: This format sends results to a text file formatted according to a user-specified template.
• Native: This format is intended for viewing results on screen.
• CHART: Creates chart image files (requires Microsoft Office 2000 or later)
• TSV: Writes tab- and space- separated values text files
• SYSLOG: Sends information to a SYSLOG server or to a SYSLOG-formatted text file


Keywords: IIS log file analysis, IIS 6.0, IIS 5.0, IIS, logparser, logparser examples, logparser samples, logparser input formats, logparser output formats, logparser examples, howto use logparser, example sqls for logparser, how to use logparser, Analyzing IIS logs with logparser, logparser and files without headers, logparser eventviewer example, using logparser to analyze IIS logfiles, logparser sample code.

Sunday, November 26, 2006

How to add a DiggIt and Del.icio.us links/button to blogger

Do you want to make it easy have your blog be submitted to the social networking sites like Digg and Del.icio.us?

You can add the submission URLs to the Comment footer of each of your blogger posts.

Below is how to do this in both the new and old version of Blogger.

Heads Up Folks: I've recently updated a simplier way to do this at this new post here.

NEWEST BLOGGER

Thanks to Sabre for looking and finding this. As he writes in his blog SabreNews: HOWTO add "diggit" and "del.icio.us" links to blogger( not beta , but latest version)

1.check whether email post page element is added to your blog .
if not, you can add thru template --->page elements page in your blog admin page

2.after adding email-post , search for in the edit html page of Templage.
do not forget to check "Expand Widget Templates"

3.paste the following snippet before tag
::for DIGGIT
<a expr:href='"http://digg.com/submit?phase=2&url=" +
data:post.url + "&title=" + data:post.title'
target='_blank'>DiggIt!</a>
::for DEL.ICIO.US
&lt;a expr:href='"http://del.icio.us/post?url=" +
data:post.url + "&title=" + data:post.title'
target='_blank'>Del.icio.us</a>



OLD BLOGGER


(1) Goto your blogger Template.
(2) Search for the BlogItemCommentsEnabled section.
(3) Add the submission URLs following the template:
digg: http://digg.com/submit?phase=2&url=www.UniqueURL.com&
title=StoryTitle&bodytext=StoryDescription&topic=YourSelectedTopic
del.icio.us:
http://del.icio.us/post?url=www.UniqueURL.com&title=StoryTitle

The below is the example of the BlogItemCommentsEnabled section I am using.

<BlogItemCommentsEnabled><br><a href="http://digg.com/submit?phase=3&url=<$BlogItemPermalinkUrl$>&title=<$BlogItemTitle$>" Title="Submit To Digg" target="_blank"&gtDiggIt!</a> | <a href="http://del.icio.us/post?url=<$BlogItemPermalinkUrl$>&title=<$BlogItemTitle$>" Title="Del.icio.us" target="_blank">Del.icio.us</a> | <a href="<$BlogItemCommentCreate$>"
<$BlogItemCommentFormOnclick$>>
<$BlogItemCommentCount$> ;comments</a>



The blog I found this information in is:
Technology Wrap: Guide: How to add a DiggIt and Del.icio.us button to blogger

Keywords: Blogger, Submit URL links, Digg link, Diggit link, Del.icio.us link, Digg submit link, Diggit submit link, Del.icio.us submit link, HOWTO add Digg submit links to blogger, HOWTO add delicious submit links to blogger.

Wednesday, November 15, 2006

Paste Special Unformatted Text At Your Fingertips

This one is a pet peeves of Paul, I admit that sometime Rich Text is really a good thing. In our world of Windows Rich Text, there are times when I want to paste rich text and many more times I want to paste Text-only. My wife actually influenced me into realizing the need is great enough to research it. I've used the Paste Special command for a long time, but have been troubled by the lack of a short-cut key to it.

This article (link below) is a great howto create a macro to a shortcut key for MS Word. Which these days (Office 2003) translates directly to our Outlook 2003 Email Client. If you create this macro in Word, you can use it in composing your Outlook emails.

Paste Special Unformatted Text At Your Fingertips

The next extension would be to create a Windows wide Paste Special shortcut key. Sure, I'll add it to my project list ;)

Update: I won't yet bother with the Windows Wide implementation. It is done:
PureText - http://stevemiller.net/PureText/, a quick trial seems to suggest it works well.

A quote from the web-page:
Have you ever copied some text from a web page or a document and then wanted to paste it as simple text into another application without getting all the formatting from the original source? PureText makes this simple by adding a new Windows hot-key (default is WINDOWS+V) that allows you to paste text to any application without formatting.

After running PureText.exe, you will see a "PT" tray icon appear near the clock on your task bar. You can click on this icon to remove formatting from the text that is currently on the clipboard. You can right-click on the icon to display a menu with more options.



Keywords: Paste Special keyboard shortcut, paste special, paste unformatted text, paste unformatted text shortcut key, unformatted text paste, unformatted paste, Windows, Word, Outlook, Windows Wide unformatted paste.

Integer Types In C and C++

Unless I am switching back and forth between compilers often, I tend to need a kick (or look up) to recall the different implementations of integer types.

The below page of Jack Klein's is just that kick.

Integer Types In C and C++


The introduction, a copy-paste from the above site, and the sample program to run through your compiler is below.

Introduction

You would think that the basic integer types provided by the C and C++ languages wouldn't cause an much confusion as they do. Almost every day there are posts in the C and C++ newsgroups which show that many newcomers do not understand them. Some experienced programmers who are only familiar with one platform do not understand them either.

The most common source of confusion are the sizes of the integer types, and the range of values which they can hold. That is because the languages leave many features of the integer types implementation-defined, meaning that it is up to the particular compiler to determine their exact specifications. C and C++ do set minimum requirements for each of the integer types, but the compiler is free to exceed these limits.

Each compiler is required to document its implementation. This information should be available in the printed manuals, online help, or man pages which come with the compiler.

In addition, there is a required standard header named <limits.h> (&ltclimits> in newer C++ compilers) that provides information about the integer types that can be used in your programs at run time. A compiler is not required to provide a header like <limits.h> as a readable text file, but I do not know of any compilers which do not.

There are programs on this page to display the information that this file contains.



A Program To Display Integer Type Information Standard C++ Compilers


#include <iostream>
#include <climits>

using std::cout;
using std::endl;

volatile int char_min = CHAR_MIN;

int main(void)
{
cout << "Size of boolean type is "
<< sizeof(bool) << " byte(s)"
<< "\n\n";

cout << "Number of bits in a character: "
<< CHAR_BIT << '\n';
cout << "Size of character types is "
<
<< " byte" << '\n';
cout << "Signed char min: "
<< SCHAR_MIN << " max: "
<<< '\n';
cout << "Unsigned char min: 0 max: "
<< UCHAR_MAX << '\n';

cout << "Default char is ";

if (char_min < 0)
cout << "signed";
else if (char_min == 0)
cout << "unsigned";
else
cout << "non-standard";
cout << "\n\n";

cout << "Size of short int types is "
<< sizeof(short) << " bytes"
<< '\n';
cout << "Signed short min: "
<< SHRT_MIN << " max: "
<< SHRT_MAX << '\n';
cout << "Unsigned short min: 0 max: "
<< USHRT_MAX << "\n\n";

cout << "Size of int types is "
<< sizeof(int) << " bytes"
<< '\n';
cout << "Signed int min: "
<< INT_MIN << " max: "
<< INT_MAX << '\n';
cout << "Unsigned int min: 0 max: "
<< UINT_MAX << "\n\n";

cout << "Size of long int types is "
<< sizeof(long) << " bytes"
<< '\n';
cout << "Signed long min: " <<
LONG_MIN << " max: "
<< LONG_MAX << '\n';
cout << "Unsigned long min: 0 max: "
<< ULONG_MAX << endl;

return 0;
}

Keywords: C++, types, integer, int, short, long, char, bool, sizeof, C, compiler implementation of integer types, unsigned.

Sunday, November 12, 2006

HTML Validation Service (W3C Markup)

While exploring the internet trying to figure out a trivial little problem, I discovered a tool that the w3.org has provided to any and all users on the internet that I forgot about. It can validate a multitude of DOCTYPE from XHTML 1.0 to SVG 1.1 and several flavors in between.

A quote from the validator's FAQ:
"Most pages on the World Wide Web are written in computer languages (such as HTML) that allow Web authors to structure text, add multimedia content, and specify what appearance, or style, the result should have.

As for every language, these have their own grammar, vocabulary and syntax, and every document written with these computer languages are supposed to follow these rules. The (X)HTML languages, for all versions up to XHTML 1.1, are using machine-readable grammars called DTDs, a mechanism inherited from SGML.

However, Just as texts in a natural language can include spelling or grammar errors, documents using Markup languages may (for various reasons) not be following these rules. The process of verifying whether a document actually follows the rules for the language(s) it uses is called validation, and the tool used for that is a validator. A document that passes this process with success is called valid.

With these concepts in mind, we can define "markup validation" as the process of checking a Web document against the grammar (generally a DTD) it claims to be using."

This reminds me, I should remember to throw pages I publish through this tool. I expect it to be more pedantic than a web browser, but that is a good thing. I see a few things that I need to fix up on a could of my sites right now.

The Link: The W3C Markup Validation Service

They also provide a number of other tools such as:
A Link Checker
CSS Validator
Feed Validator
P3P Validator
RDF Validator
XML Schema Validator
HTML Semantic Extractor - Checks for metadata

Keywords: HTML validation, HTML, XML validation, XHTML, XHTML 1.0, XHTML 1.1, SVG, SVG 1.1, SVG 1.0, Web page validator, validate my html, validate the html on my website.

Thursday, November 09, 2006

HOWTO convert from Flash Video-FLV to AVI for free AKA Transcoding

This is a special request HOWTO on Transcoding. There is a soul out on the internet that wants to be able to convert Flash video (FLV) to AVI, MPEG (MPG), or WMV. For those of us out there that don't know this is called Transcoding. This is simply a matter of decoding the video to and an intermediate form and encoding the video to the chosen format.

Windows Instructions: (Linux instruction are down below)

Prerequisites for the method described below.
1. Firefox
2. The Video Downloader plugin for Firefox
3. Riva FLV Encoder 2. A free FLV encoder that can transcode as well.


The step-by-step HOWTO:

1. Pick a Flash Video to download. Click the Download Video Link.


2. Save the FLV video. Make sure to Rename it with an flv extension. It is weird that Video Downloader doesn't let us pick a name.


3. Start Riva FLV Encoder.
- Pick your FLV file or the input.
- Pick the location and name of output file
- Pick the extension you'd like to transcode into. (AVI or MPG). In my example I chose AVI.
- Press the encode button.


And there you have it, tada, you are done. When the Riva FLV Encoder 2 is complete, you've transcoded into another format.

Be aware that you might need to specifically have the codec for the AVI/MPG encoding you just did.

Reading briefly on the forum of Riva it appears that there are occasional gitches, sound problems with transcoding. It isn't a specifically supported operation, either.



Riva Links:
Riva Homepage
Riva Forums

Do you want to do this for Linux?
Take a look at this: Converting flv to mpeg in Linux
Of course you can download a flv file with Firefox in Linux

You will need ffmpeg.
And the simple commandline:
ffmpeg -i videotoconvert.flv -ab 56 -ar 22050 -b 500 -s 320x240 output.mpg


Keywords: Transcoding, FLV2AVI, FLV2MPG, FLV2MPEG, Convert Flash Video to AVI or MPEG/MPG, Convert FLV to AVI, Convert FLV to MPG, Howto Convert FLV to WMV, convert youtube videos, convert google videos.

Monday, November 06, 2006

InterfaceLIFT: High-Resolution Wallpaper

Not that this is very technical, but yesterday I found a good site for sharing and getting wallpaper/desktop backgrounds.

InterfaceLIFT's content is entirely vistor-submitted and is intended to be shared. They do a great job of search and provided a multitude of resolutions from 1024x768 to 2560X1600 as well as a number of other formats (ipod/sony psp).

My search for "Seattle" returned several of great photos of the city. Another search for "Vancouver" returned even more.

InterfaceLIFT: High-Resolution Wallpaper

The more sharing, the merrier and who can complain at the price of nothing?

And if you are looking for other art they have icons too. Have a new app that you want a cool icon for? I'd check these ones out.

Paul

Keywords: Wallpaper, Desktop background, images, free wallpaper, linux, windows, icons

Friday, November 03, 2006

HOWTO create ISO images and mount ISO images linux

As a comparison to my last post, all that work of installing applications is moot in Linux.

To create an image (link to a more verbose explanation) use dd on an unmounted CD/DVD drive:
dd if=/dev/cd of=cd.iso

To mount an image, if your kernel is compiled with the loopback block device and ISO 9660 built in (link to a more verbose explanation):

mount -o loop -t iso9660 cd.iso /mnt/isoimage/

Wikipedia on ISO

Keywords: ISO, mounting, ISO mounting, CD emulator, DVD emulator, Daemon Tools, Mount ISO, Linux, Linux CD emulator, Linux DVD emulator, Gentoo Linux.

Mount an ISO (CD/DVD) image in Windows CD/DVD emulator

CDs/DVDs, who needs them?

It is better to just mount the ISO image you need and live in the virtual world; when that works for you. It is harder to do an OS installation like that, but for many other cases, this is fine.

For Windows the best way to do that is to use Daemon Tools CD/DVD emulator.

the Daemon Tools download link

However, you may use the MS tool (not as slick as daemon-tools and unsupported ), it can be downloaded at:

Microsoft's Virtual CD/ISO mounting tool (Virtual CD Control panel)


Don't have an ISO? Create your own: ISO Recorder v2. This allows a simple right click on a CD drive to write an iso. e.g:

Wikipedia on ISO

Keywords: ISO, mounting, ISO mounting, CD emulator, DVD emulator, Daemon Tools, Mount ISO, Windows, Windows CD emulator, Windows DVD emulator.

Windows and multiple file renaming (creating a sequence)

I never thought to try this, but the multiple rename is built in to Windows. It is simple enough. (1) Select multiple files. (2) Rename one of them. (3) The others will be renamed and have a sequence of numbers appended to the end of the file name. It is a little more verbose at the below link.

Tips, Articles & Reviews on Windows, Gadgets, Web Services, etc, Collected in My Bucket: Rename Multiple Files For Free

Keywords: multiple file rename in Windows, rename files, Windows, Windows XP, rename multiple files windows GUI.

Links to Search Engine Webmaster Tools (Google, Yahoo, MSN)

After the invent of Google's Webmaster tools there appeared the Yahoo Site Manager. I suspect that MSN is going to be next in that space. It is in these tools that the user gets the ability to configure some of the high level details for search engine optimization.

(1) Google - Webmaster Tools
(2) Yahoo - Site Explorer
(3) MSN/live search - MSN Search Web Crawler and Site Indexing Tools and Services for Site Owners - No tools/submission
(4) Ask.com - Webcrawler information - No tools/submission

For those of you that are casual interested in increasing your page ranks/positions, this would be these would be the places to go.

At this point in time, the primary functionality these appear to provide is the ability to submit Sitemap feeds to the search engine. Allowing for two methods of listing sites for these search engines, (one) the crawler/bot and (two) the submission of URLs.

Prior blogs on a similar vein:
(1) Google Webmaster Tools and HOWTO/how to add a sitemap for Blogger/blogspot.com
(2) Google webmaster Tools and HOWTO/how to verify your Blogger/blogspot.com site

Wednesday, November 01, 2006

HOWTO use logparser to find what machine locked out an account

I've been in a number of organizations where the mystery of who, what, where, when and how an account got locked out is umm, a mystery. This is because the regular login/logout data and other authentication data is bundled in with the 1 or 10 errors per day. The truth is obfuscated by too much data. The biggest problem always appears to be with service accounts, with a number of dependencies on an account.

It turns out it can be relatively simple to right a MS logparser query to hunt out this information. AKA, logparser is your best friend. The second think to note is EventID 644 indicates the event that is written when an account is locked out. The rest is really the details.

  1. install Logparser - Logparser download from Microsoft
  2. Create a file by the name of lockedaccounts.sql at the same directory as your logparser.exe (or add the folder that holds logparser.exe to the path).
    file contents:

    SELECT timegenerated AS TimeLockedout,
    extract_token(strings, 0, '|') As UserName ,
    extract_token(strings, 1, '|') AS OriginatingMachine,
    EventID,
    SourceName,
    Message,
    CASE EventID
    WHEN 529 THEN 'Invalid userid/password'
    WHEN 531 Then 'Account disabled out'
    WHEN 539 Then 'Account locked out'
    WHEN 530 Then 'Outside of logon time'
    WHEN 532 THEN 'Account Expired'
    WHEN 535 THEN 'Password Expired'
    WHEN 533 THEN 'User not from allowed system'
    WHEN 644 THEN 'Account Auto Locked'
    WHEN 540 THEN 'Successful logon'
    ELSE 'Not specified' END AS EventDesc,
    strings
    INTO lockedact.csv
    FROM \\%DOMAINCONTROLER%\Security
    WHERE EventID=644
  3. run the following command: (it has a 90 second run time on ~500,000 remote eventviewer records)
    C:\>logparser file:lockedaccounts.sql?DOMAINCONTROLER=ADOMAINCONTROLER
  1. Open the lockedact.csv file in Excel. Hunt out the account you want to analyze. The Column ‘OriginatingMachine’ is the machine that locked out the account. The other columns are there for info only. Note that EventID 644 is the one you are interested in (http://www.ultimatewindowssecurity.com/events/com264.htm ).

For more (much, much more) on logparser: http://www.logparser.com

For a more elaboration on logparser scripts see my blog entry on logparser here: Logparser examples and more.

Keywords:Windows, Active Directory, how to, HOWTO use Microsoft logpaser to find what machine locked out an account in Windows, what machine locked out an account.

HOWTO regexp Visual Studios and automating code/sql/data creation

This is my little documentation area of regexps that I create when I need to convert one for of text to another. Being in Windows, I've taken to simply using the Visual Studios regexp Find and Replace.

My plan is to update this entry as do other regexps in my day to day work life.

First off feel free to check the Use: Regular Expression button in the Find and Replace Dialog



(1) IDL definition into PL/SQL
To replace:
LINEITEMFLAG_****** = 1, //bit 1
with
insert into lineitem_flags values ('1', 'LINEITEMFLAG_****** Description', 'LINEITEMFLAG_******');

regexp search for: {LINEITEMFLAG_[A-Z,_]*}:b*=:b*{.*},.*$
regexp replace with: insert into lineitem_flags values ('\2', '\1 Description', '\1');