Circuit Negma

C++, C, VB.NET, PCB, Electronics, Circuit Design

Archive for January, 2008

How to Remove Metadata

Posted by Circuit Negma on January 16, 2008


Source: Netzreport

If you want to remove metadata from JPEG files, you should keep in mind that these data can provide useful information (such as focal length, shutter speed, etc.). Therefore, you should never remove them from your original pictures. Instead, you should make a copy of the picture you want to publish and then remove the metadata from this copy.

Several software tools support the removal of metadata. A recommendable one is jhead. It is a free open source program that runs on a variety of operating systems (Windows/Linux/BSD/Mac). Because jhead is a command line tool, it is particularly suitable to be used with batch files.

Less experienced users should adhere to this step-by-step guide (Windows):

  1. Create the directory C:\jpeg.
  2. Copy all pictures whose metadata you want to remove to C:\jpeg.
  3. Download the program file jhead.exe to C:\jpeg.
  4. Click on “Start” and then “Execute…”.
  5. Windows 95/98/Me: Type command.com and click on “OK”.
    Windows NT/2000/XP: Type cmd.exe and click on “OK”.
  6. Change to C:\jpeg. To do so, type the following (the words in brackets are instructions to be executed, not to be typed):
    c:  (press return)
    cd\  (press return)
    cd jpeg  (press return)
  7. To remove all metadata of all JPEG files in “C:\jpeg”, type:
    jhead -purejpg *  (press return)

If you prefer programs with a graphical user interface, you should try IrfanView. It is a free program for Windows that allows you to view and edit images. Besides IrfanView itself, you need the plug-in “Lossless JPG Transformations”. More detailed information about how to install this plug-in can be found on IrfanView’s homepage.

Less experienced users should stick to these instructions:

  1. Download IrfanView and its plug-ins and install them.
  2. Create the directory C:\jpeg.
  3. Copy all pictures whose metadata you want to remove to C:\jpeg.
  4. Start IrfanView. In its menu bar, click on “File” and then “Thumbnails”.
  5. A new window has opened. In its left column, select C:\jpeg. The right column will now show small preview images of all pictures of C:\jpeg.
  6. Select all pictures. To do so, click on “Options” in the menu bar of the new window and then “Select all”.
  7. In the same menu bar, click on “File”, “JPG Lossless Operations” and then “Lossless transformation with selected thumbs…”.
  8. A new window has opened. In the section “Transformation”, select “None (can be used for optimizing and cleaning)”.
  9. In the section “JPG APP marker options”, select “Clean all APP markers”.
  10. Finally, click on “Start”.

 

 

Why Should Metadata Be Removed?

If you intend to publish JPEG files on the Internet, you might want to remove all metadata to reduce the file size of the JPEG files. Depending on what kinds of metadata are stored in the file, the reduction can range between a few bytes and several kilobytes. For example, if you have a website with metered bandwidth or if you have visitors with dialup modems, you might be interested in saving as much bytes as possible.

Another reason why you might want to consider removing all metadata beforehand is that metadata can give away potentially sensitive information. This information can mean a thread to your privacy or to other legitimate interests (e. g. the interest of journalists to protect their sources). The following fictitious and real-life examples try to illustrate the problematic nature of metadata information:

  • Many digital cameras embed a small preview image (thumbnail) of the picture in the header of each JPEG file. This makes it possible to quickly browse the pictures. Not all image manipulation programs update this thumbnail along with the main picture. The consequence could be that an edited picture retains the original unmodified version of the picture as an Exif datum. In some cases, this may only be inconvenient; in other cases, this could create a significant information leak. For example, a supposedly anonymized picture of a person still shows his or her identity in the thumbnail. Another, more embarrassing example is the case of television personality Cat Schwartz (e.g. TechTV). Schwartz had published a photograph of herself on her personal blog. Because the program she had used to edit the picture did not update the thumbnail, the thumbnail revealed more nude facts than originally intended.

Posted in Uncategorized | Leave a Comment »

Analog to Digital Converter Calculator

Posted by Circuit Negma on January 15, 2008


The following is a java tool that I have built during my work on microcontrollers.

 

 

How to download this tool:

1. Right Click on one of the above pictures.

2. click on “Save Target As…” or “Save Link As…”

3. save the image to your hard disk

4. use WINZIP to open the saved image in step 3.

A. open WINZIP program

B. either you drag the image and drop it in WINZIP program.

or

Click on File > Open

under Files of type > select “All files”

and then select the image and click on open.

Posted in Uncategorized | 4 Comments »

Windows XP takes too long time to apply computer settings and personal settings

Posted by Circuit Negma on January 9, 2008


Does your Windows XP take too long time to apply computer settings and personal settings at the startup/boot time of Windows XP?

 

Scenario:

My Workstation is connected to a Windows 2003 server. After a few months, the windows start taking a longer time to apply computer settings and personal settings.

After examining Windows Events log, I found that the following events are related to the above mentioned issue.

To check and see if you got the same events in the events log, follow the following instruction to open/browse your windows events log:

  1. Right click on my computer.
  2. Click on Manage
  3. Locate Event Viewer on the left side of Computer Management window
  4. Click on + sign to expand the Event Viewer tree
  5. Click on application
  6. Locate the errors under the type Column on the right side of the Computer Management window
  7. Check if the logged errors has the same following source errors under source Column.

Product:
Windows Operating System

ID:
1053

Source:
Userenv

Version:
5.2

Symbolic Name:
EVENT_FAILED_USERNAME

Message:
Windows cannot determine the user or computer name. (%1). Group Policy processing aborted.

______________________________________________________________________________________________________________________________________

Product:
Windows Operating System

ID:
15

Source:
AutoEnrollment

Version:
5.2

Symbolic Name:
EVENT_FAIL_BIND_TO_DS

Message:
Automatic certificate enrollment for %1 failed to contact the active directory (%2). %3 Enrollment will not be performed.

_______________________________________________________________________________________________________________________________________

Solution 1:

You need to upgrade your Network Card Driver.

  1. Right Click on My Computer
  2. Click on Properties
  3. Click on the Hardware Tab
  4. Click on Device Manager
  5. Locate Network Adapters
  6. Click on the + sign to expand the Network Adapters tree
  7. Write down the name of your network card that appears under Network adapters.
  8. Type your network card name in the google search engine.

ex:

     intel network adapter 2112G driver

or

    intel network adapter 2112G

Posted in Uncategorized | 4 Comments »

Optimize Tortoise SVN Cache (TSVNCache.exe) Disk I/O

Posted by Circuit Negma on January 8, 2008


Source: Optimize Tortoise SVN Cache (TSVNCache.exe) Disk I/O

I’ve got a lot of background processes running and killing my disk performance with all the I/O they’re doing.  One of the primary offenders is the TortoiseSVN cache that helps put the icon overlays in Explorer.  Several folks I know disabled the cache altogether, but I like the icons.

Rather than disable the cache, you can optimize the paths it looks at so it only actually looks at working copies and not your whole disk.  If you keep all of your working copies in specific known locations, this is a really simple thing to do.  For example, I keep all of my checked out code in one of three places – a “dev” folder I have, the “Visual Studio 2005” folder in “My Documents,” and the “Visual Studio Projects” folder in “My Documents.”

To optimize the disk usage…

  1. Right-click on your desktop and select “TortoiseSVN -> Settings…”
  2. In the tree view, find the “Look and Feel/Icon Overlays” branch.
  3. In the “Exclude Paths” box, put C:\* to exclude the entire C drive.  If you have more drives than that, exclude them all at the top level.  Separate the values by newlines.
  4. In the “Include Paths” box, list all of the locations you have working copies, separated by newlines.  Again, this is easier if you keep all of your working copies in a specific folder or set of folders.  Using my example, this is what I put in the “Include Paths” box:
    C:\dev\*
    C:\Documents and Settings\tillig\My Documents\Visual Studio 2005\*
    C:\Documents and Settings\tillig\My Documents\Visual Studio Projects\*

    And here’s a screen shot:
    TortoiseSVN icon overlay options - set the
  5. Click OK to apply the changes.
  6. Either reboot or open Task Manager and kill “TSVNCache.exe” so it restarts when needed.  You have to restart it for these options to take effect.

After I did this, the icon overlays still worked great but the disk I/O went down to nearly nothing.  YMMV.

Posted in Uncategorized | 4 Comments »

Printing Directory Listings

Posted by Circuit Negma on January 8, 2008


by Mitch Tulloch, author of Windows Server Hacks
01/04/2005

“How can I print thee? Let me count the ways….”

Liz Browning would probably have written something like that in her blog if she lived today. Imagine her writing poetry on her laptop and saving it in a folder named C:\Sonnets, when suddenly she gets an email from her publisher saying he needs the titles of all the poems she’s written so far. So Liz opens Windows Explorer and selects the C:\Sonnets folder to display a list of sonnets in the right-hand pane (Figure 1). Then she wonders, How can I print a list of titles of these files?

Figure 1
Figure 1. How can Liz print a list of titles of her sonnets for her publisher?

Funny how often users need to do this, yet there’s no simple way to accomplish the simple task through the Windows GUI. Of course, if you are familiar with the command line or can do some scripting, it’s not difficult. So, out of curiosity I decided to “count” the ways this simple task could be done in Windows; here’s what I came up with.

1. Using the Command Line

The simplest way is to use the good old dir command with the /b switch to suppress everything except the filenames. For example, to display the names of files in C:\Sonnets, you do the following:

C:\>dir c:\sonnets /b

which produces:

But only three in all God’s universe.doc
Go from me. Yet I feel that I shall stand.doc
I lift my heavy heart up solemnly.doc
I thought once how Theocritus had sung.doc
The face of all the world is changed, I think.doc
Thou hast thy calling to some palace-floor.doc
Unlike are we, unlike, O princely Heart!.doc

You can either redirect the output to a text file with:

dir c:\sonnets /b > titles.txt

Or you can redirect it to your default printer with:

dir c:\sonnets /b > prn

If you don’t want to open a command-prompt window first, you can simply go to Start -> Run and type:

cmd /c dir c:\sonnets /b > lpt1

If the directory you want to list contains subdirectories, you can use tree instead of dir:

cmd /c tree c:\sonnets /f > lpt1

2. Adding a Context Menu Item

It would be nice to right-click on a folder in Windows Explorer and print a list of items in the folder, wouldn’t it? This is easy to do by first creating the following batch script using Notepad:

@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit

Save this with some name like printdir.bat in your %windir% directory, and add “Print Directory Listing” to your context menu for Windows Explorer as follows. Open the Folder Options tool in Control Panel, select the File Types tab, and in the File Types column select the item labeled File Folder. Then click on the Advanced button, click on New, and specify a name for the action you want to perform and the batch file that performs it (Figure 2):

Figure 2
Figure 2. Associating the batch file printdir.bat with the action “Print Directory Listing”

Once you’re done, you can right-click on a folder in Windows Explorer and print a list of the files it contains (Figure 3):

Figure 3
Figure 3. Printing a directory listing from Windows Explorer

This hack is cool, but it has a flaw when you implement it on XP: after you’ve implemented it, every time you try to open a folder using Windows Explorer, the Search Companion window opens instead of the folder you selected. The workaround is a quick Registry edit described in Knowledge Base article 321379, where this hack is found. Of course, you can further customize the hack by tweaking the syntax of the dir command or replacing it with tree, and so on.

3. Using Windows Script Host

Windows Script Host lets you leverage the power of scripting languages like VBScript and JScript to automate almost any task you need to perform. For example, here’s a simple JScript that will list the names of all the files in the C:\Sonnets folder:

var fso, e, file;
fso = new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.GetFolder("c:\sonnets").files);
for (e.moveFirst(); ! e.atEnd(); e.moveNext()) {
  file = e.item();
  WScript.echo(file.name);
}

Saving this script as listdir.js and running it with Cscript.exe, the command-line script interpreter for WSH, produces the expected output (Figure 4):

Figure 4
Figure 4. Using WSH to print a directory listing

I found this useful script snippet in the book Windows XP Under the Hood: Hardcore Windows Scripting and Command Line Power by Brian Knittel. It’s a terrific resource if you’re still new to WSH scripting and want to explore its flexibility and power.

4. Quick and Dirty

Finally, if Liz doesn’t feel confident working from the command line or developing scripts, she can send her publisher a directory listing of her C:\Sonnets folder using the following quick-and-dirty hack: press Alt-Print Screen, paste the contents of the clipboard into Paint, save it as a bitmap file, and send it as an email attachment. Obviously pretty crude, and you wouldn’t think this approach would be worth its very own article in the Microsoft Knowledge Base, but you’d be wrong–heh!

Posted in Uncategorized | 3 Comments »

test

Posted by Circuit Negma on January 7, 2008


test

test

test

test

Posted in Uncategorized | Leave a Comment »