Archive for the 'Windows' Category

Windows lacks the linux ’shutdown’ command, so it is a pain to get it to schedule a reboot in the future. Linux’s shutdown command make this easy, just issue the command ’shutdown -r +60′ for example to reboot an hour in the future.

No such luck in Windows, you need to download a separate program to do this. It is a sysinternals program, you might remember sysinternals from such utilies like FileMon and ProcessMonitor.

The program we use for this is called PsTools and more specifically the file psshutdown.exe.

[Download PsTools here]

Place psshutdown.exe into a directory for future use, for this example we will use c:\tools\.

Then open a command prompt and type the following command:

at 2:00am c:\tools\psshutdown.exe -r -f -c -t 10 /accepteula

This will result in:

Added a new job with ID = 1

You can verify this task has been added by looking at the Scheduled Tasks - the job name will be At1 if you haven’t scheduled any other tasks via the command line.

If all goes will, Windows will reboot at 2:00am, or your specified time.

Clients using Symantec Antivirus Corporate Edition requires a password while uninstalling the client. The default password out of the box is symantec. If you have changed this password within the Symantec System Center - then you need to use that password. If you have changed the uninstall password and you no longer have access to this password - well then shame on you. Fortunately there is a workaround:

1) Open Regedit

2) Browse to HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\ VirusProtect6\CurrentVersion\Administrator Only\Security\

3) Change the value for this key from 1 to 0

useVPuninstallpassword

4) Close the registry and retry the uninstall

[From Experts Exchange]

For those of you, or those of you with clients, who have MSDOS based programs like Wordperfect and you want to print to a networked printer, this is all you need. This also works for other printers who use USB ports or something other than LPT.

The solution was to map the share to an LPT port using [I]net use[/I]. For example:

[I]net use lpt1 \\printserver\sharename /persistent:yes[/I]

If the USB printer is on your local machine, you can share it and then map this same printer locally to an LPT port.

From Microsoft KB314499

Downloading a CAB file to install onto your Windows Mobile device can be a pain - after downloading the cab file to your desktop, you need to first copy it to your device, then find the cab file to install and then proceed to install it.

CABviaActiveSync is a simple, free program that adds a context menu to automatically parse the cab file on your desktop and install it via activesync. This can save you a bunch of steps and is incredibly handy if you are like me and are always installing/uninstalling programs to check out.

Download CABviaActiveSync from Modaco.

Let’s say you use a piece of software which is horribly designed (or maybe you just don’t know how to use it properly) and you need to click a button thousands of times.

See specifics below if your are curious of my particular predicament!

Instead of clicking your mouse button like a crazy person - you can automate this task using software such as AutoHotKey. Using this software, it allows you to create a keyboard shortcut that lets you do a number of things without human intervention. This is handy for just about any sort of automated tasks where you find yourself clicking alot.

These instructions are for getting your mouse to click at a particular point on your screen a number of times.

Install AutoHotKey

First step of course is to install AutoHotKey.

Figure out where you need to click

Launch the included program AutoIt3 Window Spy. This will start reporting a bunch of information to you including Window Title and Class, Mouse Position, and other information that is useful if you are creating a more complicated AutoHotKey script.

Point the mouse to the Window where you want to click a bunch of times, at the place you wish to click. Make sure the window is active - this is important as we want to be specific as to where we click. Write down the coordinate for the “In Active Window”.

Create the Script

When you first run AutoHotKey (AHK from now on) it will ask you if you want to create a sample script in My Documents. Go ahead and do this.

At the bottom of this screen, add the following line:

!g::Click x,y,n

Where x = X coordinate, y = Y coordinate, and n = the number of times you want to click. For example in my use I used !g::Click 334,333,3000 which clicks in the active window at 334,333 exactly 3000 times.

!g means that the key combination will be Alt-G

Save this file and then Run AHK again. This will load it into memory.

Activate the window you wish to click in - then press Alt-G (at the same time)

Clicks away….

Your PC will click however many times in the active window at the specified location. Now your mouse will not wear down from the clicking and your time will also be saved!

Warning: Rant: This is why I needed to do this. The ever-fabulous Adobe Photoshop Elements does not have a great system to change your disk file structure. So when I wanted to change my photos directory from having lots of directories like 2006-01-23-10234323 into subdirectories like 2006/2006-01-23-10234323, it does not provide an easy way to do this. I wish it had advanced folder management like the MP3 Library Manager Media Monkey does - it allows you to rebuild your folders based on date, album, title, and just about every other piece of data imaginable. So when I did this manually and then wanted to “Reconnect” my photos to the correct location on the disk - Photoshop Elements has a horrible reconnect dialog that makes you click “Reconnect” on every picture you want to reconnect. I couldn’t find a way around this.

Adobe take note - you need to add 3D acceleration to your software. I’ve just checked out Pictomio and it really has a kick-ass GUI which utilizes your 3D accelerating video card to view and zoom photos. This provides a much better viewing experience than my current image library software, Adobe Photoshop Elements. Photoshop elements uses what I assume is a 2D rendering of photos - both zooming and scrolling through your photos is slugging even on my fairly new PC. Take a look at Pictomio:


It is a pretty screenshot but you need to actually use the software to appreciate how smooth the GUI functions. This reminds of me of Coverflow and Apple - purchase this technology and incorporate it into your product Adobe - or your image library software will be out of date in no time.

Photoshop Elements releases about 1 version per year, and I do not see any reason to upgrade every year. First of all, it is expensive compared to other image cataloging software; secondly the number of features that are added just don’t justify the expense every year. Usually the updates are small little features that I do not use.

On another note; I also came across PicaJet which is another image catalog and management system and it also uses 3D acceleration in it’s interface. If Adobe doesn’t come around soon I may switch my 30,000+ photo catalog over!

Download Pictomio!

The technology has been around for a while to do unattended OS installs, using kickstart on redhat for example. These installs are typically done remotely. Kickstart is basically done off of an image file, which can be inserted via a floppy, CD, or now a USB Keychain drive.

datacenter-web.jpg

Another technology that has been around a while is pxeboot. Using pxeboot, you can boot images directly from a supported network card. Most network cards have a built in bootp interface. The network card first looks for a bootp (aka dhcp) server to assign an IP address and load an image. It then uses the trivial ftp protocol to look for a boot image, called pxelinux. Then pxelinux loads the correct installer image. So the process looks like this:
Power on->Boot from Network->Bootp->Tftp->pxelinux->Boot Image Loads
After loading the boot image, the system is on its own as far as doing the install. Best of all, this means that as long as the OS has an unattended boot image, it can be loaded from this method. For anyone running a datacenter, this is excellent! It provides a way to do these installs from the next city, the next state, or even halfway across the world!

Setting up the bootp server

fot80-web-1nato-boot.jpg

The bootp protocol is supported in Redhat’s (and I imagine others) dhcp server.

For this exercise, I am going to assume you are using yum. But, you can do these installs the same with sudo apt-get install or installing the rpms/debs manually.

First, install dhcpd:
yum install dhcpd
Then setup the dhcp server
# vi /etc/dhcpd.conf

ddns-update-style interim;
# deny unknown-clients;
not authoritative;

option domain-name "ks.domain.com";
option domain-name-servers 10.0.2.1;
option subnet-mask 255.255.255.0;

allow bootp;
allow booting;

option ip-forwarding false; # No IP forwarding
option mask-supplier false; # Don't respond to ICMP Mask req

option subnet-mask 255.255.255.0;
option broadcast-address 10.0.2.255;
option routers 10.0.2.1;
option domain-name-servers 10.0.2.2;
option netbios-name-servers 10.0.2.2;

subnet 10.0.2.0 netmask 255.255.255.0 {
option routers 10.0.2.1;
range 10.0.2.10 10.0.2.100;
authoritative;
allow unknown-clients;
next-server 10.0.2.2; # name of your TFTP server
filename "pxelinux.0"; # name of the bootloader program
}

group {
next-server 10.0.2.2; # name of your TFTP server
filename "pxelinux.0"; # name of the bootloader program
}

You can see from this code that we are setting up the install network on the 10.0.2.x private network.

The image filename the dhcp server tells the network card to boot off is pxelinux.0.

TFTP Server

The TFTP server is necessary to grab the initial image files from. I recommend either tftp-hpa for linux, or tftpd32 for Windows. For the rest of this article, I will assume that you are using tftp-hpa on linux.

After compiling tftp-hpa from source, enable it adding/editing /etc/xinet.d/tftp like so:

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

Restart xinetd. The tftp server is now serving files from /tftpboot/

PXELinux

PXELinux is a software package from H. Peter Anvin. It loads other OS images from its initial boot interface. See his site for more information on this powerful package. Download the pxelinux package and extract pxelinux.0 to /tftpboot/. Then create the directory /tftpboot/pxelinux.cfg.

When the system boots, it looks for an configuration file (similar to syslinux syntax) in the pxelinux.cfg directory. First it tries to match by the MAC address of the network card, the it goes by a hexadecimal representation of the IP address, then it loads default. for example, if the Ethernet MAC address is 88:99:AA:BB:CC:DD and the IP address 192.0.2.91, it will try (in order):

/tftpboot/pxelinux.cfg/01-88-99-aa-bb-cc-dd
/tftpboot/pxelinux.cfg/C000025B
/tftpboot/pxelinux.cfg/C000025
/tftpboot/pxelinux.cfg/C00002
/tftpboot/pxelinux.cfg/C0000
/tftpboot/pxelinux.cfg/C000
/tftpboot/pxelinux.cfg/C00
/tftpboot/pxelinux.cfg/C0
/tftpboot/pxelinux.cfg/C
/tftpboot/pxelinux.cfg/default

Notice the mac address has 01- preceeding it, and each colon is replaced by a - dash.

Now, to make sure I don’t inadvertantly install over a good os, I make sure to keep a default file in this directory with the following contents:

default linux
label linux
localboot 0

This tells the system to boot off of the hard drive.

A CentOS Remote install

centos1.png

CentOS is one of the easier OSes to install via this method. I will use this for an example during this article.

We first need a CentOS image to boot from and use for the install image. Lets put this image in the tftpboot directory in a location called images/CentOS/4.4_i386. Rsync is a good choice to use, but you can really use anything you want to transfer the image (off of a CD for example). Here is a set of commands that works for me:

mkdir -p /tftpboot/images/CentOS/4.4_i386
cd /tftpboot/images/CentOS/
rsync -r rsync://mirror.linux.duke.edu::centos/centos/4.4/os/i386 4.4_i386

Then copy the boot images from the CentOS directory to the tftpboot directory:

cd /tftpboot/
cp /tftpboot/images/CentOS/4.4_i386/i386/isolinux/initrd.img initrd_centos_4.4.img
cp /tftpboot/images/CentOS/4.4_i386/i386/isolinux/vmlinuz vmlinuz_centos_4.4

Its ok to leave those guys alone. If you would ever need to update them to include other drivers, you can do so but that is beyond the scope of this article.

Lets create a /tftpboot/Kickstart/ks.cfg file now:

lang en_US
langsupport en_US
keyboard us
mouse none --device null

#important - where to load the images from
network --device=eth0 --bootproto dhcp --hostname ks.hostname.com
nfs --server 10.0.2.2 --dir /tftpboot/images/CentOS/4.4_i386

rootpw changeme
firewall --disabled
authconfig --enableshadow --enablemd5
timezone --utc America/NewYork
bootloader
reboot

# clears the master boot record and all partitions on the hard drive
zerombr yes
clearpart --all

# creates your partitions.
part /boot --fstype ext3 --size=300 --ondisk=sda
part /tmp --fstype ext3 --size=2000 --ondisk=sda
part / --fstype ext3 --size=2000 --grow --ondisk=sda
part swap --fstype swap --size=2000 --ondisk=sda

%packages --resolvedeps
@ legacy-network-server
@ legacy-software-development
@ server-cfg
@ system-tools
@ network-server
@ editors
@ admin-tools
@ text-internet
mdadm
kernel
grub
e2fsprogs
expect
ncompress

%post
rpm --import /usr/share/doc/centos-release-4/RPM-GPG-KEY-centos4
echo "co:2345:respawn:/sbin/agetty -h -t 60 ttyS0 9600 vt102" >> /etc/inittab
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

For a comprehensive guide on the options for this file, check out the Redhat 9 Kickstart options HOWTO which is still good for our purposes.

In the above code we are loading the OS from a nfs share.

If nfs is not installed you’ll need to do that first:

yum install nfs
chkconfig nfs on

Add the following line to /etc/exports

/tftpboot 10.0.2.0/255.255.255.0(sync)

Start up nfs

service nfs start

Putting it all together

Now, lets use the above to put this automated installer to work!

You’ll need to set up your hardware on the network along with the installation system. You’ll need to set up the boot order to let the machine boot off the network firstly; then HD, CD or floppy next. If it boots to the disk first, the machine will never contact the automated installer and will just try (and fail, if the HD is blank) to boot off the the HD.

You will also need to mark down the MAC Address of the network card the server will be booting off of. This will be retrieved from the actual hardware; off of the boot menu; or as a last resort you can boot it off of your DHCP server and then check the log for when this server hits the installer machine.

Lets create our pxelinux boot file. It should be named based off of the Ethernet MAC Address. For example: /tftpboot/pxelinux.cfg/01-88-99-aa-bb-cc-dd

Note that the mac address has an 01 in the very beginning of it; sometimes this is not included when you write down the mac address of the system.

default linux
serial 0,9600n8
label linux
kernel vmlinuz_centos_4.4
append ksdevice=eth0 console=tty0 console=ttyS0,9600n8 load_ramdisk=1 initrd=initrd_centos_4.4.img network ks=nfs:10.0.2.2:/tftpboot/Kickstart/ks.cfg

You may have noticed that this file specifies a few things. The initrd and vmlinuz files we copied, handle the kickstart of the image. /tftpboot/Kickstart/ks.cfg is the kickstart configuration file and is needed to do the actual unattended install. If you do not need remote serial console access during this install, you should remove the string “console=ttyS0,9600n8″ which simply adds output to the serial port.

That is it! Now that all of the files are set up; you can boot/power cycle the server. This is what should happen:

  1. Server boots and looks for DHCP server on its network interface. Installer server responds and assigns server an IP address
  2. Server begins looking for a pxeboot configuration for what to do. It (hopefully) finds the file /tftpboot/pxelinux.cfg/01-88-99-aa-bb-cc-dd and boots using this
  3. It loads vmlinuz_centos_4.4 and the initrd initrd_centos_4.4.img.
  4. Kickstart config is told to load from the nfs share nfs:10.0.2.2:/tftpboot/Kickstart/ks.cfg
  5. Kickstart install begins like a normal Kickstart install from a floppy or CD install

Here is a catch: After the installation starts; remove the pxeboot.cfg file. If you do not remove/move this file, when the machine reboots after the install it will just do the remote installation again, resulting in an infinite install loop.

Bonus: Windows Unattended Installation

xplogosharp.jpg

In order to perform this same process but with Windows; we use the Unattended installation system.

Follow the directions for basic installation of this system.

Once you have it installed; copy :unattended install:/linuxboot/tftpboot/* to /tftpboot/

Then create a pxeboot.cfg file with the following lines:

default unattended
label unattended
kernel bzImage
# Add options (z_user=..., z_path=..., etc.) to this line.
append initrd=initrd_unattended

The Unattended installer will then work off its own installer system; which will automatically provision Windows versions - I’ve tested 2003 but it should also work for 2000 and XP installs.

In order to customize the installs further, you can use nLite to slipstream service packs and hotfixes; as well as make other changes to the default install.

Conclusion

Using this method allows you to deploy lots of installs with minimal datacenter presence. Once you have the hardware set up and ready to go; you just need to create the pxeboot config file and power cycle the machine. This has great benefits if you are far away from the datacenter; or what to deploy a lot of machines without doing manual installs. If you have any other solutions that will automate installations in a similar manner; please let me know!

The Opera team has announced that Opera 9.5 Alpha is now available.

I haven’t been an Opera user in the past. However, I’ve used their Mobile (Opera Mobile and Opera Mini) and their Wii browser and have been impressed. I’ve been missing out!

Opera 9.5 is nice - if you haven’t tried Opera lately I would give it a shot. I’ve heard other users rave about previous versions, but I always thought to myself: “It’s just another browser”.

9.5 has a ton of features but here are the highlights in my opinion:

  • Fast Page Rendering Engine
  • History Search
  • Bittorrent Client Integrated
  • Synchronize With My Opera
    - Synchronize Bookmarks, Speed Dial, and other Preferences
  • Improved Skin - Apple Human Interface Guideline support
  • Mail Client Built In

There is a slew of other changes in this release. I’ve found several pages which did not render properly or at all in this version - I know they are working on such things and there is a “report this page” button within the menu which helps you test their alpha stage release.

This Opera Browser definately gives me a “next gen” feeling and anyone who considers themselves an early adopter should give it a try!

If you are a Google user - meaning Gmail, Google Docs, Google Calendar, Google Reader, etc - then you should know that by default, once you log in your sessions are typically not encrypted between your browser and the Google servers.

For some more technical information on this, check out dmiessler’s post on the subject.

He mentions using bookmarks to make force your browser to use Google’s secure connections - however I’ve noticed that occasionally depending on how you arrive to your Google services that you will switch to an unencrypted session without warning.

For that reason, If you are using Firefox and greasemonkey, I highly recommend installing the “Google Secure Pro” userscript. It automatically switches you from using http:// to https:// to ensure your data is encrypted to Google’s servers. This will increase your security greatly from using the unencrypted connections, which is good if you transfer confidential data over e-mail - like most normal people do!

I’ve been using the VPN Software Hamachi for several years now and thought I would share my experiences with it.

Previous to being purchased by LogMeIn, Hamachi was a smaller company which designed this great software. It is now offered in 2 versions, the free “Basic” version and the paid “Premium” version. The premium version is currently around 3.25-4.95 a month, depending on how many licenses you need and how much you pre-pay.

The free version gives you basic VPN connectivity and allows you to control smaller networks which is great for your own personal secured network. There are some pretty cool features in the “Premium” version - to see all of them click here.

The idea is that you install Hamachi on each of your PCs which you would like to connect to your VPN. In my case, I have my Home PC, my home File Server, my Work PC and my laptop all connected. The great thing about Hamachi is you are not just limited to Windows machine - my file server is Linux and works great with Hamachi. It officially supports Windows, Linux, and OSX - so you could install it onto your Mac as well.

Once hamachi is installed, follow the directions on how to set up each client. With the first client you set up, you will want to create a new Network that will include all of your personal PCs that you wish to connect. From there, each client you add you will need to add to this network so the can all talk with each other.

After all computers are connected to the network - you have your VPN up and running. It works just like with any VPN - those IP addresses can be accessed just like the PC is on your local area network.

So, what does this mean? You can map a network drive to be a local drive, which is actually being served off of your VPN. You can connect to VNC using this IP address - which is a secure way to do this so all of your traffic is encrypted over the internet. You don’t have to worry (as much) about sending information over the internet in plain text. I even have my media server connected so that I have my entire music library available through the program of my choice (MediaMonkey).

So if you haven’t tried it already, give Hamachi a try!

Technorati Tags: , , ,
  • Welcome to systemBash, a technology and system administration blog by David Drager. If you enjoy this sort of content, can can subscribe to the RSS using the link to the right.