jump to navigation

Linux ifconfig / route commands February 18, 2007

Posted by chris in : linux , 4comments

Add a static IP Address:
ifconfig [interface] [ip address] netmask [subnet address]

Add a default gateway or route:
route add default gw [ip address]

Using sysprep to create windows xp images February 16, 2007

Posted by chris in : windows , 1 comment so far

I frequently forget the steps involved in Sysprepping a box. The easiest way to prepare a machine for imaging with sysprep can be broken into 4 steps.

Step 1. Creating the SysPrep Folder
Step 2. Run SETUPMGR.EXE
Step 3. Customer Software
Step 4. Sealing the Work Station

(more…)

Get active directory ldap attributes from the command line with ldifde February 14, 2007

Posted by chris in : windows , add a comment

Technet gives the following description of this command. “Creates, modifies, and deletes directory objects on computers running Windows Server 2003 operating systems or Windows XP Professional. You can also use Ldifde to extend the schema, export Active Directory user and group information to other applications or services, and populate Active Directory with data from other directory services.”

I typically use this to find out a specific ldap attribute which is useful when I’m writing VB scripts that loop through each user object in active directory and change attributes. This command is run from the windows command line. Here are some examples.

Display ldap attributes for all user objects within active directory:
ldifde -d “cn=Users,DC=3rdleveldomain,DC=2ndleveldomain,DC=com” -f con

Display ldap attributes for a single user object:
ldifde -d “cn=Firstname Lastname,cn=Users,DC=3rdlevel,DC=2ndleveldomain,DC=com” -f con

Further details on this command are available at Microsoft Technet

WaitForExit method, running command line args in c#, and other hacks February 12, 2007

Posted by chris in : other , 3comments

I’ve been writing an application that allows me to easily deploy files to our corporate website. Since I had to build under the guidelines of my boss and this is my first c# project I needed to do some hacking that most experienced c# programmers would laugh at.

The application does a few things. One it allows you to select any number of files or folders and click a button to automatically add them to zip file via winzip, open an sftp connection with SecureFX, and make an ssh call using plink for additional commands which unzip the file and sync the files across multiple web servers. . I needed a way for my ssh function to wait for my sftp function, and for that to wait for my zip function to complete.

I use the Process.Start method to access the windows command line and pass arguments. Then I used the WaitForExit method to stop any further code from executing until the current process completed. Both are in the System.Diagnostics namespace.

(more…)

what to write? February 12, 2007

Posted by chris in : rant , add a comment

At work right now so I’ll make my first blog post here short. I’ll use this as a place to store important information, specifically technical information related to I/T (programming functions, linux how to’s, and windows stuff). Basically this will be my fail-over when my brain crashes trying to remember something.

Got a lot of stuff I’m working on so I should start doing lots of blog entries shortly.