Tuesday, September 26, 2006

Understand And Configure Linux Printer System

Starting Redhat 7.3, Redhat Linux support two type of printing system known. These two subsystem are known as LPRng and CUPS respectively.

  1. LPRng printing system, Redhat default printer subsystem, provides printconf as printer manager utility to configure /etc/printcap configuration file, printer spooler, etc.

    While at command prompt, executing printconf-tui (Redhat 7.3) or redhat-config-printer-tui (Redhat 8.0) to bring up command line version of LPRng printing manager.

    For the graphical version, click on the Main Menu => System Settings => Printing or type redhat-config-printer or printconf-gui at a XTerm or Gnome terminal shell prompt to bring up the same GUI program.

  2. CUPS, shorts for Common UNIX Printing System, is an Internet Printing Protocol-compliant system for UNIX and Linux. CUPS printer subsystem uses the printer manager utility called lpadmin to configure /etc/printcap configuration file, printer spooler, etc. If CUPS is not the default printer subsystem, launch the Printer System Switcher application by executing the command redhat-switch-printer and set CUPS as the new default printer subsystem.

    To allow only a few selected users to use a printer called inkjet-graphic, execute the command lpadmin -p inkjet-graphic -u allow:keith,jazz,alice and these setting will be updated to /etc/cups/printers.conf configuration file.
Note! The printer manager utility, printconf or lpadmin, saves any printer configurations made to the /etc/printcap setting file. If there is a need to make any printer configurations outside the printer manager utility, add them to the /etc/printcap.local file. The /etc/printcap file will be deleted whenever the printer manager executing or a server reboot.
Steps to add new printer is almost the same among printer manager utilities. In brief, these are the key points to get it works:
  1. Give a descriptive queue name to distinguish the new printer with other printers or network resources, such as keith_laser, boss_laser, tenfloor_inkjet, etc.
  2. Choose the appropriate printer queue type, such as LOCAL queue type for local physical attached printer, JETDIRECT for jetdirect printer, etc.
  3. If there is option to select the Printer Device, rescan the devices for the correct device, or create a custom device. This will be the /dev entry that represents the interface between the device driver and the printer itself. In most instances, the device will be named /dev/lp0.
  4. Choose a Printer Driver by selecting one from the extensive list. Drivers marked with an asterisk (*) are recommended drivers. If to configure remote printer or printer that does not have a corresponding driver in the list, the safest choice would be Postscript Printer. For JetDirect printers, Raw Print Queue is recommended.
To enable local printer sharing for remote host:
  1. In local host which the printer attached, edit the /etc/lpd.perms configuration file to add in one line that will read ACCEPT SERVICE=X REMOTEHOST=</etc/host.lpd and make sure it should added before the line containing REJECT SERVICE=X NOT SERVER.
  2. In the local host as well, edit the /etc/host.lpd printer access control file add in the full qualify DNS host name or IP address, one record per line, of hosts that are allowed to share the printer attached.
  3. At the remote host, add the network printer as adding local printer except one has to choose a Unix Printer queue type and type the print server hostname and port (usually 631).
Related information:
  1. LinuxPrinting.org is a database of documents about printing, along with a database of nearly 1000 printers compatible with Linux printing facilities.
  2. Linux printing how-to from the Linux Documentation Project.
  3. Search more related info with Google Search engine built-in

Monday, September 25, 2006

Redhat Enterprise Linux System File Permission

Redhat Enterprise Linux device file permission could not be changed simply by using the chmod command. Instead, the device file permission is set by udev hotplug subsystem which is included in almost every 2.6 kernel based Linux distribution that is shipping.

The configuration file /etc/udev/permissions.d/50-udev.permissions defines the permission of each devices present in the Linux system. For example,

  • To change the raw devices file permission, search for the line that read as raw/*:root:disk:0660
  • To change tape drive file permission, search for the line that read as st*:root:disk:0660
The default permission defined is 0660. Simply change the 4 digits code as usual to an expected permission, say 0666 instead of 0660.

Related information:
  • Search more related info with Google Search engine built-in

System And Network Monitoring Freeware

Nagios is the answer!

Nagios is the a GNU GPL software that could used to monitor diverse servers and networking devices. Although the Nagios server running only in Linux and UNIX variants there are Windows based Nagios client that could used to monitor Windows server as well.
It is licensed under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation.

Nagios is a powerful system and network monitoring application. It monitors hosts and services specified, alerting administrators when threshold triggered, and when they recover to healthy state.

Nagios is only available in Linux or UNIX variants. Although, it could helps to monitor Windows servers as well via the Windows version of Nagios client.

Nagios features:

  1. Monitors network services such as SMTP, POP3, HTTP, NNTP, PING, etc.
  2. Monitors server resources such as processor load, disk usage, etc.
  3. Simple plugin design that allows users to easily customize own service checks.
  4. Parallelized service checks.
  5. Ability to define network devices hierarchy using "parent" hosts, allowing detection of and distinction between network devices that are down and those that are unreachable.
  6. Notifications to contacts of email, pager, or user-defined method, when service or host status change.
  7. Ability to define event handlers to be run during service or host events for proactive problem resolution.
  8. Automatic log file rotation.
  9. Support for implementing redundant monitoring hosts.
  10. Optional web interface for viewing current network status, notification and problem history, log file, etc.
Related information:

Internet Explorer Turns FTP Browser

FTP is a legacy file transfer protocol that has been widely used since the day of networked computing.

Other than using the serious typing of command line FTP client, such as the standard FTP client offers by all Windows system, Internet Explorer able to serve as GUI FTP browser too!

Follow these simple steps to turn IE into a graphical FTP client:

  1. Click the Tools menu from Internet Explorer,
  2. Click on Internet Options,
  3. Click the Advanced tab,
  4. Check the check box labeled as "Enable Folder View For FTP Sites",
  5. Check the check box labeled as "Use Passive FTP". Set this option only if the PC is behind a firewall.
  6. Click OK button to complete the setting.
  7. Now, IE is ready to serve as graphical FTP browser. For example, type ftp://keith@188.8.1.10 in the IE address bar and press ENTER to instruct IE connect to FTP server 188.8.1.10 using FTP user account keith. Enter the password when prompt.
  8. Click OK and wait. After successful authentication, an interface similar to Windows Explorer shown. Copy files or folders as usual!
Related information:
  • Search more related info with Google Search engine built-in

Saturday, September 23, 2006

Tweaking Windows Recovery Console

The Windows Recovery Console is designed to help system administrators recover Windows-based computer that fails to start up properly. It is available only in command prompt. Hence the name "Console" attached. It looks like the Windows 9x boot disk, but Windows Recovery Console is more powerful and features rich than the old Windows boot disk.

Basically, Windows Recovery Console allow system administrators to:

  1. Copy, rename, replace, and access to operating system files and folders
  2. Enable or disable Windows services for next system bootup
  3. Repair the file system boot sector or the Master Boot Record (MBR)
  4. Create and format partitions
By default setup, Windows Recovery Console with Administrator account logon allows access to only
  1. the root folder
  2. the %SystemRoot% folder and sub folders of the Windows installation
  3. the Cmdcons folder
  4. the removable media drives such as the CD-ROM drive or the DVD-ROM drive
Trying access to folders other than those listed above will rejected with an "Access Denied" error message. Besides that, Windows Recovery Console disallow copy files from local hard disk to removable storage such as floppy disk. However, Windows Recovery Console allow copy files from removable storage to local hard disk or copy files from one hard disk to another hard disk.

Although, limitations imposed on default setup that stated above could be resolved by
  1. First, enable setting in Local Security Policy.

    1. Click on Start button,
    2. Click on Run menu,
    3. Type gpedit.msc and click OK button,
    4. Click on Computer Configuration, Windows Setting, Security Setting, Local Policies, Security Options,
    5. Look for "Recovery Console: Allow floppy copy and access to all drives and all folders" policy on the right pane and double-click it,
    6. Select Enabled,
    7. Click OK

    Note! As a security measures, it might be wise to double-click on "Recovery Console: Allow automatic administrative logon" policy too and disable it.

  2. Second and last, boot up to Windows Recovery Console, logon with Administrator login account, and execute these two commands:

    1. set AllowRemovableMedia = true
    2. set AllowAllPaths = true

    3. It might be useful to turn on these two features too:

    4. set AllowWildCards = true to allow wildcard support for some commands such as del.
    5. set NoCopyPrompt = true to disable prompt when overwriting an existing file.
Related information:
  • Install Windows Recovery Console
  • Search more related info with Google Search engine built-in

Friday, September 22, 2006

Shell Scripts Monitoring Disk Space Utilization

Nothing special. Just a simple shell scripts, could be served as an introduction of Unix Shell scripts programming, written to check disk space utilization of Linux (applicable to Unix too) filesystems or partitions.

Note! Ignore the left most numeric digits which are not part of the Shell scripts coding. These are line number indicators, which could be turned on in Vi editor using the :set nu command code.

It might be useful to comment out line 14th and remove the hash key on line 15th, which disable echo alert to console and enable alerts emailed to mail box. Configure Linux scheduler via the crontab -e to run this shell scripts, perhaps once a day, and get system administrators alarmed of critical free disk space before the system comes to halt.

Related information:

Tuesday, September 19, 2006

Restart Disabled Windows Services

What could be done besides rebooting Windows server when a particular Windows service become unavailable to start, stop, pause, resume, or restart?

Restarting a Windows service, particular a poorly coded third party Windows service, may turns out to become unable to start, stop, pause, resume, or restart, after the service timeout and fail to startup successfully again. All these five common actions or tasks are dimmed and become unavailable. Restart the Windows server is not the only way, and might not advisable too, to resolve the problem.

Try this before deciding to reboot the Windows server:

Resolve Windows service which dimmed all its associated actions, i.e. start, stop, pause, resume, restart

  1. Right-click on the Windows service,

  2. Select property,

  3. Set the Startup type to Disabled,

  4. Click OK,

  5. Set to Startup type again to either Manual or Automatic,

  6. Click OK again,

  7. Now, this particular Windows service might able to perform one of the five common actions again. Restart the Windows server if these do not work perfectly too.

Fine Tuning Nagios Performance

Fine tuning Nagios for optimum performanceThese optimization tips are suggested by Nagios official documentation. It might be useful to fine tune Nagios for optimum performance and effective monitoring service.

  1. Enabling aggregated status updates with the aggregate_status_updates option to greatly reduce the load on the monitoring host especially when monitoring a large number of services. The downside of this approach is getting delay notification on status change.

  2. If standard status log is used instead of aggregated status updates, consider putting the directory where the status log is stored on a ramdisk. Ramdisk helps to speed thing up by saving a lot of interrupts and disk thrashing.

  3. Use max_concurrent_checks option to restrict the number of maximum concurrently executing service checks. Nagios is overloaded if the extinfo CGI showing high latency values, say more than 10 seconds, for the majority of service checks.

  4. The overhead needed to process the results of passive service checks is much lower than that of normal active checks. Passive service checks are only really useful if there are some external applications doing some type of monitoring.

  5. Compiled plugin (C/C++) runs more efficient and faster than interpreted script (Perl, etc) plugins. If really want to use Perl plugins, consider compiling them into true executable using perlcc utility which is part of the standard Perl distribution or compiling Nagios with an embedded Perl interpreter.

    In order to compile in the embedded Perl interpreter, set the --enable-embedded-perl option in the configuration script before compiling Nagios. In addition, use the --with-perlcache option to enable embedded interpreter caching the compiled Perl scripts for later reuse.

  6. The check_ping plugin used to check host states will performs much faster if break up the checks. This is due to the fact that Nagios judges the status of a host after executing the plugin once.

    Hence, it would be much faster to set the max_attempts value to 10 and only send out 1 ICMP packet each time, instead of specifying a max_attempts value of 1 in the host definition and having the check_ping plugin send 10 ICMP packets to the host.

    However, the pitfalls of this arrangement will happens when the hosts are slow to respond may be assumed to be down. Another option would be to use a faster plugin check_fping as the host_check_command instead of check_ping.

  7. Do not schedule regular checks of hosts unless absolutely necessary. Set the value to 0 for check_interval directive in the host definition to disable regular checks of a host. Use a longer check interval if really need to have regularly scheduled host checks.

  8. Disable the use_aggressive_host_checking option to speed up host checks. The trade off is that host recoveries can be missed under certain circumstances.

  9. Set the command_check_interval variable to -1 if running a lot of external commands, i.e passive checks in a distributed setup, will cause Nagios to check for external commands as often as possible. This is important because most systems have small pipe buffer sizes (4KB). If Nagios doesn't read the data from the pipe fast enough, applications that write to the external command file (the NSCA daemon) will block and wait until there is enough free space in the pipe to write their data.

  10. System configuration / hardware setup directly affecting how the operating system (and Nagios application) performs. CPU and memory speed are obviously factors that affect system performance, but disk access is biggest bottleneck. Don't store plugins, status log, etc on slow storage medium such as old IDE drives or NFS mounts. Always opt to use UltraSCSI drives or fast IDE drives whenever possible.

    Note! Many Linux installations do not attempt to optimize IDE disk access. Use hdparam to change the IDE hard disk access parameters to gain speedy features of the new IDE drives.

Sunday, September 17, 2006

Tweaking Windows Server LargeSystemCache

LargeSystemCache determines whether Windows 2000 Server should maintains a standard size or a large size file system cache, and influences how often the system writes changed pages back to hard disk.

Increasing the size of the file system cache generally improves server performance, but it reduces physical memory space available to applications and services. In addition, writing system data less frequently minimizes use of the kernel disk subsystem, but the changed pages occupy memory that might otherwise be used by applications.

LargeSystemCache is DWORD registry data type that could be located at registry path

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

Setting LargeSystemCache to 1 (system default)

Establishes a large system cache working set that can expand to physical memory, minus 4 MB, if needed. The system allows changed pages to remain in physical memory until the number of available pages drops to approximately 250. This setting is recommended for most computers running Windows 2000 Server as file server on large networks.

Setting LargeSystemCache to 0

Establishes a standard size file system cache of approximately 8 MB. The system allows changed pages to remain in physical memory until the number of available pages drops to approximately 1,000. This setting is recommended for servers running applications that do their own memory caching, such as Microsoft SQL Server, and for applications that perform best with ample memory, such as Internet Information Services web server.

Other than access to registry via regedit.exe and edit directly, alternative method to tweak LargeSystemCache is by

  1. accessing to the Server Optimization tab in Network And Dial-up Connections,
  2. right-click My Network Places,
  3. click Properties,
  4. right-click Local Area Connection,
  5. click Properties,
  6. click File And Printer Sharing For Microsoft Networks,
  7. and then click the Properties button,
  8. to set the LargeSystemCache to 0, select the Maximize Data Throughput For Network Applications option,
  9. to set the LargeSystemCache to 1, select Maximize Data Throughput For File Sharing.
The default setup of Windows 2000 Server initialize LargeSystemCache to 1 which is ideal when running as file server. However, setting LargeSystemCache to 1 can degrade service performance. As such, it is not appropriate when running as application servers such as Web server, SQL server, Exchange server. In this case, reset LargeSystemCache to 0 by selecting the Maximize Data Throughput For Network Applications option in Network And Dial-up Connections.

Compare And Find Best Compression Format

Compression ratio depends on data and algorithm used for compression. Compression speed counts on CPU power and data compression algorithm in used. Some compression utilities such as 7za, gzip, bzip2, etc, come with options to set level of compression. Setting to higher level of compression will means more time taking to compress and decompress too!

Follow the links below to the comparison of various file compression formats. Find the best compression scheme that suit better for a particular application.

  • Lzop official site
  • Rzip official site
  • 7za / 7-Zip / LZMA related article
  • Maximum Compression benchmark
  • Practical compressor test benchmark
  • Ultimate command line compressor benchmark
  • Linux compression tools benchmark. Find the balance between level of compression ratio and time require to complete the compression process.
  • Excerpt from the source:

    lzop is the fastest tool. It finishes about three times faster than gzip but still compresses data almost as much. It finishes about a hundred times faster than lzma and 7za.

    Get even higher compression ratios by combining lzma with tar to increase storage space effectively by 400%.

    The data compression tool with the best trade-off between speed and compression ratio is rzip. With compression level 0, rzip finishes about 400% faster than gzip and compacts data 70% more. Rzip default compression level is another top performer too as it can increase effective disk space by 375% but in only about a fifth of the time lzma can take.

    Rzip accomplishes this feat by using more working memory. Whereas gzip uses only 32KB of working memory during compression, rzip can use up to 900MB! But that's okay since memory is getting cheaper and cheaper.

Thursday, September 14, 2006

7-Zip Better File Archiver Freeware

7-Zip is a full function file archiver freeware!

7-Zip default to compress files in .7z compression format using LZMA compression algorithm.

LZMA, shorts for Lempel-Ziv-Markov chain-Algorithm, is a data compression algorithm developed on 2001. It uses a dictionary compression scheme similar to LZ77 (such as Gnuzip - better known as gzip in Linux world) but features with
  • high compression ratio
  • variable dictionary size up to 4GB
  • compressing speed at about 1MB/s and decompressing speed at about 10-20MB/s on 2GHz CPU
  • little memory require for decompressing depends on dictionary size
  • small code size for decompressing at about 5KB
  • supporting multi-threading and Intel Pentium 4 HT technology
Besides supporting 7z compression format, 7-Zip too able to compress and decompress some other popular compression formats.
  • Supported compression file formats:
    7Z, ZIP, GZIP, BZIP2 and TAR
  • Unzip compressed file formats:
    7Z, ZIP, GZIP, BZIP2, TAR, RAR, CAB, ISO, ARJ, LZH, CHM, Z, CPIO, RPM, DEB, and NSIS
While the classic Winzip, WinRAR, PowerArchiver, etc discontinue as true freeware, 7-Zip becomes better alternative freeware of file archiver as it is distributed under the GNU LGPL, with exception for the RAR plugin.

Others attractive features of 7-Zip such as:
  • Supports files size up to 16000000000GB
  • Unicode file name
  • Self-extracting capability for 7z format
  • Integration with Windows Shell
  • Ability of using any compression, conversion or encryption method
  • Multilingual interface up to 63 languages at time of writing.
  • Available in various platforms such as both Windows 32-bit and 64-bit version, Unix, FreeBSD, Redhat, Fedore Core, Debian, Gentoo, Mac OS X, BeOS etc

DisablePagingExecutive Boost Windows Performance

Tweaking Windows core performance by editing registry key called DisablePagingExecutive only if

  1. plenty of memory installed, e.g. 1 GB RAM or more
  2. most of the memory being unused or idle on most of the time (wasting resource!), and
  3. Windows 2000 and above (Windows XP, Windows 2003) is running.
DisablePagingExecutive is a DWORD data type that could be located at registry path

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

The initial setup of Windows XP default DisablePagingExecutive value to zero. Setting this value to 1 to enable Windows core to fully utilize the huge memory installed. Tweaking this registry key benefits driver debugging too as all of the code and data are always memory resident. It also improves Windows system core performance by preventing high frequency of disk read in order to get code and data out from hard disk to memory for processing!

Related information:
  • Search more related info with Google Search engine built-in

Wednesday, September 13, 2006

Find And Remove Duplicate File

When the hard disk space going larger and larger, more files are storing into it. Over the time, there might be a lot of duplicate files scatter around the file system.

As bulk of these redundant files are here and there, redundant files mess up file system, decrease system performance, wasting valuable disk spaces, and ineffective file backup. It takes time and could be a really tedious job to find and delete these redundant files when low disk space alarmed!

MD5 checksum could be a good candidate to find duplicate and redundant files! It could be used to precisely identify which files have updated since last backup done by comparing the MD5 checksum of files between source and target of the backup.

MD5 short for Message-Digest algorithm 5, is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications used to check the integrity of data stream, TCP/IP packets, files, etc.
Related information:

  • MD5Sums is a tiny Windows command line freeware that able to automatically generate MD5 checksum for all files in a directory except sub directories. Technically, a Windows shell scripts such as VBScripts could be written to programmatic find duplicate files that reside in the file system by calling this tiny freeware via Run method of WshShell object.
  • MD5 unofficial homepage to find implementations in various programming languages.
  • MD5 shell scripts to find unique and redundant files in given directory
  • Search more related info with Google Search engine built-in

Tuesday, September 12, 2006

Unzip RAR With ExtractNow Freeware

ExtractNow is a great non-adware freeware used to decompress RAR compression file format!

As its name suggests, ExtractNow is merely an decompressing utility and is not a complete archival software. Nevertheless, this simple free utility is more than enough to satisfy today most decompressing functions. Other than supporting RAR compression file format, ExtractNow also support today majority compression file format such as ZIP, ISO, BIN, IMG, IMA, IMZ, 7Z, ACE, JAR, GZ, LZH, LHA, and SIT!

ExtractNow developer suggest not to bundle DLL that used to enable SIT compression file format support in its installer so as to reduce (installer) file size. Having say that, separate download of DLL is needed if expected to enable SIT support in ExtractNow.
Related information:
  • ExtractNow official site
  • Click here to separate download DLL to enable SIT file compression support
  • Search more related info with Google Search engine built-in

Sunday, September 10, 2006

Sharing Big File With File Splitter

Email a big file of few megabytes as attachment is never a good idea as it will likely to hang up the email server. Because of that, most email servers are likely configured to not relay or process email with non friendly attachment too. If it is really need to email such attachment,

  • Split the file into pieces of smaller size with file splitter such as File Chopper.
  • Compress the file to highest possible compression ratio and creating span disk (support by most zip utilities such as WinRar & Power Archiver)
  • Upload the file to public file server such as upload.com and rapidshare.de that offers file sharing services.
    CAUTION! It is better to zip the files with strong encryption before uploading to any public file sharing providers. Zip the files with encryption helps to reduce file size as well as protect sensitive data from the eyes of non expected readers!
  • Combination of the three method - split the file, compress it with password encryption, and host the split-compressed file to public file server.

    File splitter is preferable than span disk feature of zip utilities as file split could be rejoined with Windows built-in command whereas "span disk" require the receiving end to have similar zip program installed.
Related information:
  • File Chopper is a tiny file splitter program that able to chop a file into arbitrary file size and automatically generate a MS-DOS batch file used to rejoin the pieces of file back to its original file. The batch file is using Windows built in DOS copy command to do the job. For example, typing
    copy /b File.1 + File.2 WholeFile.exe
    to rejoin split files called File.1 and File.2 back to its original and workable file called WholeFile.exe
  • Uploading.com only allow unlimited download at certain countries or registered users only. Downloading speed is quite fast as at time of writing.
  • Rapidshare.de works similar to uploading.com
  • Using Lycos Mail account. The redesign of Lycos Mail upgraded to allow unlimited attachment size as claimed in its official site, provided not exceeding the default 3GB email storage space allocated to each email account. Although, the recipient's email system might not accepting such emails with huge attachment size. So, use Lycos Mail to send email with unlimited attachment size only to recipient's Lycos Mail email account! Perhaps, this is the Lycos Mail's intention to get more users to attach with Lycos Mail and not the others like Yahoo! Mail or Gmail!
  • Search more related info with Google Search engine built-in

Using VNC And Redhat Linux

VNC shorts for Virtual Network Computing which is based on Remote Frame Buffer (RFB) protocol. VNC enable any VNC compatible clients running on any platform to access remotely, in graphical mode, to any VNC compatible server running on any platform!

For example, a VNC client running on Windows XP able to remote access to the Redhat Linux X windows via VNC daemon running on Redhat Linux, or the Redhat Linux VNC client able to access to Windows XP and run the Windows program in Windows XP via the VNC session.

The term daemon is normally refers to Linux/Unix-based server application/process. So as here. And the term "server" is then refers to a Windows-based server application/process.
VNC provides not only GUI remote access but also persistent desktop where the long running program or unfinished editing works could be kept running while VNC session is closed. User could reconnect back later at some other places and straight away continue to work on the incomplete tasks.

However, there is a different in handling convention VNC session between Linux to Windows and Windows to Linux. When access from Linux VNC client to Windows VNC server, the screen seen in Linux VNC client is the same as one see in front of the real physical GUI console. When a Windows VNC client connects to Linux VNC daemon such as VNC Server, the screen seen in Windows VNC client is different from the real physical GUI console. This happens because the Linux X windows use the default :0 display (X server screen number) on startup and the port is not sharable with other sessions. The work around is by using x11vnc or the Redhat bundled Vino as VNC daemon.

Vino allow legacy VNC client access directly to the :0 display. For example, Redhat Enterprise Linux ES 4 comes with vino RPM package. Once installed, the Vino is called Remote Desktop and normally grouped under Preference menu. Its simple GUI configuration make it easier to startup the Vino's VNC daemon!

VNC Server is bundled with all Redhat Linux distribution. Once installed, start the VNC Server by typing vncserver at command prompt. The vncserver command, is actually a shell scripts file, bring up the first VNC Server daemon listening to TCP port 5801 & 5901 by default. To bring up second VNC Server daemon, specify a port number other than the default. For example, type vncserver :2 to bring second daemon listening to TCP port 5802 & 5902. Port number starting from 5801 is meant for Java-enabled web browser connection, while port number starting from 5901 is meant for legacy VNC client connection. Although VNC Server could not directly connecting to :0 display by default as Vino or x11vnc do, this feature could be enabled by using VNC loadable module for the X Window system or upgrade to VNC Server version 4.x.

x11vnc works like Vino but has much more features bundled such as built-in SSL encryption/authentication, file transfer, etc. x11vnc is written in plain C language and uses only standard libraries. So, there is no compatibility and performance issues by using x11vnc as VNC daemon, indeed!

Connecting from VNC client of any platform to Windows VNC server is quite straightforward. Just type the IP address of the Windows VNC server in VNC client will do. However, a combination of IP address and display port is used to connecting VNC client of any platform to Linux VNC daemon. The display port number is taken from the last 2 digits of Linux VNC daemon listening port number (ignore leading zero if any). For example, type http://10.170.46.111:5801 at any Java-enable web browser in order to connect to a Linux VNC daemon that listening to port 5801 or type 10.170.46.8:1 at any legacy VNC client in order to connect to Linux VNC daemon listening to port 5901.

Related information:

What Happen When Deleting A File

What happen to a file when deleting it from Windows? The native Windows OS delete function simply remove the file entry (complete path and filename) from directory entries. The file's data content, however, is still remain untouched in the storage area. That is why to copy a file of few hundred megabytes take some minutes while deleting it takes just few seconds.

Disk formatting isn't different. Unless low level format or Zero Fill is performed, an advanced undelete utilities able to recover data from a hard drive formatted with high level or native disk format utilities. With low level format, the entire hard disk is then filled with "zero", hence overwrite any data reside in the hard disk!

Note, it is better to use low format utilities from the respective hard disk manufacturer instead of generic low formatter (such as the BIOS built-in function) to avoid the hard disk unusable later!
Related information:
  • How to undelete a file from Windows
  • How to delete a sensitive file securely
  • SDelete command line utility used to delete sensitive data securely
  • Sure Delete Window GUI utility used to delete sensitive data securely
  • Create File - Windows 2000 Resource kit used to generate empty file of arbitrary size up to 4GB (when running on Windows XP)
  • WipeFree command line utility used to generate dump file to fill up free disk space where the deleted file reside
  • Search more related info with Google Search engine built-in

Zero Fill Sure Delete Sensitive Data

Simply delete a file or format a hard disk by conventional way doesn't securely protect sensitive data stored inside the hard disk!

There are chances that other people able to recover or undelete the sensitive data by using simple undelete utilities such as Restoration.

However, there are utilities too that able to anti-undelete data deleted from hard disk! Anti-undelete utilities such as SDelete and Sure Delete will overwrite the sensitive data at least one time (or more than one times for more security in mind) with arbitrary bits or zero bits as Zero Fill does!

SDelete is a command line utility which is easy to use yet secure than Windows built-in del DOS command or Windows native delete function! To make it easy to use,

  1. Click on Start button,
  2. Click on Run menu,
  3. Type cmd in the Open field and click OK to call up Command Prompt window,
  4. Type echo %PATH% at the command prompt and press ENTER to output a list of default program paths separated with semi-colon.
    The default program path is used by Windows Run menu and Command Prompt to automatically locate a file or program. For example, the Run menu automatically locate cmd.exe and execute it, after typing cmd followed by pressing ENTER in previous step shown. If the cmd.exe is not reside in default program path, the Run menu will not able locate and execute it automatically.
  5. Put the Sdelete.exe to the any one of the folder path listed in echo %PATH% output, preferable is to use the system folder (e.g. C:\Windows\System32 in a default Windows XP setup),
  6. Add a MS-DOS Command Prompt shortcut with customized option switch to Context Menu (if the shortcut is not there).

    After this step, using command line utilities will becomes easier. Just right-click on any folder and click on the MS-DOS Command Prompt shortcut added to Context Menu, the MS-DOS Command Prompt will opens and automatically pointing to the complete folder path of which the folder being right-clicked. Now what? Just type sdelete SensitiveFile.dat to delete a file called SensitiveFile.dat resides in that particular folder - hassle free!
Related information:
  • SDelete command line utility used to delete sensitive data securely
  • Sure Delete Window GUI utility used to delete sensitive data securely
  • Create File is one of Windows 2000 Resource kit (creatfil.exe) used to generate empty file of arbitrary size up to 4GB (when running on Windows XP). Use it to create as many empty file as possible to fill up all the empty space reported by Windows will able to wipe off deleted file data that reside at these free disk space.
  • WipeFree command line utility used to generate dump file to fill up free disk space where the deleted file reside. It is better than creatfil.exe as it doesn't limited to 4GB file size. Although, its speed is lower than creatfil.exe does.
  • What happen to a file when deleted from Windows
  • Undelete files from an emptied Recycled Bin with Restoration
  • Enable MS-DOS faster change path and auto-complete filename
  • Search more related info with Google Search engine built-in

Thursday, September 07, 2006

Undelete File From Emptied Recycle Bin

Undelete file utilities able to unerase deleted files even the deleted files no longer in the Recycle Bin!

Thanks to Brian Kato's effort in creating a tiny but great utility which he called it Restoration. It is absolutely free, standalone (no installation required, simply double-click and run), freeware (non-adware), tiny, and a must have software in a USB thumb drive. Depending on the free disk space left on hard disk, those deleted files might able be undeleted by Restoration!

So, don't panic next time if the files being deleted accidentally and emptied from Recycle Bin. SHIFT+DEL or even formatting hard disk also not a problem with Restoration to recover the deleted files!



However, do mind to worry on how to prevent highly sensitive and confidential files from recovery by others!

Tuesday, September 05, 2006

GNU GDB Core Dump Debugging

GNU gdb is a must have utility to Linux administrators and programmers! Most Linux package, including Redhat Linux, normally includes gdb as part of the standard distribution. Install the gdb package if it is not there.

GNU gdb is a powerful program debugger and core dump analysis tool. Linux administrators appreciated to have this great utility in tracking down Linux core dump and segmentation fault. Linux programmers rely on it to debug various programming bugs! GNU gdb supports diverse programming languages such as C, C++, Objective-C, Fortran, Java, Pascal, assembly, Modula-2, and Ada.

  • Analysis Linux segmentation fault or core dump file

    1. To analysis Linux core dump file /home/jason/core.18638 with GNU gdb debugger, run command
      gdb /usr/bin/w /home/jason/core.18638
    2. Binary file /usr/bin/w is simply chose. It is because the program which generated this core dump file being unknown in the first place.
    3. The debugger warns that the specified executable file may not match the core dump file. It suggests that the core dump file was generated by "ps ax" command, where an invalid syntax used to run ps command. The gdb output also can't figure out which line of program code trigger the core dump creation, as shown in the last line, "#0 0x4001c9fc in ?? ()", of the screenshot below.

      GNU GDB used to analysis UNIX / Linux core dump file
    4. Rerun gdb again with correct binary by typing
      gdb /bin/ps core.18638
    5. Now, (as shown in screenshot below), gdb load the appropriate symbols to analysis the core dump file. The last line of gdb output, "#0 0x4001c9fc in stat2proc () from /lib/libproc.so.2.0.7", suggests that the core dump generated while executing the stat2proc function in /lib/libproc.so.2.0.7

      GNU GDB used to analysis UNIX / Linux core dump file
  • Debug an executable C program compiled with debugging information

    1. The C program must be compiled with debugging information that gdb could use. For example, type
      gcc -g -o HelloWorld HelloWorld.c
      to generate debugging information with -g option of gcc compiler. Gdb will fails to set appropriate breakpoint, as shown in next screenshot, if no debugging information found.

    2. GDB could not find the corrent break point in C program that is not compiled with debugging information (no -g option of gcc used)
    3. Run the command
      gdb HelloWorld
      to debug the program called HelloWorld
    4. Create a breakpoint to tell gdb where to stop the program execution in debugger. Gdb accept breakpoint at line number or function of the corresponding C program source code. For example:

      • break 679 would instruct gdb to stop at line 679
      • break ComputeMean would instruct gdb to stop right before the breakpoint at ComputeMean function

    5. Type run to execute the program inside gdb.

      The execution will stop right before the breakdown set in previous step or exit on failure. If it fails before the breakpoint, re-examine where suppose to state the break. Repeat the breakpoint step and rerun.

      If no failure found, line number of the corresponding source code where the execution stop will be printed in gdb output. Open the source in program editor, normally Vi editor, to locate that line number to re-code (for debugging) if necessary.

      Type
      run arg1 arg2 < inputfile > outputfile
      if needs to run the program with argument.
    6. Type list to list the whole program source code inside the gdb output.

    7. Using GNU GDB debugger to debug a C program compiled with debugging information.
    8. Type help to get more information on using the gdb command. For example, type help list to get more information on the list command.
    9. After the program execution stop at breakpoint, type

      • next or n to move on to next one line of the program source code.
      • step or s to step into a function and execute the function line by line. Command next will not step into function but execute the function as a whole. Type finish to exit from the middle of line execution inside the function.
      • Type until 967 to execute continuously until line 967 instead of line execution as with next command.
      • Type cont to continuously executing until the end, next breakpoint if more than one breakpoint set, or exit on failure
      • Press ENTER (means repeat the last executed command) after pressing next, n, step, or s command to make life easier.

    10. Type print variable to view the content of variable.
      Use the set variable = 32 command to set the new value 32 to variable.
    11. Use the ptype variable to print the variable type.
    12. Type delete 1 to remove the first breakpoint set.
    13. Type disable 1 to deactivate the first breakpoint instead of removing.
      Type enable 1 again to reactivate the first breakpoint.
Related information:

Monday, September 04, 2006

Windows Media Player Play All Files

Windows Media Player to play real media, quicktime, 3gp, mp3, avi, divx, in fact all known multimedia file formats! No more "codec not found to play this file" kind of problem with a super codec pack called Storm Codec!

Windows Media Player that is installed by default should able to play all digital media file formats of today digital world! It cannot play a digital media file simply because it does not find the codec, which is the real engine that decode that multimedia file format. Having say that, a player is just the graphical interface (frontend) of codec that present to user the equalizer, volume control, playing option, viewer windows, etc. It is the codec that really interpreting the multimedia file and not the graphical interface (the "player")!

So, why installing Real Media player, QuickTime player, Winamp, etc? Instead of installing too many multimedia players (the frontend), install only the different codecs will do the job! Disk space should not be a problem to install bulk of these multimedia players with today hard disk capacity. However, fewer such players installed means less messy and burden to Windows registry, lower the risk of DLL conflict, and a better system performance!

Storm Codec is the answer! It is a freeware, non-adware, stable super codec pack that allow Windows Media Player to play most (if not all) known multimedia formats (quicktime, real media, 3gp, mpeg1, mpeg2, mpeg3, mpeg4, wav, xvid, ogg, aac, etc)! The Storm Codec installer, however, install a GNU GPL player called Media Player Classic (MPC). You may bind all the digital media file formats with this player. Alternative, select "None" for not binding with MPC and manually binding digital media file formats to Windows Media Player.

If there is a digital media file format that cannot be played properly, use the bundled program called Gspot to investigate what codec is needed and revisit Storm Codec home page to check for upgrade availability.

Related information:

Sunday, September 03, 2006

Vi Editor Quick Reference

Read this brief introduction of Vi editor cheat sheet for better understanding on the guides follow:

  1. Always use vim (VI Improved editor) instead of vi, as some of the features outlined below are found only with vim.

    Another great feature of vim is that, it will always open the file at the line where the cursor stop right before existing from the last file access!

    If it has been a habit with vi command name, then make an alias and put it into the login scripts

    alias vi='vim'

    to retain the simplicity of the command name. For the same reason (of simplicity), the vi command name is used to refer vim, throughout this Vi command cheat sheet!

  2. Bold font used to denote Vi editor's command code.

  3. To execute Vi command code, press ESC to enter command mode.

  4. On start up, Vi editor is in neutral mode. Press ESC follow by i to start editing (insert) mode.

  5. Once complete typing the command code, Vi editor automatically shift to editing mode. Some command codes which initial with ":" (colon), there is a need to press ENTER key to end the command code.

  6. If it is not comfortable with the Vi editor color scheme, turn them off by typing:

    • :syntax off - turn off color scheme
    • :set nohlsearch - turn off search pattern highlighting

  7. If Vi editor color scheme is a must, but found that some of the color (especially the color of comment lines) is dim and not bright enough for easy reading, tweak the Vi editor by

    • :set bg=dark
               or
    • :set bg=light

    to find the best Vi editor background color for a better colored visual aid and comfortable reading.

  8. Press V to mark the whole line under the cursor, continuous as cursor move. Press v to start highlight as cursor move.

  9. To get "online" help on any of the Vi editor command codes, press :help command code in the editor.
Bulk delete or copy then paste a block of sentences within a file
  1. Move the cursor to the first line of the block of sentences and press mm
  2. Move the cursor to the last line of the block of sentences
  3. Press d'm to delete the block of sentences from current line where the cursor stop to the line where "m" marker initiated in step 1, OR
  4. Press y'm to copy the block of sentences from current line where the cursor stop to the line where "m" marker initiated in step 1, THEN
  5. Move the cursor to a position of file where it is intended to paste the copied block of sentences
  6. Press p to paste the copied block of sentences.
Bulk copy a block of sentences in file A and paste the copied sentences to file B
  1. Move the cursor to the first line of the block of sentences and press mm
  2. Move the cursor to the last line of the block of sentences
  3. Press "by'm to copy the block of sentences from current line where the cursor stop to the line where "m" marker initiated in step 1
  4. Press :e fileB to open another file called fileB for editing

    • Use command code :!e fileB instead of :e fileB if there is a need to continue editing fileA after exiting fileB.

  5. Move the cursor to a position of file where it is intended to paste the copied block of sentences
  6. Press "bp to paste the copied block of sentences from fileA to fileB.

Copy portion of text in a line then paste to elsewhere within a file
  1. Move the cursor to the first character of the intended portion of text to be copied and press mm
  2. Move the cursor to the last character of the intended portion of text to be copied
  3. Press y`m to copy the portion of text from the first character where "m" marker initiated in step 1 to the last character where current cursor stop.
  4. Move the cursor to the intended position of the file
  5. Press p to paste the copied portion of text.
  • To copy portion of text from file A and paste the copied text to file B, use command code "by`m instead of y`m
  • Read carefully that y'm function differently from y`m as shown. They are different syntax, indeed!

Moving around within the file
  1. Press G to move the cursor to the last line of file
  2. Press 1G or gg to move the cursor to the first line of file
  3. Press nG to move the cursor to the n-th line of file
  4. Press CTRL+b to move the cursor backward in 1 full screen
  5. Press CTRL+f to move the cursor forward in 1 full screen
  6. Press 0 (numeric zero) to move the cursor to the beginning of line
  7. Press $ to move the cursor to the end of line
  8. Press h to move the cursor to the left or press CTRL+h while in editing / inserting mode
  9. Press j to move the cursor down or press CTRL+j while in editing / inserting mode
  10. Press k to move the cursor up or press CTRL+k while in editing / inserting mode
  11. Press l to move the cursor up or press CTRL+l while in editing / inserting mode
  • Use the arrow key of the keyboard to move up, down, right, or left if it works in your terminal.

Check the current position or line number of the file edited currently
  1. Press :set nu to turn on display line numbering feature
  2. Press :set nonu to turn off line numbering feature
  3. Press CTRL+G to show current file name, current line number, total lines, and percentage of cursor location in the file.

Search a keyword within the file
  1. Press :set ignorecase to search in case insensitive mode
  2. Press :set hlsearch to turn on feature of highlighting matched search term
  3. Place the cursor under the search term exists in the file. Then press * (asterisk) to instruct Vi editor to search for next occurrence of this search term in forward position.
  4. Press /apple to search for "apple" keyword in forward position.
  5. Press ?apple to search for "apple" keyword in backward position.
  6. To search for "Apple" or "apple", apply the regular expression by typing command code /[Aa]pple or ?[Aa]pple
  • While in searching mode, press N to instruct Vi editor to search in backward position. Press n to instruct Vi editor to search in forward position again.

Replace matched search keyword with new word
  1. Press :s/Color/Colour/gic to replace "Color" with "Colour" in the current line by ignoring case sensitive and ask for confirmation before replacing.

    • the g flag indicate to replace all occurrence of the pattern found within the line
    • the i flag indicate case insensitive
    • the c flag indicate to ask for confirmation before replacing.

  2. Press & while in next line to tell Vi editor repeating the last used :s command (substitution)
  3. Press :1,$s/apple/orange/g or :%s/apple/orange/g to instruct Vi editor to replace all apple found in file to orange
  4. Replace "apple" with "^" in the previous example to tell the Vi editor to insert orange in every beginning of lines in the file.

Blogger Digest :: Notes of regular expression
  1. The . means any single character except newline
  2. The * means zero or more occurrences of any character
  3. The [] means any single character specified inside the bracket
  4. The [^] means any single character not specified inside the bracket
  5. The \< means match at the beginning of the word
  6. The \> means match at the end of the word
  7. The \<ABC\> means match the word "ABC" exactly (and not "deABCfg")
  8. The ^ means match at the beginning of the line
  9. The $ means match at the end of the line
  10. The ^ABC$ means to search for ABC within the line.

Common editing functions
  1. Press A to indicate start of appending at the end of line
  2. Press a to indicate start of appending after the cursor
  3. Press I to indicate start of inserting at the end of line
  4. Press i to indicate start of inserting after the cursor
  5. Press O to insert one blank line before the current line
  6. Press o to insert one blank line after the current line
  7. Press J to join the next line into the end of the current line
  8. Press 3,5J to join the lines of 3rd to 5th into the end of the current line
  9. Press R to indicate start of replacing characters continuously from the current cursor until the start of next command mode (by pressing ESC key)
  10. Press r to replace one single character
  11. Press ~ to toggle character to uppercase or lowercase
  12. Press u to undo one at a time the series of changes made in backward sequence
  13. Press U to undo the latest change made
  14. Press CTRL+R to redo changes made by undo
  15. Press x to delete character to the right of the cursor
  16. Press X to delete character to the left of the cursor
  17. Press dd to delete the whole line where the cursor rest
  18. Press ndd to delete n lines from the line where the cursor rest
  19. Press d$ or D to delete all characters from the cursor to the end of line.
  20. Press N,Md to delete all lines from line N to line M, inclusively.
  21. Press :! top to execute a shell command called "top" (in this example), and return to the edited file when existing from "top" command.
  22. Press : top to execute a shell command called "top" (in this example), and exit to the shell command prompt when existing from "top" command.
  23. Press :!! to repeat the latest executed shell command inside the vi editor
  24. Press CTRL+l to refresh the editing screen
  25. Place the cursor under a filename that exists in the currently edit file, say "stdio.h" that exists in a typical C program source code, then press gf to instruct the Vi editor search (start from the current directory - hence priority of file returned is from current directory) and open the file named "stdio.h"
  26. Place the cursor under a word which is likely part of the Linux man pages, for example "if", then press K will instruct the Vi editor to look for man page of "if" keyword. If there is, the man page is opened right from the Vi editor.
  27. Press :split to split horizontally the currently edited file into two Vi editor windows.
  28. Press :split file2 to split the Vi editor windows horizontally. The upper Vi editor windows access to file2 while the bottom Vi editor windows access to the currently edited file.
  29. While in splitting mode, press CTRL+WW to switch between split Vi editor window. Copy between files made even easier in split Vi editor windows - just copy the block of lines and press CTRL+WW switching to target file then press p to paste the copied lines.

Customize Vi editor environment
  1. Press :set all to print all current VI setting to screen
  2. Press :set nooption to turn off option (e.g. :set nonu to turn off line number printing)
  3. Press :set tabstop=2 to specify each tab equal to 2 spaces
  4. Press :set autoindent to tell Vi perform auto-indention as per previous indented line in the file
  5. Press :set noautoindent to turn off auto-indention
  6. Press :set nu to turn on line number display.
  7. Press :set nohls or :set nohlsearch to turn off feature of highlighting matched search term.
  8. Press :set hls or :set hlsearch to turn on feature of highlighting matched search term.
  9. Press :syntax enable or :syntax on or :syn on to turn on Vi syntax color scheme
  10. Press :syntax off or :syn off to turn off Vi syntax color scheme
  11. If it is very attractive to use Vi editor color scheme, but found that some of the color is dim and not bright enough for easy reading (especially the comment lines), tweak the Vi editor background color and "lighting" by

    • :set bg=dark
               or
      :set bg=light

    • :colorscheme blue
               or
      :colorscheme murphy (best colored aid)
               or
      Find out what others background color schemes are available by looking at the /usr/share/vim/vim61/colors directory. Find the colors directory from the file system if it is installed at different path, by typing

      find / -type d -name colors

      The colors directory contains *.vim file such as blue.vim, murphy.vim, peachpuff.vim, shine.vim, etc.
Note! The Vi editor environment setting could either

  • Place at the bottom of the file content and remarked as comments by the comment identifier. The comment identifier used is depend on the file type. For example, typical C program source code use /* while shell scripts use # as comment identifier. This method is meant to customize Vi editor environment based on file basis rather than apply globally to all files open in Vi editor.

    When the file opened in Vi editor, Vi editor will start to interpret the Vi editor environment setup and respond accordingly. Press :set modeline command code if Vi editor is not responding to the setup automatically.

    • The customization lines seen in a C program source code:

      /* vim: set autoindent: */
      /* vim: set tabstop=2: */

    • The customization lines seen in a typical shell scripts:

      # vim: set autoindent:
      # vim: set tabstop=2:

  • Create a file called ".vimrc" in home directory. This file will be read by VI editor to customize Vi editor environment for all files opened by Vi editor in the current login session as long as there is no customization embedded in the edited file.

    The $HOME/.vimrc file contains one customization setting per line. Hence the $HOME/.vimrc could be seen as

    • set autoindent
      set tabstop=2
      set nu
      set nohls
      syn off

General options to startup VI editor
  1. Type vi + filename to direct Vi editor open the file at the last line of file
  2. Type vi +n filename to direct Vi editor open the file at the n-th line of file
  3. Type vi -r filename to direct Vi editor to edit the last saved version of the file after crash
  4. Type vi -d f1 f2 to open f1 and f2 in Vi editor windows that split vertically. Then, press :diffupdate to highlight the differences found in f1 and f2. Press :set scrollbind will direct Vi editor to automatically refresh and highlight the differences found between f1 and f2. The :set scrollbind is particular useful when one of the files is editing and Vi automatically highlights the latest differences found between these 2 files.

General options to exit VI editor
  1. Press ZZ or :wq or :x to save and exit the edited file
  2. Press :w to save current file without exiting from the edited file.
  3. Press :w f2 to save the edited file to another file named f2 and continue editing the current file. If no save command given to the currently editing file, no changes made will be saved to this current file!
  4. Press :q! to quit the edited file without saving the changes made

Related information:
  • Search more related info with Google Search engine built-in

Auto Logon In Windows 2000

Default setup of Windows 2000 and above doesn't recommend auto logon feature. Obviously, it is due to security concerns.

Sometimes there might be just good enough to enable auto logon feature. For example, enable auto boot up and auto logon an information kiosk station that housed inside a securely locked stainless steel cabinet in public area.

Steps to enable auto logon in Windows 2000 and above

  1. Click on Windows Start button,

  2. Click on the Run menu,

  3. Type regedit.exe in Open field and click OK to call up Windows Registry Editor,

  4. Locate to HKey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon,

  5. Set DefaultUserName to an user account (either local or domain user account) that intended to automatically logon.

    Use this guide to create the keys (DefaultUserName, DefaultPassword, DefaultDomainName, AutoAdminLogon) if these keys are not exists,

    1. Right click on Winlogon,

    2. Select the New,

    3. Click on String Value,

    4. Enter the name of the key (DefaultUserName, DefaultPassword, DefaultDomainName, or AutoAdminLogon).

  6. Set DefaultPassword to the password of the user account defined in DefaultUserName,

  7. Set DefaultDomainName to a domain that able to authenticate the user account defined in DefaultUserName. If the local user account instead of domain user account is defined in DefaultUserName,

    • key in the computer name (Right click on My Computer, click Properties, click on Computer Name to look for Full Computer Name that define the computer name.), OR

    • leave it blank if the computer is not current joining to a domain.

  8. Set AutoAdminLogon to 1 to enable auto logon (0 to disable it).
To bypass auto logon (so that able to logon as another user account), hold down the SHIFT key during the boot up or logoff process!

Caution! the password is stored in registry as plain readable text!

Alternative option for Windows 2000 machine that is not joining a domain
  1. Go to Control Panel and double click Users And Passwords,

  2. Select the user account from the list (the account to which intended to automatically logon),

  3. Uncheck check box option Users Must Enter A User Name And Password To Use This Computer and click OK,

  4. Key in the password of the user account selected in previous step,

  5. Click the Advanced tab,

  6. Click to clear the Require Users To Press Ctrl-Alt-Del Before Logging On check box.

Saturday, September 02, 2006

Auto Logon In Windows XP

Default setup of Windows XP and above doesn't recommend auto logon feature. Obviously, it is due to security concerns.

Sometimes there might be just good enough to enable auto logon feature. For example, enable auto boot up and auto logon an interface workstation that housed inside securely protected data center.

Steps to enable auto logon in Windows XP and above

  1. Click on Windows Start button,

  2. Click on the Run menu,

  3. Type regedit.exe in Open field and click OK to call up Windows Registry Editor,

  4. Locate to HKey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\Winlogon,

  5. Set DefaultUserName to an user account (either local or domain user account) that intended to automatically logon.

    Use this guide to create the keys (DefaultUserName, DefaultPassword, DefaultDomainName, AutoAdminLogon) if these keys are not exists,

    1. Right click on Winlogon,

    2. Select the New,

    3. Click on String Value,

    4. Enter the name of the key (DefaultUserName, DefaultPassword, DefaultDomainName, or AutoAdminLogon).

  6. Set DefaultPassword to the password of the user account defined in DefaultUserName,

  7. Set DefaultDomainName to a domain that able to authenticate the user account defined in DefaultUserName. If the local user account instead of domain user account is defined in DefaultUserName,

    • key in the computer name (Right click on My Computer, click Properties, click on Computer Name to look for Full Computer Name that define the computer name.), OR

    • leave it blank if the computer is not current joining to a domain.

  8. Set AutoAdminLogon to 1 to enable auto logon (0 to disable it).
To bypass auto logon (so that able to logon as another user account), hold down the SHIFT key during the boot up or logoff process!

Caution! the password is stored in registry as plain readable text!

Alternative option for Windows XP machine that is not joining a domain
  1. Click on the Windows Start button,

  2. Click on the Run menu,

  3. Type control userpasswords2 in the Open field and click OK,

  4. Select the user account from the list (the account to which intended to automatically logon),

  5. Uncheck check box option Users Must Enter A User Name And Password To Use This Computer and click OK,

  6. Key in the password of the user account selected in previous step,

  7. Click the Advanced tab,

  8. Click to clear the Require Users To Press Ctrl-Alt-Del Before Logging On check box.
Note, Windows XP Home edition don't allow auto logon with built-in Administrator user account!

Friday, September 01, 2006

DOS Auto Complete Path And Filename

Enable MS-DOS faster change path and auto-complete filename are the main attractions to use Windows command line utilities!

The fastest and easiest way to change path in MS-DOS or open MS-DOS prompt at indicated path dynamically is by adding tweaked MS-DOS shortcut to Windows context menu. Coupled with MS-DOS's filename auto-completion, it is easier to use various Windows command line utilities such as compiling program source code with command line compilers of C, .Net, Java, etc.

Enlarge picture...
Enlarge picture...
MS-DOS of Windows XP featured with filename auto-completion. Just press TAB key and the MS-DOS will automatically lists the file's name in the current directory. If initial character(s) is typed then only follow by pressing TAB key, it will only lists out those file's name with matching initial characters. MS-DOS of Windows 2000 able to auto complete filename by pressing TAB key too. Although, this feature is not turned on by default!

Turn on Windows 2000 MS-DOS's filename auto-completion feature:

  1. Click the Windows's Start button,
  2. Click the Run menu,
  3. Type regedit.exe in the Open field to call up Windows Registry Editor,
  4. Go to HKEY_CURRENT_USER\Software\Microsoft\Command Processor
  5. Set the value of CompletionChar to 9.
  6. Done. Open MS-DOS, or better known as Command Prompt, to test the result. Now, the MS-DOS should automatically lists the filename each time pressing the TAB key. If initial character(s) is typed then only follow by pressing TAB key, the MS-DOS should automatically lists only file's name that matches with the initial character(s) given. Note, pressing SHIFT+TAB will tell the MS-DOS listing backward.
Add tweaked MS-DOS shortcut to Windows context menu:

Enlarge picture...
  1. Open My Computer or Windows Explorer,
  2. Click the Tools menu,
  3. Select Folder Options,
  4. Click on File Types tab,
  5. Search for "Folder" file type and highlight it,
  6. Click the Advanced button,
  7. Click the New button,
  8. Type a meaningful name, say Open DOS, in the Action field,
  9. Type C:\WINNT\system32\CMD.EXE /k cd %1 in the Application Used To Perform Action field below the Action field,
  10. Click OK button all the way to complete the procedures.
  11. To test the result, right click on any folder in local or network drives (not network folders which are not mapped as network drive). The Windows context menu should has new command shortcut named as Open Dos (the name given in previous step). Click on the Open DOS, the MS-DOS windows (titled as Command Prompt) opened up with the DOS current directory as the folder being right-clicked!