Loading

Monday, August 31, 2009

OpenEMM is a feature-rich enterprise software for professional e-mail newsletters and e-mail marketing

OpenEMM is a feature-rich enterprise software for professional e-mail newsletters and e-mail marketing. It offers sophisticated bounce management, link tracking, lots of statistics and a script feature to set up transaction mails (data, event and time triggered).

OpenEMM is the first open source application for e-mail marketing. Its code base has been developed since 1999 and is used (as part of the commercial ASP product E-Marketing Manager) by companies like IBM, Siemens and Deutsche Telekom.

OpenEMM offers already more than 95% of the functionality of most commercial products and some features commercial products do not offer right now (i.e. MySQL support).

The main difference is, that OpenEMM is an easy to set up single server solution, while its big brother E-Marketing Manager operates on several distributed servers as software on demand (ASP).

To provide you with free service & support several selfservice categories are operated on this website such as a FAQ database and support forums. The available content is continuously enhanced by feedback from the OpenEMM user community!

http://www.openemm.org/home.html

Body Parts ASCII Art

Pretty cool ASCII art of various body parts, people and gestures.

http://www.geocities.com/soho/7373/bodypart.htm

Keywords:
text pictures body parts
ascii body art

Synergy - desktop sharing for Windows, Linux and Mac OS

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems without special hardware. It's intended for users with multiple computers on their desk since each system uses its own display.

sourceforge.net/projects/synergy2/

Command line shortcut to Windows Components Wizard

Quick and easy way to launch the Windows Components Wizard. You could either run the following command from the Start / Run line or create a shortcut.

%windir%\system32\sysocmgr.exe /i:%windir%\inf\sysoc.inf

This will launch the Windows Components Wizard so you don't have to go the traditional route through Control Panel / Add/Remove Programs.

Windows 7 Command Line Utility for Timezone Management - tzutil.exe

"tzutil.exe" is a command line utility introduced in Windows Vista (also in Windows 7 and Windows 2008) which can be used to change Time Zone or to view the current time zone information. To use this command (from a command prompt as administrator):
tzutil /g - To view current time zone
tzutil /l - To get a list of all available time zones
tzutil /s <time_zone_ID> - To change time zone
time_zone_ID is the new time zone which you want to set. For example, if you want to set the time zone to Eastern, Central, Mountain or Pacific Daylight Time, you would use any of the following:
tzutil /s "Eastern Daylight Time"
tzutil /s "Central Daylight Time"
tzutil /s "Mountain Daylight Time"
tzutil /s "Pacific Daylight Time"
Windows change timezone command.

Set the Time Zone from the command line on Windows computers

To set the Time Zone from the command line, use:

RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z

where is the data value of the Display Value Name, or the Std Value Name ,at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\Time Zones\.

You can also use:

Control.exe %SystemRoot%\system32\TIMEDATE.CPL,,/Z .

Example:
RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z US Eastern Time

NOTE: You do NOT encapsulate the time zone string in quote (") marks.


See also

Saturday, August 29, 2009

Installing NCFTP Client on Linux

NcFTP offers many ease-of-use and performance enhancements over the stock ftp client, and runs on a wide variety of UNIX platforms as well as operating systems such Microsoft Windows and Apple Mac OS X.

How To Install

  1. wget ftp://ftp.ncftp.com/ncftp/ncftp-3.2.2-src.tar.gz
  2. tar -zxvf ncftp-3.2.2-src.tar.gz
  3. cd ncftp-3.2.2
  4. ./configure
  5. make
  6. make install
  7. make clean

Tuesday, August 25, 2009

Command Line SMTP Mailer for Batch Jobs

Bmail is a free but lean command line SMTP mail sender. Don't get fooled into playing $$$ for huge executables. Bmail allows the user to automate the sending of email messages containing log files, data downloads or error messages on Win32 based computers. Together with the freeware utility mpack, you can also send MIME encoded attachments.

Download and more information here.

Windows Command Line Find and replace - Made easy with FART.exe

Here is a great little application that does a find and replace on a particular file, file type or file contents, then replaces it with a string of your choice. It can look in sub directories as well.
The small app is called FART, yes that’s right FART - Find And Replace Text!

Usage: FART [options] [--] [,...] [find_string] [replace_string]
Options
  • -h, –help Show this help message (ignores other options)
  • -q, –quiet Suppress output to stdio / stderr
  • -V, –verbose Show more information
  • -r, –recursive Process sub-folders recursively
  • -c, –count Only show filenames, match counts and totals
  • -i, –ignore-case Case insensitive text comparison
  • -v, –invert Print lines NOT containing the find string
  • -n, –line-number Print line number before each line (1-based)
  • -w, –word Match whole word (uses C syntax, like grep)
  • -f, –filename Find (and replace) filename instead of contents
  • -B, –binary Also search (and replace) in binary files (CAUTION)
  • -C, –c-style Allow C-style extended characters (\xFF\t\n\r\\ etc.)
  • –cvs Skip cvs dirs; execute “cvs edit” before changing files
  • –svn Skip svn dirs
  • –remove Remove all occurences of the find_string
  • -a, –adapt Adapt the case of replace_string to found string
  • -b, –backup Make a backup of each changed file
  • -p, –preview Do not change the files but print the changes
Example 1 (replace text, preview only)
fart -c -r -i -p *.txt original_text new_text
This will look for all .txt files in a sub directory, locate the original_text string within the .txt file and change it to new_text. The -p switch means it won't actually change anything because this is a preview, showing you how many strings it found within each .txt file.

Example 2 (replace text)
fart -c -r -i *.txt original_text new_text
Same as above except it will do the actual replacement.

Example 3 (remove text)
fart -r -i --remove *.txt "remove this text"
Rather than replacing one term for another this will remove the specified term.

NOTE: Use quotes around text if it contains spaces, tabs, etc.

Download FART from SourceForge.

Keywords:

windows fart.exe
fart find and replace
notepad find/replace text command line
fart "command line" download
fart.exe find and replace
find and replace fart
replace file command line windows
"find and replace" fart examples
detailed manual fart find replace
find and replace command line executable

Monday, August 24, 2009

Ubuntu relay email server through ISPs SMTP

Easy way to setup fast, simple and reliable email relay server which will work with ISPs smtp server.

1. Install EXIM4 server: apt-get install exim4 exim4-config

2. run : dpkg-reconfigure exim4-config; choose following config:

a: mail sent by smarthost; no local mail

b: you domain name (example.com)

c: loopback address

d: nothing

e: domain name (example.com)

f: ISP's host name - smtp.comcast.net

g: No

h: Yes

3. Test, using php, perl or install mail utils: apt-get install mailutils :

a. type: mail your@email.com

b. cc:

c: subject

d: body

e type single period (.) to send

How to Install Exchange 2007 SP1 Prerequisites on Windows Server 2008 or Windows Vista

Launch a command prompt window as Administrator and run the following in order:

ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console

ServerManagerCmd -i PowerShell

ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Digest-Auth
ServerManagerCmd -i Web-Windows-Auth
ServerManagerCmd -i Web-Dyn-Compression

ServerManagerCmd -i RPC-over-HTTP-proxy

Sunday, August 23, 2009

How to Insert an Image Inline in Gmail

To add an inline image to an email you are composing in Gmail:

  • Make sure rich text editing is turned on in the Gmail message you are composing and Insert images is enabled.
  • If you see a Rich formatting » link above your message's text editor, click it.
  • See below for turning on image insertion.
  • Position the text cursor where you want the image to appear.
  • Click the Insert Image button in the message's formatting toolbar.

To upload an image from your computer:

  • Make sure My Computer is selected.
  • Click Choose File and open the desired graphic.
  • You can click Choose File again to add another image while others are already uploading in the background.
  • Make sure the desired image is highlighted.

To use an image located on the web:

  • Make sure Web address (URL) is selected.
  • Enter the image's URL under Image URL.
  • Click Add Image.

Images you have uploaded from your computer remain available in the Insert Image dialog while you compose the message (but not for other emails).

After insertion, you can resize and move images easily.
Enable Image Insertion in Gmail

  • Follow the Settings link in Gmail.
  • Go to the Labs tab.
  • Make sure Enable is selected for Inserting images.
  • Click Save Changes.

Insert an Image Inline in Gmail Without Insert images Enabled
To insert an image found on the web fast in any Gmail message:

  • Locate the image on the web site or open it directly in your browser.
  • If the image appears on a page together with other items:
  • Click on the image with the right mouse button.
  • Select View Image from the menu.
  • Hit Ctrl-A (Windows, Linux) or Command-A to highlight the image.
  • Hit Ctrl-C (Windows, Linux) or Command-C.
  • Make sure rich text editing is turned on in the Gmail message you are composing.
  • If you can see a Rich formatting » link above the editing area, click it.
  • Position the cursor in the Gmail message where you want the image to appear.
  • Hit Ctrl-V (Windows, Linux) or Command-V.
  • If you use an image uploaded to a free image hosting service:
  • Click on the image.
  • Now click the Link button in the rich-text formatting toolbar.
  • Copy and paste the image's page address at the free image hosting service under To what URL should this link go?. If you uploaded the image to ImageShack, for example, you could link to http://img.imageshack.us/my.php?image=example.jpg.
  • Click OK.

Continue composing the message.
If inserting an inline image does not work in your browser, try in Mozilla Firefox.

Submit Your Blog to Google, Yahoo and Other Search Engines

Submit your blog url to Google at: Add your URL to Google.

A better idea is to add a Google sitemap to your blog. Go to Adding Google sitemap to your blog to learn how.

You may also submit your blog to Google Base and include a link back to your blog.

You may also submit your url to Yahoo! search for free at http://submit.search.yahoo.com/free/request

For submission to MSN, go to MSN url submission.

Generally it is not necessary to submit your url to search engines nowadays as eventually the search engine will crawl your blog. There is no harm in submitting though. A faster way to do it is to get a link from websites that are already indexed by the search engines as they will automatically follow the links to crawl sites that are linked there. If you don't know anybody who can link you, you can submit your website to blog directories. An easy one to submit to will be My Blog Directory (it is already indexed). Just go to the bottom of the directory and click "Add your blog". (You may want to read more about how My Blog Directory may help you get some extra traffic to your site. Go to "How to make a blog directory for your blog". Other blog directories you can submit to are Blogwise, BlogCatalogue, Bloggernity, BlogFlux, GlobeOfBlogs. You may also "claim" your blog at Technorati.

Friday, August 21, 2009

Creating Bootable Vista / Windows 7 USB Flash Drive

This will walk through the steps to create a bootable USB flash drive. These instructions assume that you are running Windows Vista or Windows 7.

Required:
  • USB Flash Drive
  • Microsoft OS Disk (Vista / Windows 7)
  • A computer running Vista / Windows 7

Step 1: Format the Drive
Warning: This will erase everything on your USB drive.

  1. Open a command prompt as administrator (Right click on Start > All Programs > Accessories > Command Prompt and select “Run as administrator” - you must do this or it may not work, displaying the message: "Could not map drive partitions to the associated volume device objects"
  2. Find the drive number of your USB Drive by typing the following into the Command Prompt window:
    - diskpart
    - list disk
    The number of your USB drive will listed. You’ll need this for the next step. I’ll assume that the USB flash drive is disk 1.
  3. Format the drive by typing the next instructions into the same window. Replace the number “1” with the number of your disk below.
    - select disk 1
    - clean
    - create partition primary
    - select partition 1
    - active
    - format fs=NTFS
    - assign
    - exit
    When that is done you’ll have a formatted USB flash drive ready to be made bootable.

Step 2: Make the Drive Bootable
Next we’ll use the bootsect utility that comes on the Vista or Windows 7 disk to make the flash drive bootable. In the same command window that you were using in Step 1:

  1. Insert your Windows Vista / 7 DVD into your drive.
  2. Change directory to the DVD’s boot directory where bootsect lives:
    - d:
    - cd d:\boot
  3. Use bootsect to set the USB as a bootable NTFS drive prepared for a Vista/7 image. I’m assuming that your USB flash drive has been labeled disk G:\ by the computer:
    - bootsect /nt60 g:

Step 3: Set your BIOS to boot from USB
This is where you’re on your own since every computer is different. Most BIOS’s allow you to hit a key at boot and select a boot option.

Amazon CloudWatch Commands

Amazon CloudWatch Commands

Enable monitoring for an instance:

ec2-monitor-instances instance_id [instance_id...]

Disable monitoring for an instance:

ec2-unmonitor-instances instance_id [instance_id...]

Thursday, August 20, 2009

Free, Encrypted Password Storage

Password Safe allows you to safely and easily create a secured and encrypted user name/password list. With Password Safe all you have to do is create and remember a single "Master Password" of your choice in order to unlock and access your entire user name/password list.

Display List of MS SQL Database Tables

use <DatabaseName>
select * from information_schema.tables

Example:
use myDatabase
select * from information_schema.tables
order by table_name

Shrink (truncate) Microsoft SQL transaction log files

Shrink (truncate / purge) MS SQL transaction log files.
Use <dbname>
Go
alter database <dbname> set recovery simple
go
dbcc shrinkfile (<dbname>_log, 100)
go
checkpoint
go
dbcc shrinkfile (<dbname>_log, 100)
alter database <dbname> set recovery full
go

Example:
Use myDatabase
Go
alter database myDatabase set recovery simple
go
dbcc shrinkfile (myDatabase_log, 100)
go
checkpoint
go
dbcc shrinkfile (myDatabase_log, 100)
alter database myDatabase set recovery full
go

View logical log filename and physical location for MS SQL database files

View logical log filename and physical location (current DB only).
select physical_name from sys.database_files where type = 1

View logical log filename for all DBs:
select a.name, b.name as 'Logical filename', b.filename from sys.sysdatabases a
inner join sys.sysaltfiles b
on a.dbid = b.dbid where fileid = 2

View SQL DB log size and space used

View DB log size and space used.
use
dbcc sqlperf(logspace)

Example:
use myDatabase
dbcc sqlperf(logspace)


MSSQL

Wednesday, August 19, 2009

AWS Elastic Load Balancing

Elastic Load Balancing provides round robin web call distribution across a set of identical web instances. In addition to ease of administration it keeps an eye on the health of instances in the pool and auto routes traffic around any problem instances that show up.

Here is the summary from Amazon.

Elastic Load Balancing – Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve even greater fault tolerance in your applications, seamlessly providing the amount of load balancing capacity needed in response to incoming application traffic. Elastic Load Balancing detects unhealthy instances within a pool and automatically reroutes traffic to healthy instances until the unhealthy instances have been restored. You can enable Elastic Load Balancing within a single Availability Zone or across multiple zones for even more consistent application performance. Amazon CloudWatch can be used to capture a specific Elastic Load Balancer’s operational metrics, such as request count and request latency, at no additional cost beyond Elastic Load Balancing fees.

Fees: $0.025 per hour for each Elastic Load Balancer, plus $0.008 per GB of data transferred through an Elastic Load Balancer.

Elastic Load Balancing Commands

Command Name -----> Description
  • elb-configure-healthcheck -----> Configure the parameters for checking the health of instances registered with a LoadBalancer
  • elb-create-lb -----> Create a new LoadBalancer
  • elb-delete-lb -----> Deletes an existing LoadBalancer
  • elb-deregister-instances-from-lb -----> Deregisters Instances from a LoadBalancer
  • elb-describe-instance-health -----> Describes the state of Instances
  • elb-describe-lbs -----> Describes the state and properties of LoadBalancers
  • elb-disable-zones-for-lb -----> Remove Availability Zones from an LoadBalancer
  • elb-enable-zones-for-lb -----> Add Availability Zones to existing LoadBalancer
  • elb-register-instances-with-lb -----> Registers Instances to a LoadBalancer

Use --help in conjunction with any of the preceding commands for more information and usage examples.

Monday, August 17, 2009

How much is your domain name worth?

Websiteoutlook is the perfect place to evaluate any website. When choosing to buy or sell a website having the proper information about your investment can be crucial to your success. Websiteoutlook is dedicated to finding all pertinent information that may pertain to your personal interest. And it's FREE! We hope that you find Websiteoutlook helpful and that you will return when you need us again. The information offered by Websiteoutlook is not guaranteed to be 100% Accurate and is offered as reference only. Further research and conformation of claims are advised before any substantial investment.

Rss to Blogger blog post

Here is a quick and easy way to take an RSS feed from a friend or a news site and post it on your blogger.com blog.

1) Enter the RSS feed URL in http://www.feedmyinbox.com

2) Enter your email to subsribe to the feed.

3) Setup your blog to update blog via Email.

Go to Settings ---> Email & Mobile --> Email Posting Address (Also known as Mail2Blogger).

4) Forward the mails from feedmyinbox.com to this email.

5) You are done.

Note: You may want to save the blog post as draft when updating via email.

Microsoft Web Platform Installer 2.0

The Microsoft Web Platform Installer 2.0 (Web PI) is a free tool that makes it simple to download, install and keep up-to-date with the latest components of the Microsoft Web Platform, including Internet Information Services (IIS), SQL Server Express, .NET Framework and Visual Web Developer. In addition, install popular open source ASP.NET and PHP web apps with the Web PI.

Web PI 2.0 Includes
  • Popular Web Apps
    Install free popular ASP.NET and PHP web apps such as DotNetNuke and WordPress.
  • .NET Framework
    Install the latest version of the .NET Framework. This includes everything you need to work with ASP.NET.
  • IIS and Extensions
    Install the latest version of IIS, including latest IIS Web extensions like IIS Media Services.
  • SQL Server
    Install the latest version of SQL Server 2008 Express. This includes both the database engine and tools.
  • Visual Web Developer
    Install the latest version of Visual Web Developer Express, Our full featured free web development tool.
  • Extra and Goodies
    In addition to everything above, the Web PI also includes the latest community version of PHP for Windows.

Download:
http://microsoft.com/web/channel/products/WebPlatformInstaller.aspx.

Schedule Windows reboot (restart) from command line with schtasks

Schedule one-time reboot:
schtasks /create /tn "Reboot" /tr "shutdown /r /t 1" /sc once /st 01:00:00 /sd 08/18/2009 /ru "System"
Create scheduled task to run twice daily:
schtasks /create /tn "TTF" /tr "C:\Temp\T\ttf.bat" /sc daily /st 06:00:00 /sd 08/25/2009 /ri 720 /du 720 /ru "System"
Create scheduled task to run every weekday, M-F:
schtasks /create /tn "Reboot" /tr "shutdown /r /t 1" /sc WEEKLY /d "MON, TUE, WED, THU, FRI" /st 01:00:00 /sd 08/18/2009 /ru "System"
To update an existing scheduled task run the same command as above with any desired modifications. You will be prompted with, "WARNING: The task name "Reboot" already exists. Do you want to replace it (Y/N)?"

Upon successful creation the OS will report, "SUCCESS: The scheduled task "Reboot" has successfully been created."

You can also update an existing scheduled task from the Windows command line:
schtasks /change /tn "Reboot" /st 04:00:00 /sd 12/11/2009
Schtasks supports the following options
SCHTASKS /Change [/S system [/U username [/P [password]]]] /TN taskname
     { [/RU runasuser] [/RP runaspassword] [/TR taskrun] [/ST starttime]
       [/RI interval] [ {/ET endtime | /DU duration} [/K] ]
       [/SD startdate] [/ED enddate] [/ENABLE | /DISABLE] [/IT] [/Z] }

Description:
    Changes the program to run, or user account and password used
    by a scheduled task.

Parameter List:
    /S       system      Specifies the remote system to connect to.

    /U       username    Specifies the user context under which schtasks.exe
                         should execute.

    /P       [password]  Specifies the password for the given user context.
                         Prompts for input if omitted.

    /TN      taskname    Specifies which scheduled task to change.

    /RU      username    Changes the user name (user context) under which the
                         scheduled task has to run. For the system account,
                         valid values are "", "NT AUTHORITY\SYSTEM" or "SYSTEM".
                         For v2 tasks, "NT AUTHORITY\LOCALSERVICE" and
                         "NT AUTHORITY\NETWORKSERVICE" are also available as well
                         as the well known SIDs for all three.
    /RP      password    Specifies a new password for the existing user
                         context or the password for a new user account.
                         This password is ignored for the system account.

    /TR      taskrun     Specifies the new program that the
                         scheduled task will run.

    /ST      starttime   Specifies the start time to run the task. The time
                         format is HH:mm (24 hour time) for example, 14:30
                         for 2:30 PM.

    /RI      interval    Specifies the repetition interval in
                         minutes. Valid range: 1 - 599940 minutes.

    /ET      endtime     Specifies the end time to run the task. The time
                         format is HH:mm (24 hour time) for example, 14:50
                         for 2:50 PM.

    /DU      duration    Specifies the duration to run the task. The time
                         format is HH:mm. This is not applicable with /ET.

    /K                   Terminates the task at the endtime or duration time.

    /SD      startdate   Specifies the first date on which the task runs.
                         The format is mm/dd/yyyy.

    /ED      enddate     Specifies the last date when the task should run.
                         The format is mm/dd/yyyy.

    /IT                  Enables the task to run interactively only if the
                         /RU user is currently logged on at the time the job
                         runs. This task runs only if the user is logged in.

    /RL      level       Sets the Run Level for the job. Valid values are
                         LIMITED and HIGHEST. The default is to not change it.

    /ENABLE              Enables the scheduled task.

    /DISABLE             Disables the scheduled task.

    /Z                   Marks the task for deletion after its final run.

    /DELAY   delaytime   Specifies the wait time to delay the running of the
                         task after the trigger is fired.  The time format is
                         mmmm:ss.  This option is only valid for schedule types
                         ONSTART, ONLOGON, ONEVENT.

    /?                   Displays this help message.

Schtasks Examples:
    SCHTASKS /Change /RP password /TN "Backup and Restore"
    SCHTASKS /Change /TR restore.exe /TN "Start Restore"
    SCHTASKS /Change /S system /U user /P password /RU newuser /TN "Start Backup" /IT


Regular expressions guide: Go from beginner to intermediate

This is a great post on using XEmacs to do regular expressions.

Regular expressions guide: Go from beginner to intermediate

Adobe Acrobat alternatives: Find the best PDF software for you

Working with PDF files is inevitable. Most documents are downloaded in PDF format. You need to get used to working with PDF files and software that lets you do what you want to do with a minimum of fuss.

Adobe Acrobat looks wonderful, and in a perfect world where all software was free, I would recommend using it. However, Acrobat Pro Extended costs around $700. Luckily, there are a number of third party applications that do a lot of the things that Acrobat does. I have created this guide to help you find the best software (or combination of software) to suit your needs (hopefully for free).

The benchmark: AcrobatAdobe Acrobat now comes in three flavors: Standard, Pro, and Pro Extended. Each version introduces more features and is more expensive. Acrobat Pro Extended is the most powerful, feature rich PDF creation program in the world. However, ever since Acrobat 7, I feel that Adobe has introduced many features that have turned Acrobat into a bloated piece of software. I just want a program that makes beautiful PDFs, allows me to comment, markup, and organise my collection. Acrobat is hopeless when it comes to organising your PDF collection. You are better off using iTunes for PDF organisation! Bloated, overpriced, let's find an alternative.

Acrobat alternatives

  • Nitro PDF Professional - An Acrobat clone that tries to do everything that Acrobat does. At $US99, this is a good value alternative to Acrobat Pro for those who are serious about PDF creation and editing. Nitro PDF allows you to create, edit, comment, and annotate PDF files. You can also convert PDF files to other formats such as .doc, .rtf, .txt and so on. Nitro PDF is aimed at Microsoft Office users, desktop publishers or document management professionals. If you are considering buying it, here is a detailed review.
  • Foxit PDF Editor 2 - Lacks some of the features of the Acrobat alternatives mentioned in this article. It treats everything as images, so resizing a text box will distort the text. At $US99, you would be better off purchasing the superior Nitro PDF.
  • PDF Xchange Pro - An Acrobat clone that tries to do everything. You can edit, crop, markup, create PDFs. At $US70, it's cheaper than Nitro PDF.PDF Converter 5 - Another Acrobat clone. Create PDFs, combine multiple files into a PDF, convert PDFs into other formats, annotate PDFs. Costs $US99.
  • PDF Fill PDF Editor 6 - Budget Acrobat alternative. $US20. Not sure how good it is. PDF creation looks questionable. Interface looks poor.PDF ToolkitsPDF Tools - Manipulate the structure of PDF files. Merge, remove, rotate, crop pages. Free download.
  • PDF Transformer - A utility that creates OCR PDFs and converts PDF files back into Microsoft Office formats such as Word .doc and Excel .xls.Free PDF printers
  • PDF Creator - Open source. Create PDF from multiple files. Extensive options for customising quality of PDF. Highly recommended.
  • Primo PDF - Create PDFs from multiple files.Embed fonts. Easy to use interface. This is my favourite free PDF printer.
  • Cute PDF - Free printer driver. Requires GhostScript to run.
  • doPDF - Free printer driver. Does not require GhostScript.

Free PDF viewers

  • Adobe Reader - A free download from Adobe's website. Very popular software that has become bloated in recent versions. The installer for Reader 9.0 is 33.5MB! There are faster and better alternatives.
  • Foxit PDF Reader - A popular Adobe Reader alternative. Loads very quickly. The installer is under 3MB! Better than Adobe viewer for viewing PDF files. Commenting features are limited in the free version.
  • PDF Xchange Viewer - It is a fast PDF viewer that allows the user to markup, comment, highlight and annotate PDF files, which in my opinion makes it better than Foxit Reader.

Set up your laptop for work: Turn off the crap

When it comes to setting up your work laptop, I suggest that you should only care about speed and efficiency. This means that your computer should be (a) booting up quickly, and (b) running smoothly (without crashes).

The key to a quick startup is minimising the number of programs that run automatically when you bootup Windows. Click the Start button, then Run, and type msconfig. Click on the Startup tab and deselect all of the programs that you do not want to run automatically. For more detailed advice, I refer you to the excellent Make XP Boot Faster from Wikihow.

In order to keep your computer running smoothly you should turn off all of the useless services that run by default in Windows XP. I recommend that you read A Guide To Turning Off Useless XP Services by JasonN and make the necessary changes. If in the future MARCS students begin using Windows Vista *shudder* then I recommend you find a similar guide for turning off all of the useless crap in Vista.

Windows Command Line Tricks

Here are a few Windows command line tricks that might make your life easier.

Save A List of Files to a Text File by Extension

dir *.ext /s /b > files.txt

This command line will create a file called files.txt. When you open this file, there will be a complete list of all the files in that directory and all subdirectories with the .ext extension. You can then open up this text file in any text editor and work this the information.By changing the ext part, you can select different files. For example, if you wanted to list all of the PDF documents, you would type:

dir *.pdf /s /b > files.txt


Get Your IP Address Information

ipconfig /all

This will retrieve a pile of information about your network connection and IP information. From this command, you can get:

* Host Name
* Primary DNS Suffix
* Node Type
* IP Routing Enabled
* WINS Proxy Enabled
* DNS Suffix Search List
* Connection-specific DNS Suffix
* Network Adapter Description
* Physical (MAC) Address
* DHCP Enabled
* IP Address
* Subnet Mask
* Default Gateway
* DNS Servers


Get Installed Driver Information

driverquery

It can be very useful when troubleshooting to know what drivers are installed on a system. This command will give you a complete listing of the drivers and when they were installed.


Find Files Opened By Network Users

openfiles /query

If you are running a system and you want to know who has files open on your computer, this command will provide you a list of those users and the files that they have open.

Note: If you get an error saying The system global flag ‘maintain objects list’ needs to be enabled to see local opened files, you can fix this issue by typing openfiles /local on. You will have to reboot the system but it will resolve the issue.


Monitor Port Activity

netstat -a 30

This will show you all of the TCP/IP ports that are being used on your system and what they are connecting to (or being connected from). It will continue to monitor these ports and refresh the information every 30 seconds. You can change the refresh rate by changing the number at the end of the command.


Recover Information From A Corrupt File

recover filename.ext

If you have a disk with damaged sectors, you can attempt to recover as much information as possible from the damaged file. Data that is not damaged can be retrieved but data in damaged sectors will be lost.


Defragment Remote Computer

rexec remotePC defrag C: /F

This command used the rexec command to force a defragment of the C: drive on the computer named remotePC. You can use whatever you want to for the command (I just used defrag C: /F as an example). This is very useful for remote maintenance.


Retrieve Detailed System Information

systeminfo

With this command, you can retrieve the following information:

* Host Name
* OS Name
* OS Version
* OS Manufacturer
* OS Configuration
* OS Build Type
* Registered Owner
* Registered Organization
* Product ID
* Original Install Date
* System Up Time
* System Manufacturer
* System Model
* System type
* Processor(s)
* BIOS Version
* Windows Directory
* System Directory
* Boot Device
* System Locale
* Input Locale
* Time Zone
* Total Physical Memory
* Available Physical Memory
* Virtual Memory Max Size
* Virtual Memory Available
* Virtual Memory In Use
* Page File Location(s)
* Domain
* Logon Server
* Hotfix(s)
* NetWork Card(s)


Schedule Defrag to Defragment C: Daily

schtasks /create /tn "Defrag C" /tr "defrag c: /f" /sc daily /st 02:00:00 /ru "System"

This will set your computer to automatically perform a complete defrag of the C: drive each day at 11:00:00 PM (23:00:00). It does this by creating a scheduled task called Defrag C. It will run this command under the computer’s system account.


Map A Drive Letter to a Folder

subst W: C:\windows

Sometimes, your directory structure can get pretty deep and complicated. You can simplify this a bit by mapping a drive letter to commonly used folders. In the example that I have given, this will create a drive letter W: and map it to the C:\windows directory. Then, whenever you go into My Computer, you will see a W: drive and when you browse to it, it will automatically take you to the contents of the C:\windows folder.

You can do this with any unused drive letter and any folder that exists on your system.


List All Tasks Running On The Computer

tasklist

It’s always good to know what is running on your system. This is the command line version of the processes tab in Taks Manager.


Kill A Program

taskkill /im programname.exe /f

If, when using the tasklist command, you discover that there is something running you just want killed. This is the way to do it! Just note the program name and use it in place of programname.exe.


Reboot a Remote Computer

shutdown -r -f -m \\remotePC -c "System will be rebooted in 30 seconds"

Sometimes, you just need to reboot a system. This will do it remotely and give the user a 30 second warning.


Schedule computer reboot

schtasks /create /tn "Reboot" /tr "shutdown /r /t 1" /sc once /st 01:00:00 /sd 08/18/2009 /ru "System"


cmd /c - Carries out the command specified by string and then terminates
&& - concatenates commands together

This way you can create a shortcut for short scripts without creating batch files.
e.g. a shortcut for stopping and starting the print spooler.

%windir%\System32\cmd.exe /c "net.exe stop Spooler && net start Spooler"


Sleep
No sleep command in Windows 2000/XP (AFAIK) unless you have the Resource Kit, and then you have to move extra files around with your scripts.
Simply use the ping command to wait predefined times. In this example it’s 10 seconds.

ping -n 10 127.0.0.1 > NUL 2>&1


Find
Windows answer to grep. Not as powerful but still useful.

e.g. In conjunction with systeminfo above to find out the Virtual Memory on the PC.

systeminfo find "Virtual Memory"

Windows (XP, Vista, Windows 7, 2003, 2008) Commands

Here is a great list Windows XP/2000 commands that will make any Linux user feel at home at the command prompt. A lot of these commands are intended for administrating a network, but they are great for savvy home users as well.

  • at - Windows Scheduling utility
  • bootcfg - This utility allows you to set up your boot options, such as your default OS and other loading options
  • cacls - Changes the ACLs (security Settings) of files and folders. Very similar to chmod in Linux.
  • comp - This utility is very similar to diff in Linux. Use the /? switch to get examples of command usage.
  • defrag - Yes, XP comes with a command line disk defrag utility. Here's an example of how to create a scheduled task to defrag every day:

    schtasks /create /tn "Defrag C" /tr "defrag c: /f" /sc daily /st 04:30:00 /ru "System"
  • diskpart - Use this command to manage your disk partitions. This is the text version for the GUI Disk Manager.
  • driverquery - Produces a list of drivers, their properties, and their versions. Great for computer documentation.
  • eudcedit (unpublished) - Private Character editor. Yes with this program built into Windows XP you can create your own font!
  • findstr - Find String - similar to Linux's Grep.
  • fsutil (unpublished) - This is a utility with a lot of capability. Come back soon for great examples.
  • getmac - This command gets the Media Access Control (MAC) address of your network cards.
  • gpresult - This generates a summary of the user settings and computer group policy settings.
  • gpupdate - Use this utility to manually apply computer and user policy from your windows 2000 (or newer) Active Directory domain.
  • ipconfig - This handy tool displays IP settings of the current computer and much more.
  • MMC - Microsoft Management Console. This is the master tool for Windows, it is the main interface in which all other tools use starting primarily in Windows 2000 and newer systems.
  • more- Utility used to display text output one screen at a time. Example:

    more c:\windows\win.ini
  • msconfig - The ultimate tool to change the services and utilities that start when your Windows machine boots up. You can also copy the executable from XP and use it in Win2k.
  • msinfo32 - An awesome diagnostic tool. With it you can get a list of running processes, including the residing path of the executable (great for manually removing malware) and get detailed information about hardware and system diagnostics.
  • narrator - Turns on the system narrator (can also be found in accessibility options in control panel). Will will allow your computer to dictate text to you.
  • netsh - A network configuration tool console. At the 'netsh>' prompt, use the '?' to list the available commands and type "exit" to get back to a command prompt.
  • netstat - A local network port tool - try netstat -ano.
  • nslookup - A DNS name resolution tool.
  • openfiles - Allows an administrator to display or disconnect open files in XP professional. Type "openfiles /?" for a list of possible parameters.
  • Pathping - A cross between the ping and traceroute utilities. Who needs Neotrace when you can use this? Type "pathping " and watch it go.
  • recover - This command can recover readable information from a damaged disk and is very easy to use.
  • reg - A console registry tool, great for scripting Registry edits.
  • sc - A command line utility called the Service Controller. A power tool to make service changes via a logon/logoff or startup/shutdown script.
  • schtasks - A newer version of the AT command. This allows an administrator to schedule and manage scheduled tasks on a local and remote machines.
  • secedit - Use this utility to manually apply computer and user policy from your windows 2000 (or newer) domain. Example to update the machine policy: secedit /refreshpolicy machine_policy /enforce
    To view help on this, just type secedit.
    NOTE: In Windows XP SP1 and news, this command is superceded by: gpupdate /force
  • sfc - The system file checker scans important system files and replaces the ones you (or your applications) hacked beyond repair with the real, official Microsoft versions.
  • shutdown - With this tool, You can shut down or restart your own computer, or an administrator can shut down or restart a remote computer.
  • sigverif - With the sigverif tool you can have all driver files analyzed to verify that they are digitally signed. Just type 'sigverif' at the command prompt.
  • systeminfo - Basic system configuration information, such as the system type, the processor type, time zone, virtual memory settings, system uptime, and much more. This program is great for creating an inventory of computers on your network.
  • sysedit - System Configuration File Editor. An old tool that was very handy for the Windows 9X days. msconfig is what you want to use now.
  • tasklist - Tasklist is the command console equivalent to the task manager in windows. It is a must have when fighting malware and viruses. Try the command:

    tasklist /svc to view the memory resources your services take up.
  • taskkill - Taskkill contains the rest of the task manager functionality. It allows you to kill those unneeded or locked up applications.
  • tree - This command will provide a 'family tree' style display of the drive/folder you specify.
  • WMIC - Windows Management Instrumentation Command tool. This allows you to pull an amazing amount of low-level system information from a command line scripting interface.

Of course this list in note exhaustive, I just wanted to focus on tools that are particularly helpful that everyone might use. For the official list, please visit Microsoft Windows XP Pro Command Reference.

Paint.NET: a free image editor - who needs PhotoShop?

For most people PhotoShop is overkill. It's powerful, but complicated. It takes a long time to open. It costs a lot. And most people only use a very small number of Photoshop's features, anyway. Paint.NET is my image editor of choice. It allows you to create, edit and manipulate images. It is a free program, only a 1.5MB download, and it is fantastic. Paint.NET requires the Microsoft .NET framework (which you probably have already installed).



About
Paint.NET is free image and photo editing software for computers that run Windows. It features an intuitive and innovative user interface with support for layers, unlimited undo, special effects, and a wide variety of useful and powerful tools. An active and growing online community provides friendly help, tutorials, and plugins.

Sunday, August 16, 2009

Notepad++ : start using a real text editor

Notepad++ : start using a real text editor
Have you ever used Notepad? It's very simple, which is good. However, it lacks the power and features of more advanced text editors.
Notepad++ is a free and very powerful text editor. Here are some Notepad++ features:
  • Syntax Highlighting and Syntax Folding
  • Print text in color
  • User Defined Syntax Highlighting
  • Auto-completion
  • Edit several documents at the same time
  • Synchronized scrolling between two documents
  • Regular Expression Search/Replace
  • Full Drag 'N' Drop support
  • Zoom in and zoom out
  • Place bookmarks in the text
  • Macro recording and playback
For more details, check out the Notepad++ homepage.

Friday, August 14, 2009

Notepad++: A guide to using regular expressions and extended search mode

The information in this post will benefit anyone looking to understand how to use Notepad++ extended search mode and regular expressions.

Notepad++ is an excellent text editor and replacement to Microsoft's notepad.exe.

Since the release of version 4.9, the Notepad++ Find and Replace commands have been updated. It now has a new Extended search mode that allows you to search for tabs(\t), newline(\r\n), and a character by its value (\o, \x, \b, \d, \t, \n, \r and \\). Unfortunately, the Notepad++ documentation is lacking in its description of these new capabilities. These slides by Anjesh Tuladhar on regular expressions in Notepad++ is very useful.

One of the major disadvantages of using regular expressions in Notepad++ was that it did not handle the newline character well — especially in Replace. Now, we can use Extended search mode to make up for this shortcoming. Together, Extended and Regular Expression search modes give you the power to search, replace and reorder your text in ways that were not previously possible in Notepad++.

In the Find (Ctrl+F) and Replace (Ctrl+H) dialogs, the three available search modes are specified in the bottom left corner. Select your desired search mode.

Example 1: For this example let's remove all lines that begin with a certain character, for example the exclamation point.

Open the Search & Replace dialog box (Ctrl+H) and select the Regular Expression search mode.
  • Find what: [!].*
  • Replace with: (leave this blank)
Press Replace All. All the error messages are gone.

Explanation:
  • [!] finds the exclamation character.
  • .* selects the rest of the line.
Example 2: Remove all blank lines.

Switch to Extended search mode in the Replace dialog.
  • Find what: \r\n\r\n
  • Replace with: (leave this blank)
Press Replace All and all the blank lines will be removed.

Explanation:
  • \r\n is a newline character (in Windows).
  • \r\n\r\n finds two newline characters (what you get from pressing Enter twice).
Example 3: Put each Item on a new line.

Switch to Regular Expression search mode.
  • Find what: (\+.*)(Item)
  • Replace with: \1\r\n\2
Press Replace All. "Item"s have been placed on new lines.

Explanation:
  • \+ finds the + character.
  • .* selects the text after the + up until the word "Item".
  • Item finds the string "Item".
  • () allow us to access whatever is inside the parentheses. The first set of parentheses may be accessed with \1 and the second set with \2.
  • \1\r\n\2 will take + and whatever text comes after it, will then add a new line, and place the string "Item" on the new line.
Example 4: Delete duplicate or redundant information.

Remove all newline characters using Extended search mode, replacing them with a unique string of text that we will use as a signpost for redundant data later in RegEx. Choose a string of text that does not appear in your file — I have chosen RegEx_Example.

Switch to Extended search mode in the Replace dialog.
  • Find what: \r\n
  • Replace with: RegEx_Example
Press Replace All. All the newline characters are gone. Your entire file is now one very long line of text.

Using our RegEx_Example signpost keyword, let's separate the different values.

Stay in Extended search mode.
  • Find what: ,
  • Replace with: ,RegEx_Example
Press Replace All. Now, RegEx_Example appears after every comma.

Example 5: Put the remaining Items on new lines.

Switch to Regular Expression search mode.
  • Find what: RegEx_Example(Item)
  • Replace with: \r\n\1
Press Replace All. All "Item"s should now be on new lines.

Example 6: Get rid of duplicate entries.
  • Find what: RegEx_Example ([^A-Za-z]*)RegEx_Example [^A-Za-z]*\,RegEx_Example
  • Replace with: \1,
Press Replace All and all duplicate entries will be removed.

Explanation:
  • A-Z finds all letters of the alphabet in upper case.
  • a-z finds all lower case letters.
  • A-Za-z will find all alphabetic characters.
  • [^...] is the inverse. So, if we put these three together: [^A-Za-z] finds any character except an alphabetic character.
  • Notice that only one of the [^A-Za-z] is in parentheses (). This is recalled by \1 in the Replace with field. The characters outside of the parentheses are discarded.
Example 7: Let's get rid of all those RegEx_Examples.
  • Find what: RegEx_Example
  • Replace with: (leave blank)
Press Replace All. The RegEx_Examples are gone.

Example 8: Separate each entry's data from the next.
  • Find what: (\**\*)
  • Replace with: \r\n\r\n\1\r\n\r\n
Press Replace All. The final product is a beautiful, comma-delimited file that is ready to be imported into Excel for further analysis.

Notepad++ rocks!

Keywords:
notepad++ extended search
\d regular notepad++
notepad replace all leaves blank
notepad++ extended search mode
notepad++ regular expression search replace
creating a newline using notepad++
does not match regular expression notepad++
find and replace with regular expressions notepad++ blank line
notepad++ documentation

Windows Registry Hives - HKCR, HKCU, HKLM, HKU, HKCC, and HKPD

Information stored in the Registry is divided into several predefined sections called "hives". A registry hive is a top level registry key predefined by the Windows system to store registry keys for specific objectives.

On my Windows XP system, the Registry has 6 registry hives:
  • HKCR - Abbreviated from the registry key name HKEY_CLASSES_ROOT. HKCR stores information about registered applications, such as Associations from File Extensions and OLE Object Class IDs tying them to the applications used to handle these items.
  • HKCU - Abbreviated from the registry key name HKEY_CURRENT_USER. HKCU stores settings that are specific to the currently logged-in user. The HKCU key is a link to the subkey of HKEY_USERS that corresponds to the user; the same information is reflected in both locations.
  • HKLM - Abbreviated from the registry key name HKEY_LOCAL_MACHINE. HKLM stores settings that are general to all users on the computer. On my XP system, HKLM contains five subkeys, HARDWARE, SAM, SECURITY, SOFTWARE and SYSTEM.
  • HKU - Abbreviated from the registry key name HKEY_USERS. HKU contains subkeys corresponding to the HKEY_CURRENT_USER keys for each user registered on the machine.
  • HKCC - Abbreviated from the registry key name HKEY_CURRENT_CONFIG. HKCC contains information gathered at runtime; information stored in this key is not permanently stored on the hard disk, but rather regenerated at boot time.
  • HKPD - Abbreviated from the registry key name HKEY_PERFORMANCE_DATA. HKPD provides runtime information into performance data provided by either the operating system kernel itself or other programs that provide performance data. This key is not displayed in the Registry Editor, but it is visible through the registry functions in the Windows API.

What environment variables are available in Windows?

List of the environment variables callable in windows 2000. e.g. Open a cmd prompt and type echo %appdata% which should return the full path to your profile's Application Data directory. If calling from a batch file remember to quote the %variable% e.g.

IF EXIST "%appdata%"\workrave\historystats. (mkdir D:\AllMyFiles\Workrave.) ELSE echo Workrave. missing

Here's the list with correct syntax:











































ALLUSERSPROFILE%ALLUSERSPROFILE%Local returns the location of the All Users Profile.
APPDATA%APPDATA%Local returns the location where applications store data by default.
CD%CD%Local returns the current directory string.
CMDCMDLINE%CMDCMDLINE%Local returns the exact command line used to start the current cmd.exe.
CMDEXTVERSION%CMDEXTVERSION%System returns the version number of the current Command Processor Extensions.
COMPUTERNAME%COMPUTERNAME%System returns the name of the computer.
COMSPEC%COMSPEC%System returns the exact path to the command shell executable.
DATE%DATE%System returns the current date. This variable uses the same format as the date /t command. Cmd.exe generates this variable. For more information about the date command, see the Date command.
ERRORLEVEL%ERRORLEVEL%System returns the error code of the most recently used command. A non-0 value usually indicates an error.
HOMEDRIVE%HOMEDRIVE%System returns which local workstation drive letter is connected to the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
HOMEPATH%HOMEPATH%System returns the full path of the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
HOMESHARE%HOMESHARE%System returns the network path to the user's shared home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
LOGONSERVER%LOGONSERVER%Local returns the name of the domain controller that validated the current logon session.
NUMBER_OF_PROCESSORS%NUMBER_OF_PROCESSORS%System specifies the number of processors installed on the computer.
OS%OS%System returns the OS name. Windows XP and Windows 2000 display the OS as Windows_NT.
PATH%PATH%System specifies the search path for executable files.
PATHEXT%PATHEXT%System returns a list of the file extensions that the OS considers to be executable.
PROCESSOR_ARCHITECTURE%PROCESSOR_ARCHITECTURE%System returns the processor's chip architecture. Values: x86, IA64.
PROCESSOR_IDENTIFIER%PROCESSOR_IDENTIFIER%System returns a description of the processor.
PROCESSOR_LEVEL%PROCESSOR_LEVEL%System returns the model number of the computer's processor.
PROCESSOR_REVISION%PROCESSOR_REVISION%System returns the revision number of the processor.
Program Files%PROGRAMFILES%returns the location of the default install directory for applications.
PROMPT%PROMPT%Local returns the command-prompt settings for the current interpreter. Cmd.exe generates this variable.
RANDOM%RANDOM%System returns a random decimal number between 0 and 32767. Cmd.exe generates this variable.
SYSTEMDRIVE%SYSTEMDRIVE%System returns the drive containing the Windows root directory (i.e., the system root).
SYSTEMROOT%SYSTEMROOT%System returns the location of the Windows root directory.
TEMP%TEMP%System and User return the default temporary directories for applications that are available to users who are currently logged on. Some applications require TEMP and others require TMP.
TMP%TMP%System and User return the default temporary directories for applications that are available to users who are currently logged on. Some applications require TEMP and others require TMP.
TIME%TIME%System returns the current time. This variable uses the same format as the time /t command. Cmd.exe generates this variable. For more information about the time command, see the Time command.
USERDOMAIN%USERDOMAIN%Local returns the name of the domain that contains the user's account.
USERNAME%USERNAME%Local returns the name of the user currently logged on.
USERPROFILE%USERPROFILE%Local returns the location of the profile for the current user.
WINDIR%WINDIR%System returns the location of the OS directory

RegShot - Windows Registry Compare Utility

Regshot is an open-source (GPL) Windows (2000, Windows XP, Windows Vista, Windows 7, Windows 2008) registry compare utility that allows you to quickly take a snapshot of your registry and then compare it with a second one - done after doing system changes or installing a new software product.

Download: http://sourceforge.net/projects/regshot/

Thursday, August 13, 2009

Linux Change MTU Size

How do I change MTU size under Linux?

You need support in both network hardware and card in order to use JumboFrames. If you want to transfer large amounts of data at gigabit speeds, increasing the default MTU size can provide significant performance gains.

Changing the MTU size with ifconfig command

In order to change the MTU size, use /sbin/ifconfig command as follows:
ifconfig ${Interface} mtu ${SIZE} up
ifconfig eth1 mtu 9000 up

Note this will only work if supported by both the network nterface card and the network components such as switch.

Changing the MTU size permanently under CentOS / RHEL / Fedora Linux

Edit /etc/sysconfig/network-scripts/ifcfg-eth0, enter
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Add MTU, settings:
MTU="9000"

Save and close the file. Restart networking:
# service network restart

Note for IPV6 set dedicated MTU as follows:
IPV6_MTU="1280"

Changing the MTU size permanently under Debian / Ubuntu Linux

Edit /etc/network/interfaces, enter:
# vi /etc/network/interfaces

Add mtu as follows for required interface:
mtu 9000

Save and close the file. Restart the networking, enter:
# /etc/init.d/networking restart

Changing the MTU size permanently (other Linux distros)

Edit /etc/rc.local and add the following line:
/sbin/ifconfig eth1 mtu 9000 up

Remove Blank Lines in a Document With Notepad++ With Extended Search Mode

Switch to Extended search mode in the Replace dialog.

Find what: \r\n\r\n

Replace with: (leave this blank)

Press Replace All. All the blank lines are gone.


* \r\n is a newline character (in Windows).

* \r\n\r\n finds two newline characters (what you get from pressing Enter twice).

Tuesday, August 11, 2009

AWS EC2 Windows Passwords, Users, and Authentication

The default password on the Windows Administrator account is set automatically on all instances to a random value by the ec2Config service. You can retrieve the password originally set by using the ec2-get-password command, as shown here:

C:\>ec2-get-password i-<"instanceid"> -k gsg-keypair.txt

Alternatively, you may use the "Get Administrator Password" command in ElasticFox by right-clicking on the instance. The first time you use this feature in ElasticFox you will be asked to set your gsg-keypair. This is the keypair you generated when you first configured your AWS account. The path to the gsg-keypair file is stored in the ec2ui.last.ec2privatekey.file Firefox variable.

Error in ElasticFox: "Invalid EC2 Private Key"

Reference: Windows on Amazon EC2 Security Guide

How to Change User Password at Command Prompt

To change a user's password at the command prompt, log on as an administrator and type:

net user user_name * /domain

When you are prompted to type a password for the user, type the new password, not the existing password. After you type the new password, the system prompts you to retype the password to confirm. The password is now changed.

Alternatively, you can type the following command:

net user user_name new_password

When you do so, the password changes without prompting you again. This command also enables you to change passwords in a batch file.

Non-administrators receive a "System error 5 has occurred. Access is denied" error message when they attempt to change the password.

Reference: MS KB 149427

Command line reference: Database and Operating Systems.

Great resource for Windows and Linux command line utilities as well as SQL, Oracle and Windows PowerShell.

http://ss64.com/index.html

NET.exe - Windows User Management From the Command Line

The NET Command is used to manage network security resources as follows:

View user account password and logon requirements (also displays the machine type - NT Server or NT workstation)
NET ACCOUNTS

View password and logon requirements for the network domain.
NET ACCOUNTS /DOMAIN

Set the number of minutes a user has before being forced to log off when the account expires or valid logon hours expire
NET ACCOUNTS /FORCELOGOFF:minutes /DOMAIN

Prevent forced logoff when user accounts expire
NET ACCOUNTS /FORCELOGOFF:NO /DOMAIN

Set the minimum number of characters for a password.
NET ACCOUNTS /MINPWLEN:C /DOMAIN
The range is 0-14 characters; the default is 6 characters.

Set the maximum number of days that a password is valid.
NET ACCOUNTS /MAXPWAGE:dd /DOMAIN
The range is 1-49710; the default is 90 days.

Set passwords to never expire.
NET ACCOUNTS /MAXPWAGE:UNLIMITED /DOMAIN

Set a minimum number of days that must pass before a user can change a password (default = 0)
NET ACCOUNTS /MINPWAGE:dd /DOMAIN

Require that new passwords be different from 'x' number of previous passwords
NET ACCOUNTS /UNIQUEPW:x /DOMAIN
The range for 'x' is 1-24

Synchoronise the user accounts database (PDC and BDC)
NET ACCOUNTS /SYNC /DOMAIN

View user account details
NET USER [/DOMAIN]

Add a user account.
NET USER username {password | *} /ADD [options] [/DOMAIN]

Modify a user account.
NET USER [username [password | *] [options]] [/DOMAIN]

Delete a username
NET USER username [/DELETE] [/DOMAIN]

Add a Workgroup
NET GROUP groupname /ADD [/COMMENT:"text"] [/DOMAIN]

Edit a workgroup
NET GROUP [groupname [/COMMENT:"text"]] [/DOMAIN]

Delete a group
NET GROUP groupname /DELETE [/DOMAIN]

Add a user to a group
NET GROUP groupname username [...] /ADD [/DOMAIN]

Delete a user from a group
NET GROUP groupname username [...] /DELETE [/DOMAIN]

To View, Add or modify a local workgroup replace GROUP in the commands above with LOCALGROUP.

Examples

Create a group

C:\>NET LOCALGROUP spud /add

Add to guests

C:\>NET LOCALGROUP guests spud /add

Then remove

C:\>NET LOCALGROUP guests spud /delete

C:\>NET LOCALGROUP spud /delete



NET USER options

The NET Command is used to manage network resources as follows:

options are as follows:

/active:{no | yes}
Enable or disable the user account.
The default is yes (login is allowed)
Disabling an account does not immediately log off any user sessions.

/comment:"text"
A descriptive comment (48 characters).

/countrycode:nnn
Use the OS country codes to implement specified language files for help and error messages. 0 = default country code.

/expires:{date | never}
Cause the user account to expire. date can be in mm/dd/yy, dd/mm/yy, or mmm,dd,yy format, depending on the /countrycode. Months can be a number, spelled out, or abbreviated with three letters. Use commas or slashes to separate parts of the date (no spaces).

/fullname:"name"
The user's full name (rather than a username).

/homedir:path
The path for the user's home directory. The path must exist.

/homedirreq:{yes | no}
Is a home directory required?

/passwordchg:{yes | no}
Can users change their own password? The default is yes.

/passwordreq:{yes | no}
Must a user account have a password? The default is yes.

/profilepath:[path]
The path for the user's logon profile.
This pathname will be used to store their registry profile.

/scriptpath:path
Path for the user's logon script. This is relative to %systemroot%\SYSTEM32\REPL\IMPORT\SCRIPTS. (The NETLOGON share) You can't use an absolute path.

/times:{times | all}
The times the user is allowed to use the computer.
The times value is expressed as day[-day][,day[-day]] , time[-time][,time[-time]], limited to 1-hour time increments.
Days can be spelled out or abbreviated (M,T,W,Th,F,Sa,Su).
Hours can be 12- or 24-hour notation. For 12-hour notation, use AM, PM, or A.M., P.M.
The value all means a user can always log on.
A null value (blank) means a user can never log on.
Separate day and time with commas, and units of day and time with semicolons (for example, M,4AM-5PM;T,1PM-3PM).
Do not use spaces when designating /times.

/usercomment:"text"
Add or change the "User comment" for the account. Only Administrators can edit this.

/workstations:{computername[,...] | *}
List as many as eight workstations from which a user can log on to the network.
Separate multiple entries in the list with commas.
If /workstations has no list, or if the list is *, the user can log on from any computer.

Examples

NET USER jsmith p@ssw0rd /ADD /fullname:"Joe Smith" /scriptpath:logon.cmd

NET USER alice_smith /ACTIVE:yes /comment:"RAS User" /DOMAIN

NET USER fred_jones /HOMEDIR:\\Server_05\ /PROFILEPATH:\\Server_05\D$\USERS\fred_jones /DOMAIN

Saturday, August 8, 2009

Linux / UNIX: Restrict Access To A Given Command

How do I restrict access to a given command for instance /opt/apps/start, to authorized users only under Linux / UNIX / BSD operating system?

You need to use traditional Unix groups concept to enhance security including restricted access to a given command.

Step # 1: Create and Maintain a Group For All Authorized Users


Create a group named appsonly:
# groupadd appsonly

Add all authorized users to appsonly:
# usermod -aG {groupName} {userName}
# usermod -aG appsonly tom
# usermod -aG appsonly jerry
# id jerry


Where,
  1. -a : Add the user to the supplemental group(s) i.e. appends the user to the current supplementary group list.
  2. -G : A list of supplementary groups which the user is also a member of.

Step #2: Restrict Access

Now a group of user had been created. Next, use the chgrp command to change the group of /opt/apps/start to appsonly group:
# chgrp {groupName} {/path/to/command}
# chgrp appsonly /opt/apps/start

Disable the file permission for others

Finally, use the chmod command to change file permission as follows:
# chmod 750 /path/to/command
# chmod 750 /opt/apps/start


You can also apply permissions to directory (this will disable ls command access to others) :
# chgrp appsonly /opt/apps
# chmod 0640 /opt/apps

Step # 3: Test It

su to tom, enter:
# su - tom
$ id
$ /opt/apps/start
$ exit


su to vivek (not a member of appsonly group), enter:
# su - vivek
$ id
$ /opt/apps/start


Sample outputs:
bash: /opt/apps/start: Permission denied

A Note About ACL and SELinux

The access control policies which can be enforced by chmod, chgrp, and usermod commands are limited, and configuring SELinux and fille system ACLs (access control list) is a better and recommend option for large deployments.

Setting Westell 9100EM in Bridged mode

Westell 9100 EM OPTION 7 LAN-To-LAN Guide

Friday, August 7, 2009

freeFTPd

freeFTPd is a FTP/FTPS/SFTP server that enables user to access remote files over TCP/IP network such as Internet. Unlike FTP, FTPS and SFTP protocols provide security and strong encryption of data - great for insecure network.

freeSSHD

freeSSHd, like it's name says, is a free implementation of an SSH server. It provides strong encryption and authentication over insecure networks like Internet. Users can open remote console or even access their remote files thanks to buit-in SFTP server.

Setting up a SFTP Server on Windows

This tutorial will help you turn your Windows based system into a SecureFTP server.

Background
Secure Shell (SSH) is a program that lets you log into another computer over a network, to execute commands in a remote machine, and to move files from one machine to another. It provides strong authentication and secure communications over insecure channels. When using ssh, the entire login session, including transmission of password, is encrypted and therefore is very secure.

You may have noticed that many webhosts allow ssh access. This means that you can login to their webserver and execute many UNIX commands (the ones they allow you access to) on your account. Not only can you connect to other computers that provide SSH access, but you can also allow others to connect to your computer using SSH.

To take this one step further, you can also turn your Windows PC into a Secure FTP (SFTP) server. SFTP is a program that uses SSH to transfer files. Unlike standard FTP, it encrypts both commands and data, preventing passwords and sensitive information from being transmitted in clear text over the Internet. It is similar to FTP, but because it uses a different protocol, you must use a FTP client that supports SFTP (more about that later).

Installing SSH on Windows
Most UNIX based systems (Linux and OSX) come with SSH preinstalled, so connecting to a remote host is very easy. However, if you run a Windows system, you need to download some additional software to make the SSH programs available to you. Fortunately a free open-source project called SSHWindows, provides a nice Windows installer that will setup the SSH client and Server on your system.

Your first step will be to download the Binary Installer Release from SSHWindows. Once downloaded, run the installer and be sure to install both the client and server components.

Configure the SSH Server
In this next step, I have summarized the information that is included with the readme.txt that is included with SSHWindows (it can be found in c:\program files\openssh\docs)
Your first configuration step is to set up the passwd file. You will need to set up the passwd file before any logins can take place.

Passwd creation is relatively easy and can be done using two programs that are included with SSHWindows – mkgroup and mkpasswd. Both of these programs are located in the c:\program files\openssh\bin directory.

To begin creating the group and passwd files, open a command prompt window and navigate to the c:\program files\openssh directory.

You must first create a group file. To add all local groups on your computer to the group file, type the command as shown below:

mkgroup -l >> ..\etc\group

You will now need to create a passwd file. Any users in the passwd file will be able to log on with SSH. For this reason, it is recommended that you add users individually with the -u switch. To add a user to the passwd file type the command shown below:

mkpasswd -l -u username >> ..\etc\passwd

NOTE: the username specified above must be an existing windows login account.

Creating Home Directories for you Users
In the passwd file, you will notice that the user’s home directory is set as /home/username, with username being the name of the account. In the default install, the /home directory is set to the default profile directory for all users. This is usually c:\documents and settings.

If you want to change this location you will need to edit the passwd file. The passwd file is in plain text and can be edited in Notepad or any text editor. The last two entries for each user are safe to edit by hand. The second to last entry (/home/username) can be replaced with any other directory to act as that user’s home directory. It’s worth noting that when you run SSH on windows, you are actually running SSH in a scaled down version of cygwin, which is a Unix emulator for Windows. So, if you will be placing the user somewhere outside the default directory for their Windows profile, you will need to use the cygdrive notation.

To access any folder on any drive letter, add /cygdrive/DRIVELETTER/ at the beginning of the folder path. As an example, to access the winnt\system32 directory on the *c:* drive you would use the path:

/cygdrive/c/winnt/system32

Connecting to your SFTP Server
To connect to your new SFTP server, you will need to download an FTP client that supports SFTP. I use Filezilla which is a nice free FTP and SFTP client. You might also try WinSCP which is another free SFTP client.

To test if your server is running, create a new connection in your client and specify SFTP as the server type, 22 as the port, and localhost or 127.0.0.1 as the server name. You will also need to provide the user account and password for any account that you added to your passwd file. Now connect to the server. If all went well, you should see a directory listing where you pointed the home folder to. If not, there are a couple of things to check. Make sure your Windows firewall is set to allow traffic over port 22 and finally double check your passwd file to make sure that the account you added is actually there.

Security
Because SSH allows access to only Windows user accounts, you can restrict access based upon NTFS file permissions. As such, SFTP does not provide for chroot jails (a Unix method for locking a user to his/her home directory). Simply lock down your filesystem for that user, and SFTP will respect that.

Summary
In the end, setting up an SFTP server turned out to be a very effortless task. With a couple of open source programs and a couple of command-line commands, you can up and running in no time at all!

Thursday, August 6, 2009

Detecting listening network ports on Linux

It is importand to check for ports that are open and there are not needed.

For a list of network ports that are open you can use the following commands:
netstat -tulp or
lsof -i -n | egrep ‘COMMAND|LISTEN|UDP’
Or, you are not limited to netstat or lsof but you can always use a port scanner, telnet or nc to list open/close ports.

A quick overview of PuTTY and SSH for AWS Newbies

Linux Access with SSH & PuTTY

This post will (attempt) to explain what SSH and PuTTY are so that as a user you understand the terminology of AWS and so that you can be productive in the environment. This post will not attempt to make you an expert in SSH. For best practices in implementing SSH, I strongly recommend a book dedicated to hardening *nix (Linux, Unix, Solaris, etc).

SSH

In the early days, not that long ago really, of networking, very simple tools were used to work with remote computers: telnet as a console, ftp for file copying, rsh for remote command execution and others. These were easy to configure and use tools. They were client server in that a software component needed to run on both the local machine (client) and the remote machine (server).

While easy to use, they were very insecure. They made no pretense at verifying that the calling host really was the calling host. Everything was username/password based and both the username and the password were passed around the network in cleartext. If you intercepted the little data packages that were being routed around the network (with a sniffer for example), you would be able to extract the login credentials. Even if you encrypted all of your data, your credentials were still in the clear.

SSH is an attempt (quite successful) to fix those insecurities without making things anymore complex than they need to be. SSH stands for Secure SHell. However, SSH is not really a command shell, it is rather a protocol that encrypts communications. That means that programs that use SSH can work like telnet or ftp but will be more secure.

Note: Technically, SSH is also a tool. There is a client terminal program called SSH. It’s a non-graphical command line tool that provides a window which executes a command shell on the remote system.

SSH offers multiple modes of connecting but for the purposes of AWS, we will talk about key based access. To make things more secure, EC2 uses a key based authentication. Before starting an instance, you need to create a key pair.

Note: The below explanation of SSH is a gross over simplification. I am just trying to give you a feel for what is going on. If you really want to understand the technical details, I really do recommend that you purchase a book. My personal recommendation is SSH, The Secure Shell: The Definitive Guide from O’Reilly.

When an instance starts up for the first time, EC2 copies the ssh key that you created to the proper directory on the remote server. The remote server will be running the SSH Server software.

You will then use an SSH client to connect to the server. The client will ask for some information proving that the server really is who it says it is. The first time you connect to a server, the client won’t have that information available so it will prompt you to vertify that the server is legitimate.

You verify that information by comparing a thumbprint. Verifying a host is a bit beyond this book but do an internet search for for “ssh host thumbprint”. You’ll find a variety of articles explaining it in detail.

Once the client accepts the host, the client will send secret information to the host. This is your key data. If the host is able to make a match, it will authenticate you and let you login in. If the host then asks for a password, you key did not work and something is not configured properly. In my experience, it will probably be that your client key file is not in the place your client is expecting it to be.

What happens next depends on the tool you are using. If you are using a terminal program, ssh for example, you will now have a command prompt. If you are using sftp or scp, you will be able to copy files.

In addition to command line tools, there are GUI tools that use the SSH protocol. WinSCP is an excellent SCP client for Windows.

Regardless of the tools you use, SSH is busy encrypting everything you send over the wire. The SSH protocol has evolved over the years, and will probably evolve even more in the future, but it is currently running a very secure form of encryption.

If you are running Linux, you are pretty much finished at this point. SSH ships with every Linux distribution that I am aware of. If you are using Windows, however, you either need to install CyWin (a unix environment that runs in windows), or you’ll want to get PuTTY.
PuTTY

You can download all of the programs discussed in this section at:

http://www.chiark.greenend.org.uk/~sgtatham/putty/

I honestly have no idea why PuTTY is spelled PuTTY. I can figure the TTY part of it is from the Unix command that output a display. I’m not sure bout the Pu though.

I do know what PuTTY is though. PuTTY is a very simple implementation of an MS-Windows SSH terminal client. When I say it is simple, I mean that as a complement. This is a tool that does not get in the way.

You tell PuTTY to connect to a remote server and, as long as your keys are configured, it will connect you. If are not using keys, you can connect with passwords (if the host allows that). As a best practice, keys are recommends over passwords.

PuTTY is the terminal client but you can get a couple of other tools from the same author. PSFTP and PSCP offer secure file transfers. These tools are as easy to use as PuTTY and work pretty much the same way.

For command line syntax and configuration, take a look at the documentation at the link above.

A note about SSH keys and PuTTY, they are not compatible. This same web site offers a utility called PuTTYgen. When you create a key pair for EC2, you download that file to your local machine. PuTTYgen converts that file (a .pem file) to a private key file (a .ppk file).

PuTTY Key Generator


PuTTY Key Generator

The tool is named puttygen.exe. Run the executable and the above window pops up. To convert an amazon key to a PuTTY key, use the menu option Conversions ? Import Key. Load the .pem file that you downloaded and press the Save Private Key button.

It will warn you about leaving the passphrase blank. That’s ok.

Save the file to the location that PuTTY has been configured to look in for it’s keys.

Modifying File Associations With Registry Editor

This describes how to modify file associations with the registry editor. As an example assume we have a file of type .abc and two different editors of MyEditor1.exe and MyEditor2.exe.

1. Associate the extension with a filename string:

HKEY_CLASSES_ROOT\.abc

Add a default string of "abcfile"

2. Associate 1:

Create the following key:

HKEY_CLASSES_ROOT\abcfile\shell\Open
// Note that this key "Open" is the default verb

Add the string: &Open with MyEditor1

Create the following key:

HKEY_CLASSES_ROOT\abcfile\shell\open EVC3\command

Add the string: DriveLetter:\Path\To\File\MyEditor1.exe

3. Associate 2:

HKEY_CLASSES_ROOT\abcfile\shell\Open MyEditor2

Add the string: &Open with MyEditor2

Create the following key:

HKEY_CLASSES_ROOT\abcfile\shell\open EVC3\command

Add the string: DriveLetter:\Path\To\File\MyEditor2.exe

Wednesday, August 5, 2009

The Computer History Museum is established in Mountain View, California in 1996

The Computer History Museum is established in Mountain View, California in 1996. The mission of the museum is to preserve the artifacts of the information age and celebrate computing history. The Museum is home to one of the largest collection of computing artifacts in the world, comprised of over 4,000 items, 10,000 images, 4,000 feet of cataloged documentation and several gigabytes of software.

Export PuTTY saved sessions from Windows XP to Windows XP, Vista or Windows 7

To copy your PuTTY sessions from one Windows computer or profile to another do the following.

To export saved sessions to a file run below in the Windows XP run box (Start -> Run and then type copy/paste entire line below into box and hit return)

regedit /e putty.reg “HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions”

File will be saved in the home directory for your profile (e.g. c:\Documents and Settings\powercram)

To import settings to Windows Vista copy file to a folder of your choice on Vista PC.

Right click putty.reg file and select merge. You will be warned by Vista regarding changes. Allow the changes and your setting will get merged/imported into Vista registry.

Tuesday, August 4, 2009

The IBM User Group SHARE celebrates its 50th year of existence in 2005

The IBM User Group SHARE celebrates its 50th year of existence in 2005. The SHARE user group holds its first meeting at the Rand Corporation on August 15, 1955 in Santa Monica, Calif. The first meeting is called to help scientific users grapple with the problems of IBM’s first major commercial mainframe, the 704.

Send SMS Text Messages from your GMail Account

You can now send SMS text messages to anyone in your Gmail address book right from the Gmail website.

Go to your Gmail Labs settings and enable the "Text Messaging (SMS) in Chat" feature. The facility is currently available only for US phone numbers.

You can send (and receive) text messages via the embedded chat in Gmail website but not from the standalone Google Talk client. Yahoo! Mail, Windows Live Messenger and AOL AIM service have had the SMS messaging feature for quite some time now.

Send SMS Text Messages Via The Web for Free with Jaxtr

You can now send SMS messages to mobile phones in most international countries for free through the Jaxtr website.

Type the text along with the phone number and hit Send. For the test run, it took less than 5 seconds for the SMS to reach my phone.

Message recipients can reply to your txt message using their own cell phones or through a web link that’s included in the SMS message.

SMS messaging via Jaxtr is completely free and is independent of the cellular service provider.
Other than US and UK, Jaxtr lets you send SMS text messages to mobile phones located in lot of other countries like India, Singapore, Australia, Pakistan, Canada and lot of African nations. Going forward, the text messages sent through Jaxtr may include a line of advertisement.

Send SMS Text Messages from Your Computer to Any Mobile Phone With Outlook 2007 and Microsoft SMSOfficer

With Microsoft Outlook 2007, you can easily send (or receive) SMS text messages from computer to any mobile phone - just write a new SMS text message (like the way you compose emails in Outlook) and hit Send.

Similarly, you can also forward emails, pending tasks and calendar items from Outlook to your mobile phone via SMS.

How to send SMS text messages from computer using Outlook 2007 ?
To SMS enable your copy of Microsoft Outlook 2007, first register your mobile phone number at SMSOfficer. This new service from Microsoft supports almost all cellular operators in US and other international countries including India.

You will soon get an SMS verification code on your mobile phone, confirm and the SMS feature is activated in your Outlook without you having to download any additional software - you will need to click on a configuration link which sets the entire configuration for you.

Forward Emails as SMS Text Messages
To compose an SMS message in Outlook, select New -> Text Message. Outlook is automatically set up to use the standard text message limit of 160 characters. If your message exceeds the 160 character limit, the extra characters are truncated and delivered as a separate text message.

There are no registration charges and you also get 10 SMS credits for free at the time of joining SMS Officer. Once you exhaust the free limit, you need to pay for using the Outlook SMS service - payment can be made via PayPal.

When the other person replies to your SMS message, it will arrive in your mobile phone. Am not sure if you can use Outlook 2007 to send bulk SMS messages - i.e., one SMS message addressed to multiple recipeints.