Network Stuff

Simple commands available from the DOS Prompt for checking your network status

Ping
ipconfig
net
net view
TraceRt
route



C:\>ping



Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list


Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.


C:\>ipconfig /?



Windows 2000 IP Configuration


USAGE:
ipconfig [/? | /all | /release [adapter] | /renew [adapter]
| /flushdns | /registerdns
| /showclassid adapter
| /setclassid adapter [classidtoset] ]

adapter Full name or pattern with '*' and '?' to 'match',
* matches any character, ? matches one character.
Options
/? Display this help message.
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.

The default is to display only the IP address, subnet mask and
default gateway for each adapter bound to TCP/IP.

For Release and Renew, if no adapter name is specified, then the IP address
leases for all adapters bound to TCP/IP will be released or renewed.

For SetClassID, if no class id is specified, then the classid is removed.

Examples:
> ipconfig ... Show information.
> ipconfig /all ... Show detailed information
> ipconfig /renew ... renew all adapaters
> ipconfig /renew EL* ... renew adapters named EL....
> ipconfig /release *ELINK?21* ... release all matching adapters,
eg. ELINK-21, myELELINKi21adapter.





C:\>net

The syntax of this command is:


NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]


C:\>net view /?

The syntax of this command is:


NET VIEW [\\computername [/CACHE] | /DOMAIN[:domainname]]
NET VIEW /NETWORK:NW [\\computername]






C:\>tracert


Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.




C:\>route


Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination]
[MASK netmask] [gateway] [METRIC metric] [IF interface]

-f Clears the routing tables of all gateway entries. If this is
used in conjunction with one of the commands, the tables are
cleared prior to running the command.
-p When used with the ADD command, makes a route persistent across
boots of the system. By default, routes are not preserved
when the system is restarted. Ignored for all other commands,
which always affect the appropriate persistent routes. This
option is not supported in Windows 95.
command One of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route
destination Specifies the host.
MASK Specifies that the next parameter is the 'netmask' value.
netmask Specifies a subnet mask value for this route entry.
If not specified, it defaults to 255.255.255.255.
gateway Specifies gateway.
interface the interface number for the specified route.
METRIC specifies the metric, ie. cost for the destination.

All symbolic names used for destination are looked up in the network database
file NETWORKS. The symbolic names for gateway are looked up in the host name
database file HOSTS.

If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
(wildcard is specified as a star '*'), or the gateway argument may be omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The '*' matches any string,
and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
The route addition failed: The specified mask parameter is invalid.
(Destination & Mask) != Destination.

Examples:

> route PRINT
> route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
destination^ ^mask ^gateway metric^ ^
Interface^
If IF is not given, it tries to find the best interface for a given
gateway.
> route PRINT
> route PRINT 157* .... Only prints those matching 157*
> route DELETE 157.0.0.0
> route PRINT






 

Underground XML

In this article I will focus on how you can use XML to package up the details of mentally defective and physically handcapped people who possess small fortunes and seamlessly deliver their data to a syndicated crime consortium.

If you are ethically opposed to fleecing the less abled of their savings, then you can take heart that you can make a tidy profit without getting your hands dirty.

The benefits of an XML approach to this kind of problem are endless. With faster development turnaround, a wide choice of tools on any platform and a self-describing format, these helpless victims can be stripped of the wealth they barely knew they had in half the time it takes traditional fraudsters.

The data itself can be acrued using legacy techniques, such as hanging around differently-abled sporting teams, or posing as the family member of a mentally defective person in order to gain the trust of their community.

But once you've compiled the necessary information on their bank accounts, credit cards, home addresses and level of disability, that data can be sent straight into the modern age.

There is currently a lack of XML schemas available for describing potential fraud victims. You may find the need to compose your own XSD, though of course reusing schemas from the insurance industry should be a suitable starting point. You will find a number of these available through OASIS and Microsoft's BizTalk.

In this information age, such data is at a premium. With gross profits of up to one hundred thousand dollars per end-victim, you can charge huge sums for the data you supply.

By providing your data through a subscriber-based web service, you can make it available to numerous faceless crime syndicates, criminal cartels, banks and insurance companies all over the world.

Scalability is what makes this form of racketeering so lucrative and interesting. Once you've enabled the fleecing of a number of these underpriveleged persons, you will find them to be in a state where, for a minimum of money, they are willing to provide you with fresh and valuable data about their ill-brained friends. Once a certain critical mass of victim/informers has been achieved, the business will practically run itself, giving you a veritable licence to print money.

I may not be able to write a new column for a few weeks, as I have just purchased a large brick of cocaine that I intend to mix with egg white and paint all over my body. But sooner or later I will return.

In the meantime, try to keep thinking of new and interesting ways to use XML.

Breast of luck

Danford.



Danford C Meridius is a guest columnist. His opinions are not those of the Secret Geek website. His advice is provided for satirical purposes and should not be followed.

 

Encrapulation Considered Harmful

tdd,

Coining a new term: Encrapulation.

OO design without the design? Beware of Encrapulation

Encrapulation is what occurs when all the useful chunks of code become trapped so far inside obscure and fidgety modules buried deep inside your components within components that they are no longer usable.

Wrappers within wrappers, the hall of wrappers, obfuscated object heirarchies, over use of duplicitous global objects...

Any encrapulated OO project needs to be urgently refactored.

 

How To Revise a Dog Ugly Manuscript

Notes on how to revise a very bad manuscript. Largely gleaned from the book 'How to Write a Damn good novel' by James Frey.

  • Analysis. For the entire book compose:
    • step sheet
      • logical flow
      • emotional flow
      • PREMISE
      • Choice of viewpoint
    • character profiles
      • physical
        • gender/age/height/weight/hair/face/features
        • deformities/health/strength/dexterity
      • social
        • names/nicknames
        • upbringing/childhood/family/friends
        • education/career/hobbies
      • mental
        • reactions/attitude/ego/outlook/temper
        • fears, neuroses, anxieties
      • RULING PASSION
  • Action. For each chapter/scene, consider:
    • cut irrelevant scenes (irrelevant to the premise)
    • fix logical errors
    • start as far into the action as possible
    • emotions/drama/style
      • empathetic:
      • reader's emotions in check with empathetic characters
      • consistent and effective:
        • characterisation
        • viewpoint
        • tense
      • conflict
        • not sudden or jerky
        • not stagnant
        • intensifying
        • start: hook
        • end: tag
      • dialogue parsing:
        • triteness/cliches
        • characterisation
        • 'indirect'
        • clever
      • prose parsing:
        • not vague
        • specific, detailed
        • tasty, fragrant, tactile, colourful, harmonious, melodious; (stimulating)
        • rhythm (suitable when aloud)
        • consistent tense
        • consistent viewpoint
    • mechanics
      • spelling
      • grammar
      • your checklist:
        • eg: 'ly' words, common typos, character names, cultural specifics

Output

  • the Novel itself
  • Stepsheet
  • Character profiles
  • Executive summary
  • personal checklist
  • premise (1 line summary)
  • blurbs/taglines/teasers
  • scrap heap of rejected ideas/fragments
  • notes (from working through problems, research etc.)
  • Archive of old copies, backups (softcopies and hardcopies)

For a list of bad practices you can follow, see the ever-popular How to write a novel

Agent Required!

Personally, I've written a cracker of a novel, but haven't found a suitable agent for it yet. If you know a good literary agent for a satirical, sci-fi crime novel -- email me, leonbambrick@gmail.com

 

The Complete Software Lifecycle

How many job applications ask for experience with 'the complete software lifecycle?' Do you have experience with 'the complete software lifecycle?'.

Just as different species of fish have different lifecycles, so different species of software have different lifecycles. I've produced a chart to show a quite common example of the complete software lifecycle, as I've seen it happen.

If my resume says i have experience with the complete software lifecycle, then this is what i'm talking about.

The Complete Software LifeCycle
 

Visual Studio .Net Tips

Turn off animations

The way menus slide out might look funky... but its got to waste a few cycles. Increase responsiveness by turning off the animations.

  • Options
    • Environment
      • General
        • Animate environment tools (Set to OFF)

Make strings stand out

Most typographic errors in the code are caught by the compiler. Embedded strings, unlike code, are not parsed but you can be sure your endusers will notice your typos! Highlighting the strings as shown is guaranteed to help you pick up your mistakes sooner!

  • Options
    • Environment
      • Fonts and colours
        • Display items
          • String
            • Foreground: White
            • Background: Purple

Turn on Word Wrap

Some purists might argue against word wrap. But in VB.net if you leave it turned off you're not likely to notice any mistakes relating the 'Handles' keyword.

  • Options
    • Text Editor
      • Basic
        • General
          • Word Wrap

Adjust your Tab Sizes

it's important to make your tab sizes Consistent with other people working on the same project as you. Other wise false deltas will be created in VSS change tracking.

  • Options
    • Text Editor
      • Basic
        • Tabs
          • Tab size: 2
          • Indent size: 2

Set Tab Order for multiple controls

  • Select all the controls you want to set tab order for.
  • Select View-> Tab order
  • Click on the controls in the order you want their tab order to be set.
(reference from msdnmag)

Set code to editable while debugging

Although it's not as good as real 'edit and continue' it's still a lot better than the default (don't allow changes while debugging). And yes, it can lead to 'unexpected behaviour' - but i'm sure you understand that your changes won't be picked up until you restart.)

  • Options
    • Debugging
      • Edit and Continue
        • Allow me to edit VB files while debugging

Make breakpoint warnings stand out

Ordinarily, breakpoint warnings look the same as normal breakpoints. This is misleading, so I recommend the following change to your settings.

  • Options
    • Environment
      • Fonts and Colours
        • Display Items
          • breakpoint (warning)
            • Fore ground
            • (change to cyan, rather than white.)
 

Technical Writing: breadth first with iteration.

No truly sane developer enjoys writing user documentation. This is a short note about fulfilling your obligation to write technical support documentation. Originally it was a comment on Roy Oshergrove's 'Iserializable' blog. Roy seemed to like it, so I've republished it here.

Writing, whether technical or creative, always has defects. It never has the elegance of code, it can never be evaluated completely. There are always more ways you can look at it.

So accept that it's going to be bland and imperfect and boring. Accept that very few people are going to read it or refer to it. All you have to know is that when people do, they'll be able to get nice simple instructions that will lead them to the answer they are looking for.

Use lots of sub headings. Sub headings are easy to write. (if you can't even write the subheadings then you're really in trouble) write enough sub headings the thing is practically done. That's your first draft. Print it out. Give yourself a pat on the back.

Write very quick notes under each sub heading. print it out and re-read it, judging it only for its truthfulness and its completeness. Do not parse it for grammar, style, sophistication, sexiness or anything else. Where it isn't complete, add more notes. Where it isn't truthful, make it truthful. Ugly is fine. Stupid is okay. Boring is expected. Just make it truthful and complete. Now print that out. that's your second draft. You've earned another pat on the back.

Now track down your sub-editor. This is probably your wife/secretary/mother - someone who is not your boss, who loves you unconditionally, who is not as technical as you (they're NOT concerned with the facts or the completeness of what you've written.) Plead with them until they agree to read through it with you. They love you unconditionally, so they will agree. They won't hate what you've written, but they'll know which problems of style are the important ones. And once you've read it through with them, you will too. The third draft's the charm. Once that's done, send it out into the world. You've wasted enough time already.

cheers
Leon bambrick

 

Smartjelly Improvements

I've improved smartjelly's commenting engine, so people can write comments more reliably (and more safely). There were flaws in there previously that would have allowed an XSS attack to succeed, and some formatting ugliness that had to go. It's incredible how much effort is required to get the little things right. Next step is to allow comments to be posted at the end of an article (rather than in a separate page) as this makes the commenting more interactive.

a very simple change, but one I like is that now there's a message telling you that html isn't allowed. I hate when feedback forms give no indication of whether HTML is or is not allowed.

So what happens now when you leave a comment is I html encode your comment(so all tags are turned into 'literal' tags), and i append a <br/> tag to any carriage-returns.

Also, comments now give you the exact time (rather than just the date) when the comment was made (in GMT).

There are about a dozen other 'behind-the-scenes' improvements to commenting, and still literally hundreds of other improvements I'd like to make to SmartJelly. But it's hard to work on it, when it's written in 'traditional' ASP (a doomed technology). If I had a viable server, I'd rewrite the thing in ASP.net tomorrow. ASP.net, unlike ASP, is a thing of true beauty.

On the topic of blog comments, I've given some thought and will write something constructive about this after I've had a long nap

 

"Dot-Net Awareness" Day!

Every second rate charity seems to have its own special day, when poor office Jills and Johnnies are forced to Dress Like Idiots for an Inconsequential Reason.

In an effort not to be left behind in this world of Idea Viruses, I'd like to propose that Microsoft DotNet should have its very own day, with stupid costumes to boot.

Dress as your favourite namespace for 'Dot Net' Awareness Day!

To try and shock those managerial executives who continually resist upgrading from legacy applications into dotNet, why not dress as a Demon from the DLL Hell!?

Or to show the light, why not attach some angelic wings and dress as a heavenly Assembly with click-once deployment?

Can't afford an expensive costume? Why not dress as the Garbage Collector? Sure to be a hit with the ladies! Or you could dress as the Global Assembly Cache and eat all the doughnuts. Why limit yourself to just one doughnut? Thanks to side-by-side versioning, you can eat all the Doughnuts you want!

I already have my costume designed. Mentally at least. While everyone else will be dressing as the predictable System.Data.SqlClient, or the angular System.Xml, I will be wowing my colleagues in a stunning garment fashioned to represent the dazzling System.ComponentModel.Design.Serialization namespace, with a very natty little IDesignerSerializationProvider hat.

And you can be sure there will be no Java drank on "Dot-Net Awareness" Day!

Even the little kids can join in. Imagine how unique your children will look, dressed in their little GUID costumes.

Hang on... the caffeine high is fading away now... hallucinations subsiding... no longer envisioning dot net as a bizarre series of monsters... must get on with work...

 

Dot Net Rookie Mistakes

Includes such rookie problems as:
My freaking breakpoint doesn't work!
"Find" doesn't find what I'm looking for!
and the famous Bypass Proxy for Local Addresses Gotcha.

My freaking breakpoint doesn't work!

Reason:

Maybe the configuration settings are set to 'Release' instead of 'Debug'.

This normally leads to about two hours of frustration as a dot net rookie desperately beats their head against the keyboard. But it's a lesson that once learnt, is retained for life.

I can't get this freaking tool window to dock properly!

Patience is a virtue... Slow down and try again. You'll get the hang of it. And if it's any consolation, tool window docking is made far more intuitive in Whidbey (Visual Studio .net 2005).

I've released a windows executable to someone else and it doesn't work!

First thing it may be of course is that the .Net framework is missing from their machine. If that's the case, I'm sure a clever kid like you would find it in no time. No, I want to write about a slightly more interesting problem.

If you realise a tool onto a shared drive, or a server drive, you may get a security exception, something like this:

Unhandled Exception: System.Security.SecurityException: Request for the permission of type System.Security.Permissions.EnvironmentPermission, mscorlib, Version= 1.0.3300.0, Culture=neutral, PublicKeyToken=b76a5c461734e019 failed. etc.

If that's the case you may need to log on to the server in question and use the Microsoft .Net Framework Configuration utility (in the control panel/administrative tool). You may have to grant the necessary permission to the assembly in question. (You can also use the "Microsoft .Net Framework Permissions Wizard" to achieve the same result.)

"Find" (F3 or Ctrl-F) doesn't find what I'm looking for!

Find no longer lets you search the entire project. To do this, instead use 'Find in Files' [Ctrl-Shift-F]. C++ Developers have been doing this for years.

Another gotcha with 'search' is that unless you select 'Search hidden text' it won't search inside any collapsed regions (ie. #Regions that are hidden).

Source safe keeps showing me the wrong version of my project!

When dealing with branched versions of projects in source safe, they will sometimes (often?) hold onto the wrong server bindings, which basically means that although you want to work on one version, you keep getting shown another. If left untreated, This is of course configuration management Death. To fix this in Visual Studio .Net, go to: "File|Source Control|Change Source Control|Server Bindings"

ASP.net works fine at home - but when ever I try to run an application at work, I get a 404 error! God mother freakin damnit!

Okay - chill out on that language you nasty geek. This is often caused by failing to check the 'Bypass proxy for local addresses' checkbox in your browser (under Options|Connections|Settings|Lan Settings|Proxy Server).